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: Mikhail Sviridov
Subject: RE: Flexisip_push Invalid server response with Invalid token
Date: Sun, 22 Mar 2020 10:13:02 +0000

Hi there,

 

I am not 100% certain, but it looks like you have certificate created specifically for “voip” service. You can check by your self. That pem file is a text file containing certificate key and two headers. The (first) header will say you if it was created for voip. In my case it looks like this:

Bag Attributes

    friendlyName: VoIP Services: my.push.example

    localKeyID: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX X

subject=/UID=my.push.example.voip/CN=VoIP Services: my.push.example/OU=HNRF442267/O=Smart Home SA/C=US

issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority

 

take notice about this part:

subject=/UID=my.push.example.voip

If you have that - your pem file must be like this: my.push.example.voip.dev.pem

 

If that part looks like this: subject=/UID=my.push.example  

without voip part – it is not issued for the voip and than… I guess flexisip (probably) will not work with that certificate.

 

Sorry I did not notice missing ‘.voip’ part before… my bad.

 

Also I did see that this error actually is not about “Invalid token”, but rather about “Invalid server” – need to check that in the flexisip code…

 

Sent from Mail for Windows 10

 

From: Lai Li
Sent: Saturday, March 21, 2020 6:44 PM
To: Mikhail Sviridov
Cc: address@hidden
Subject: Re: Flexisip_push Invalid server response with Invalid token

 

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]