flexisip-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flexisip_push Invalid server response with Invalid token


From: Lai Li
Subject: Re: Flexisip_push Invalid server response with Invalid token
Date: Sat, 21 Mar 2020 23:44:37 +0800

Ok, I check the "Generate a certificate" part in this page https://wiki.linphone.org/xwiki/wiki/public/view/Flexisip/Configuration/   again.
I re-create the certificate then I have Certificate.P12.  and I also have new bundle id is my.push.example.
First I try to find other tool to verify everything is ok. so i found the tool called  PushNotifications (https://github.com/onmyway133/PushNotifications/releases/tag/1.7.3) to verify my P12 is correct or not.
After testing, my phone is able to get notification from this tool by using p12 and with modified bundle id my.push.example.voip.
It was very strange that I have to add .voip after my bundle id.  or it cannot get any notification by this tool.

so, I think my p12 is ok, then I generate pem, put it into flexisip.
But when I use
./flexisip_pusher --pntype apple --appid my.push.example.dev --pntok 7F6F5DA49A09AE73B483C43E6BFC157F749C39F91224B91FF349E99034EF031C --debug

I know my app is developer version. I only put one pem in /etc/flexisip/apn/my.push.example.dev.pem
But it still return Invalid token to me. Below is error log.


2020-03-21 15:19:29:700 flexisip-debug-Searching push notification client on dir [/etc/flexisip/apn]
2020-03-21 15:19:29:708 flexisip-debug-Certificate /etc/flexisip/apn/my.push.example.voip.dev.pem has a valid expiration: Apr 20 10:11:08 2021 GMT.
2020-03-21 15:19:29:712 flexisip-debug-Adding ios push notification client [my.push.example.voip.dev]
2020-03-21 15:19:29:718 flexisip-debug-Certificate /etc/flexisip/apn/my.push.example.dev.pem has a valid expiration: Apr 20 10:11:08 2021 GMT.
2020-03-21 15:19:29:722 flexisip-debug-Adding ios push notification client [my.push.example.dev]
2020-03-21 15:19:29:723 flexisip-debug-PNR 0x11689b0 payload is {"aps":{"alert":{"loc-key":"IM_MSG","loc-args":["Pusher"]},"sound":"msg.caf","badge":1},"call-id":"","pn_ttl":2592000,"uuid":"","send-time":"2020-03-21 15:19:29"}
2020-03-21 15:19:29:723 flexisip-debug-PushNotificationClient my.push.example.dev.pem PNR 0x11689b0 running, queue_size=0
2020-03-21 15:19:29:723 flexisip-debug-PushNotificationClient my.push.example.dev.pem next, queue_size=1
2020-03-21 15:19:32:091 flexisip-debug-PushNotificationClient my.push.example.dev.pem PNR 0x11689b0 sent 223/223 data
2020-03-21 15:19:32:091 flexisip-debug-PushNotificationClient my.push.example.dev.pem PNR 0x11689b0 waiting for server response
2020-03-21 15:19:32:486 flexisip-debug-PushNotificationClient my.push.example.dev.pem PNR 0x11689b0 read 6 data:
2020-03-21 15:19:32:486 flexisip-warning-PushNotificationClient my.push.example.dev.pem PNR 0x11689b0 failed: Invalid server response: PNR 0x11689b0 with identifier 1 failed with error 8 (Invalid token)


I want to know , what is the real error code that return from apn in http response? I think error 8 (Invalid token) is belongs to flexisip error code not apn's error code.
And I check the log from flexisip, I also noticed that my ios app(linphone), which send REGISTER with strange suffixes voip.dev in app-id ? 

REGISTER sip:localhost SIP/2.0
Via: SIP/2.0/TCP 192.168.31.100:50754;alias;branch=z9hG4bK.RvR08dTRL;rport=59520;received=172.17.0.1
From: <sip:1234@localhost>;tag=FNxgPTEJu
To: sip:1234@localhost
CSeq: 24 REGISTER
Call-ID: vpHrl5sdFa
Max-Forwards: 70
Supported: replaces, outbound, gruu
Accept: application/sdp, text/plain, application/vnd.gsma.rcs-ft-http+xml
Contact: <sip:1234@192.168.31.100:50754;app-id=my.push.example.voip.dev    <-----here


Is the error (Invalid token) related to suffixed "voip" ?

Please help me to find out which part of my configuration is not correct.


On Fri, 20 Mar 2020 at 17:47, Mikhail Sviridov <address@hidden> wrote:

Hi there,

Try to use /etc/flexisip/apn/com.alohastudio.example.dev.pem in the case of development (iOS understands it is development if the app was not downloaded from the appstore). Or use /etc/flexisip/apn/com.alohastudio.example.prod.pem in the case of production.

“prod” and “dev” suffixes are mandatory for the flexisip.

 

With Best Regards,

Mikhail.

 

Sent from Mail for Windows 10

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]