<div dir="ltr">Hi Babil,<div><br></div><div>Thank you very much for your answer.</div><div><br></div><div>I have another server that offers a RESTful API to send the push notifications, store the tokens, etc.</div><div><br></div><div>I'm using OpenSIPS <strong style="color:rgb(102,102,102);font-family:'Trebuchet MS',sans-serif,Verdana,Arial;font-size:13.008px;line-height:21.5933px">2.1.2</strong></div><div class="gmail_extra"><br></div><div class="gmail_extra">Jose</div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-02 14:00 GMT+01:00 Babil (Golam Sarwar) <span dir="ltr"><<a href="mailto:gsbabil@gmail.com" target="_blank">gsbabil@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi José,<br>
what is your mechanism to initiate sending the push? For example, what<br>
function/script are you calling? Please also add the OpenSIPS version you are<br>
using.<br>
<div><div class="h5"><br>
On 3/2/16 4:47 AM, José Expósito wrote:<br>
> Hi all,<br>
><br>
> I'm trying to implement Apple Push Notifications with OpenSIPS.<br>
><br>
> At the moment, when Alice calls Bob and Bob is offline, I send the push<br>
> notification to Bob and call async sleep until Bob becomes online and I proceed<br>
> whit the call as usual:<br>
><br>
> > if (!lookup("location","m")) {<br>
> > if (is_method("INVITE")) {<br>
> > # Sends the notification here<br>
> > t_reply("100", "Trying");<br>
> > t_reply("180", "Ringing");<br>
> > async(sleep("5"), wait_bob);<br>
> > }<br>
> ><br>
> > [...]<br>
> ><br>
> > route[wait_bob] {<br>
> > if (!lookup("location","m")) {<br>
> > async(sleep("2"), wait_bob);<br>
> > }<br>
> > if (!t_relay()) { # This establishes the call as usual when Bob<br>
> becomes online<br>
> > send_reply("500","Internal Error");<br>
> > }<br>
> > exit;<br>
> > }<br>
><br>
><br>
> This mechanism works without problems, but, when integrating and RTP proxy<br>
> OpenSIPS is randomly crashing after a while.<br>
><br>
> That's why I'm trying to avoid the use of async sleep and switch to another<br>
> mechanism.<br>
><br>
> As usual, how do you solve this problem?<br>
> Is there any way to send a new (re)INVITE when Bob becomes online?<br>
><br>
> I'm trying to use create_dialog() when Bob registers, but it doesn't look to<br>
> work -I'm probably using it wrong.<br>
><br>
> Thank you very much in advance<br></div></div></blockquote></div></div></div>