Hi Paul, Paul Wise wrote: > 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? >
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 > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > [email protected] > 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 _______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
