<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Hi,
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">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 class="ContentPasted0">
</div>
<div class="ContentPasted0">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 class="ContentPasted0">
</div>
<div class="ContentPasted0">### CODE ###</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">modparam("alias_db", "append_branches", 1)</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">route {</div>
<div class="ContentPasted0"> if ( is_from_gw() ) {</div>
<div class="ContentPasted0"> alias_db_lookup("dbaliases");</div>
<div class="ContentPasted0"> t_on_branch("sip_user_branch");</div>
<div class="ContentPasted0"> }</div>
<div class="ContentPasted0"> route(relay);</div>
<div class="ContentPasted0"> return(0); </div>
<div class="ContentPasted0">}</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">branch_route[sip_user_branch] {</div>
<div class="ContentPasted0"> route(lookup_sip_user);</div>
<div class="ContentPasted0">}</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">route[lookup_sip_user] {</div>
<div class="ContentPasted0"> if ( ! lookup("location") ) {</div>
<div class="ContentPasted0"> drop();</div>
<div class="ContentPasted0"> }</div>
<div class="ContentPasted0">}</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">route[relay] {</div>
<div class="ContentPasted0"> if ( ! t_relay() ) {</div>
<div class="ContentPasted0"> sl_reply_error();</div>
<div class="ContentPasted0"> rtpproxy_unforce();</div>
<div class="ContentPasted0"> return(0);</div>
<div class="ContentPasted0"> }</div>
<div class="ContentPasted0">}</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">### CODE ###</div>
<div><br class="ContentPasted0">
</div>
Any help would be appreciated, Thanks<br>
</div>
</body>
</html>