Re: [OpenSIPS-Users] Re-invite on mid_registrar

2023-02-02 Thread Răzvan Crainea
I am pretty sure you don't actually need a re-INVITE here, but rather an 
actual INVITE to Asterisk. Check out how push notifications should be 
handled in OpenSIPS:

https://blog.opensips.org/tag/push-notification/

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 1/4/23 16:37, nutxase via Users wrote:

Hi All!

I am trying to get opensips to send a re-invite to asterisk on incoming 
calls

my scenario is

  * Call comes to opensips
  * Opensips runs a custom script to wake up a device
  * Device sends a new registration to asterisk
  * Opensips needs to send a re-invite to asterisk(need help here)
  * Opensips Looks up the location with the below and sends the call


if (!mid_registrar_lookup("location")) {
            t_reply(404, "Not Found");
exit;
}

       t_relay();

      exit;
  }

my complete code is:

if (is_method("INVITE|MESSAGE")  {
         if (exec("/etc/opensips/pusher.sh $tu", , $var(out))) {
         xlog ("we pushed");
  } else {
         xlog("no  push happened");
}
         t_reply(100, "SUSPEND");

         route(push);

route[push] {


    xlog("suspending transaction");

sleep(5);
t_reply(100,"RESUME");
route (resume_route);


}
route[resume_route] {

   xlog("resuming transaction");


if (!mid_registrar_lookup("location")) {
            t_reply(404, "Not Found");
exit;
}

       t_relay();

      exit;
  }



Sent with Proton Mail  secure email.

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Re-invite on mid_registrar

2023-01-05 Thread nutxase via Users
anyone have any idea how i can get opensips to request a new invite here :(

Sent with [Proton Mail](https://proton.me/) secure email.

--- Original Message ---
On Wednesday, January 4th, 2023 at 2:37 PM, nutxase via Users 
 wrote:

> Hi All!
>
> I am trying to get opensips to send a re-invite to asterisk on incoming calls
> my scenario is
>
> - Call comes to opensips
> - Opensips runs a custom script to wake up a device
> - Device sends a new registration to asterisk
> - Opensips needs to send a re-invite to asterisk(need help here)
> - Opensips Looks up the location with the below and sends the call
>
> if (!mid_registrar_lookup("location")) {
> t_reply(404, "Not Found");
> exit;
> }
>
> t_relay();
>
> exit;
> }
>
> my complete code is:
>
> if (is_method("INVITE|MESSAGE") {
> if (exec("/etc/opensips/pusher.sh $tu", , $var(out))) {
> xlog ("we pushed");
> } else {
> xlog("no push happened");
> }
> t_reply(100, "SUSPEND");
>
> route(push);
>
> route[push] {
>
> xlog("suspending transaction");
>
> sleep(5);
> t_reply(100,"RESUME");
> route (resume_route);
>
> }
> route[resume_route] {
>
> xlog("resuming transaction");
>
> if (!mid_registrar_lookup("location")) {
> t_reply(404, "Not Found");
> exit;
> }
>
> t_relay();
>
> exit;
> }
>
> Sent with [Proton Mail](https://proton.me/) secure email.___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Re-invite on mid_registrar

2023-01-04 Thread nutxase via Users
Hi All!

I am trying to get opensips to send a re-invite to asterisk on incoming calls
my scenario is

- Call comes to opensips
- Opensips runs a custom script to wake up a device
- Device sends a new registration to asterisk
- Opensips needs to send a re-invite to asterisk(need help here)
- Opensips Looks up the location with the below and sends the call

if (!mid_registrar_lookup("location")) {
t_reply(404, "Not Found");
exit;
}

t_relay();

exit;
}

my complete code is:

if (is_method("INVITE|MESSAGE") {
if (exec("/etc/opensips/pusher.sh $tu", , $var(out))) {
xlog ("we pushed");
} else {
xlog("no push happened");
}
t_reply(100, "SUSPEND");

route(push);

route[push] {

xlog("suspending transaction");

sleep(5);
t_reply(100,"RESUME");
route (resume_route);

}
route[resume_route] {

xlog("resuming transaction");

if (!mid_registrar_lookup("location")) {
t_reply(404, "Not Found");
exit;
}

t_relay();

exit;
}

Sent with [Proton Mail](https://proton.me/) secure email.___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users