[OpenSIPS-Users] Re-invite on mid_registrar

nutxase nutxase at proton.me
Wed Jan 4 14:37:16 UTC 2023


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20230104/1284becb/attachment.html>


More information about the Users mailing list