Discussion:
[OpenSIPS-Users] OpenSIPS & Apple Push Notifications Service
Paul Wise
15 years ago
Permalink
Hi all,

We would like to implement support in our server for Apple's Push
Notifications Service (APNS). The way this will work is that when a call
comes into OpenSIPS for one user (from another user or another domain)
and that user is not registered/online, we wake up (or launch) our SIP
app on the user's iPhone by sending a push notification to Apple, who
forward the notification to the user's iPhone. Our SIP app then starts
up, registers to OpenSIPS and receives the call/text. Most of this is
easy, some quick perl functions to generate APNS packets in OpenSIPS,
socat to connect to Apple and forward the packets, monit to keep socat
running, cron+socat to download feedback information for when people
uninstall our SIP iPhone app, msilo for storing MESSAGE requests before.

The part that I haven't be able to figure out how to do yet is how to
connect the incoming call to a user when they have registered.

I thought maybe direct the call initially to an asterisk media server
(for a ringing tone), wait for a timeout, check if the user is now
online and if so connect them. Then rinse and repeat. This seems a bit
hacky, I'd prefer for the REGISTER handling to immediately direct the
call to the right contact to reduce unnecessary delays.

Has any one done this before or have any ideas for implementation?
--
bye,
pabs

http://bonedaddy.net/pabs3/
Adrian Georgescu
15 years ago
Permalink
Hello Paul,

What you describe is too convoluted to be implemented the way you described it in the Proxy alone, if possible at all. You would need to park the call somewhere on some intermediate B2BUA, wake up the device, know when this happened and then start a new call to it when is reachable.

There is a simpler way to solve this using the native capabilities of iOS 4. The SIP UA should register using TCP to the SIP Proxy, if you do this the whole magic is automatically handled by the iOS 4 wake-up from background capability. For UDP transport this magic does not work.

Adrian
...
Bogdan-Andrei Iancu
15 years ago
Permalink
Hi Paul,
...
Unfortunately this is impossible as there is no mechanism to control a
call from the script in the way of creating new branches for it (like
during the user registration, to search the INVITE transaction for that
user - still in ringing - and fork a new branch to the user location).

What you can do is a kind a busy waiting : send the call to a ringing
tone in asterisk (without accepting the call, but just keep it in 180
/183) and after 2 sec timeout -> failure route -> check again if
registration was done -> if not send again to asterisk and repeat the
loop; if yes, let the call go to the end device.


Regards,
Bogdan
Post by Paul Wise
------------------------------------------------------------------------
_______________________________________________
Users mailing list
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
--
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro
Loading...