<div style="font-family: Arial; font-size: 14px;">Hi All!</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">I am trying to get opensips to send a re-invite to asterisk on incoming calls</div><div style="font-family: Arial; font-size: 14px;">my scenario is </div><div style="font-family: Arial; font-size: 14px;"><ul><li><span>Call comes to opensips</span></li><li><span>Opensips runs a custom script to wake up a device</span></li><li><span>Device sends a new registration to asterisk</span></li><li><span>Opensips needs to send a re-invite to asterisk(need help here)</span></li><li><span>Opensips Looks up the location with the below and sends the call</span></li></ul><div><span><br></span></div><div><span><span style="background-color:rgb(255, 255, 255)">if (!mid_registrar_lookup("location")) {</span><div style="background-color:rgb(255, 255, 255)"><span>           t_reply(404, "Not Found");</span></div><div style="background-color:rgb(255, 255, 255)"><span>exit;</span></div><div style="background-color:rgb(255, 255, 255)"><span>}</span></div><div style="background-color:rgb(255, 255, 255)"><br></div><div style="background-color:rgb(255, 255, 255)"><span>      t_relay();</span></div><div style="background-color:rgb(255, 255, 255)"><br></div><div style="background-color:rgb(255, 255, 255)"><span>     exit;</span></div><div style="background-color:rgb(255, 255, 255)"><span> }</span></div><br></span></div><div><span>my complete code is:</span></div><div><span><br></span></div><div><span><span>if (is_method("INVITE|MESSAGE")  {</span><div><span>        if (exec("/etc/opensips/pusher.sh $tu", , $var(out))) {</span></div><div><span>        xlog ("we pushed");</span></div><div><span> } else {</span></div><div><span>        xlog("no  push happened");</span></div><div><span>}</span></div><div><span>        t_reply(100, "SUSPEND");</span></div><div><br></div><div><span>        route(push);</span></div><span></span><br></span></div><div><span><span>route[push] {</span><div><br></div><div><br></div><div><span>   xlog("suspending transaction");</span></div><div><br></div><div><span>sleep(5);</span></div><div><span>t_reply(100,"RESUME");</span></div><div><span>route (resume_route);</span></div><div><br></div><div><br></div><div><span>}</span></div><div><span>route[resume_route] {</span></div><div><br></div><div><span>  xlog("resuming transaction");</span></div><div><br></div><div><br></div><div><span>if (!mid_registrar_lookup("location")) {</span></div><div><span>           t_reply(404, "Not Found");</span></div><div><span>exit;</span></div><div><span>}</span></div><div><br></div><div><span>      t_relay();</span></div><div><br></div><div><span>     exit;</span></div><div><span> }</span></div><span></span><br></span></div><div><span><span></span><br></span></div></div><div style="font-family: Arial; font-size: 14px;"><br></div>
<div class="protonmail_signature_block" style="font-family: Arial; font-size: 14px;">
    <div class="protonmail_signature_block-user protonmail_signature_block-empty">
        
            </div>
    
            <div class="protonmail_signature_block-proton">
        Sent with <a target="_blank" href="https://proton.me/" rel="noopener noreferrer">Proton Mail</a> secure email.
    </div>
</div>