Hi,
I didn't mention in my reply, and it wasn't probably clear, that Kamailio won't send the actual push to Apple or Google (for GCM).
This needs to be implemented separately, either with a self written service or using a web service like the Amazon's one.
In the example from my presentation the call to 

lua_runstring("do_push([[$hdr(X-VxTo)]], [[$tU]], [[$hdr(XVxFrom)]], [[$fU]], [[$ci]])")<0)

is actually just an example of where, in the Kamailio script, the logic for sending the push should be placed.

Regards,

Federico

On Sun, Dec 11, 2016 at 5:46 PM, Federico Cabiddu <federico.cabiddu@gmail.com> wrote:
Hi Benjamin,
if you don't plan to support multiple devices per account just the t_suspend/t_continue pair should be enough to support push notification.
This being said you can easily integrate the example in my presentation in the Kamailio's configuration given in the Asterisk/Kamailio integration page.
For the INVITE you have to modify the route[LOCATION] and, instead of performing the lookup, suspend the transaction and send the push. In this way you'll also send the push for every INVITE, regardless of the registration state. You have then to modify the REGISTRAR route after calling save() to resume the transaction or to append new branches (if you use tsilo). I think that the snippets from my example should be enough.
Hope this helps.

Regards,

Federico 

On Wed, Dec 7, 2016 at 2:32 AM, Benjamin Fitzgerald <ben@letscorp.us> wrote:
Hello, my goal is to address iOS 10's removal of periodic TCP connections in iOS apps with their replacement PushKit, a push-based alternative all VoIP apps should implement.

In order to have iOS apps receive SIP calls in the background, I believe I need to use tsilo to suspend the INVITE transaction send a push notification to the device. I have been following the presentation here (http://www.kamailio.org/events/2015-KamailioWorld/Day2/20-Federico.Cabiddu-Kamailio-In-A-Mobile-World.pdf) however I am not sure how to integrate it with Asterisk (http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb). 

My questions can be summarized below:

(1) What changes need to be made from Federico's presentation to use with the Kamailio/Asterisk integration?

(2) How can I modify the config to send push notifications for EVERY invite? This is to address the scenario where a device goes offline before the SIP registration expires and a call is received within that window. iOS is very aggressive about killing background applications so it's likely as soon as user leaves the VoIP app, the device will become unreachable.

Thanks for any help.

Benjamin Fitzgerald
LETS Corporation



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users