<div dir="ltr">Maybe a send_reply(404) after if(!lookup(location)), instead of drop?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 26, 2023 at 8:30 PM John Sliney <<a href="mailto:John.Sliney@lcs.com">John.Sliney@lcs.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-6716322751826711476">
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:11pt;color:rgb(0,0,0)">
Hi,
<div><br>
</div>
<div>I’m currently attempting to take an INVITE from an Asterisk server that is requesting an extension number, perform dbalias lookups to have extensions turned into sip users (x1000 -> test_hardphone) and then do location lookups on
those sip users. There can be multiple sip users for each extension and multiple locations for each sip user. </div>
<div><br>
</div>
<div>Using the code below partially works but when there are no location entries for the requested sip user, OpenSIPS returns a 500 and prints out “ERROR: t_forward_nonack failed” how can I have OpenSIPS instead respond with a 404?</div>
<div><br>
</div>
<div>### CODE ###</div>
<div><br>
</div>
<div>modparam("alias_db", "append_branches", 1)</div>
<div><br>
</div>
<div>route {</div>
<div> if ( is_from_gw() ) {</div>
<div> alias_db_lookup("dbaliases");</div>
<div> t_on_branch("sip_user_branch");</div>
<div> }</div>
<div> route(relay);</div>
<div> return(0); </div>
<div>}</div>
<div><br>
</div>
<div>branch_route[sip_user_branch] {</div>
<div> route(lookup_sip_user);</div>
<div>}</div>
<div><br>
</div>
<div>route[lookup_sip_user] {</div>
<div> if ( ! lookup("location") ) {</div>
<div> drop();</div>
<div> }</div>
<div>}</div>
<div><br>
</div>
<div>route[relay] {</div>
<div> if ( ! t_relay() ) {</div>
<div> sl_reply_error();</div>
<div> rtpproxy_unforce();</div>
<div> return(0);</div>
<div> }</div>
<div>}</div>
<div><br>
</div>
<div>### CODE ###</div>
<div><br>
</div>
Any help would be appreciated, Thanks<br>
</div>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></blockquote></div>