Open brianjmurrell opened 5 years ago
Nobody has any thoughts on why this would be not working correctly?
Is there really nobody who can offer any input or guidance on this issue at all?
Why is it that nobody is willing to help with this issue?
Hi Brian,
I'm running in this exact same issue. Have you managed to solve it, if so, would you be willing to share your solution?
I gave up on Flexisip a long time ago. I have concluded that it just doesn't work (at least as a push proxy in front of a PBX like Asterisk) and the developers are not willing to help diagnose why -- as can be evidenced by this ticket with absolutely no response whatsoever.
I push from Asterisk directly and don't bother trying to make Flexisip a push proxy for it.
Does your setup work with devices that register after the push, when the call already had been made (aka late forking as its called in Flexisip)? I have a Asterisk server that is able to push notifcations, but devices that need to register when the push is coming don't receive the call at all.
Yes it does. I use an AGI script that Asterisk calls when it wants to send a call to a push device. That AGI script doesn't return until the device registers or it times out. That was easy enough to do.
There are some caveats though. Linphone only registers when it's received the push if it doesn't already have a SIP "session" open to the PBX. This generally means that it has not been killed as an idle app by android. So for example, assuming linphone has been killed by android... asterisk sends a push, android receives the push and starts up linphone, which since it is being "started" it registers. The AGI script sees the registration, returns and Asterisk continues it's dialplan and sends an INVITE to Linphone. But let's say as soon as that call is done, another comes in. Because android has not had a chance to kill linphone yet, linphone realizes that it still has a "sesssion" from the call just a few minutes ago and does not re-register because of that. The AGI script now fails to see a registration which allows it to return control back to Asterisk to send the INVITE. This requires that the AGI script be able to determine if linphone has been killed or not. The only way to do this is to use TCP for the SIP signalling and then the AGI queries the open sockets on the system to see if linphone still has an open TCP socket. If it does, it just returns without waiting for a registration
The other caveat is that if linphone is just one of several phones you want to ring for a given extension, it's not really nice to hold up the ringing of non-push extensions while waiting for a push device like linphone, to register as this can take several (up to 10 or more in practical purposes). In order to handle that you need what we think Flexisip is calling "late forking". This is achievable in Asterisk, so that the incoming call sends INVITEs to all of the non-push devices right away and waits for the push devices to register and then sends them their INVITEs.
A third caveat is that none of this works reliably on IPv6. This is a general caveat about SIP clients on mobile devices and has nothing to do with Asterisk or Flexisip, etc. In my experience and from doing a lot of googling, it seems that many phone manufactures put the IPv6 stack to sleep on phones where they don't do the same with IPv4. What this means is that android receives the push, wakes (starts) up linphone and while linphone is able to send IPv4 traffic while the phone is still technically in doze, it is unable to send IPv6 traffic. It believes it is, but the phone is just not sending it out. I (and others) suspect that this is some kind of battery savings mechanism that is needed for IPv6 and not IPv4. Perhaps to do with the amount of "idle" multiicast traffic that IPv6 uses that IPv4 does not. That's just a guess though.
Thank you for your very in depth answer. This is probably the way to go! Thanks a lot!
NP. I have always intended to write up how I achieved a fully-functioning push configuration for Asterisk in a proper post somewhere. Just haven't found the time.
It would be a great start if you could just tell me how your script checks if a device has registered or not. I'm looking at ChanIsAvail and enabling qualify, but I'm not sure if that's the way to go.
@SibertDekimo We should take this discussion off of this ticket. I've uploaded my AGI script to https://github.com/brianjmurrell/Android-push-for-Asterisk/blob/master/push.sh. Let's continue any discussion there. You can open a PR or an issue about it if you wish.
I've chased down why I'm not getting push notifications.
For reasons beyond my current comprehension of the BC SIP stack, in
PushNotification::onRequest()
returns
NULL
and assigns it intotransaction
, which means that no push notification is sent:Any ideas or thoughts on why this would be?