Hi guys,<br><br>I am trying to troubleshoot errors in my OpenSIPS config file but unable to understand what am i doing wrong.<br><br>The log file shows as follows:<br>Dec 26 21:38:02 [22302] INFO:usrloc:ul_init_locks: locks array size 512<br>
Dec 26 21:38:02 [22302] INFO:registrar:mod_init: initializing...<br>Dec 26 21:38:02 [22302] INFO:textops:mod_init: initializing...<br>Dec 26 21:38:02 [22302] INFO:avpops:avpops_init: initializing...<br>Dec 26 21:38:02 [22302] INFO:auth:mod_init: initializing...<br>
Dec 26 21:38:02 [22302] INFO:auth_db:mod_init: initializing...<br>Dec 26 21:38:02 [22302] INFO:core:probe_max_receive_buffer: using a UDP receive buffer of 214 kb<br>Dec 26 21:38:56 [22303] ERROR:core:forward_reply: no 2nd via found in reply<br>
Dec 26 21:38:57 [22308] ERROR:core:forward_reply: no 2nd via found in reply<br>Dec 26 21:38:58 [22306] ERROR:core:forward_reply: no 2nd via found in reply<br>Dec 26 21:38:59 [22304] ERROR:core:forward_reply: no 2nd via found in reply<br>
Dec 26 21:39:00 [22303] ERROR:core:forward_reply: no 2nd via found in reply<br>Dec 26 21:39:10 [22308] ERROR:core:forward_reply: no 2nd via found in reply<br>Dec 26 21:39:11 [22306] ERROR:core:forward_reply: no 2nd via found in reply<br>
D<br clear="all"><br>-- <br><br><br>My opensips.cfg is as follows:<br><br>route{<br><br> # initial sanity checks -- messages with<br> # max_forwards==0, or excessively long requests<br><br> if (!mf_process_maxfwd_header("10")) {<br>
sl_send_reply("483","Too Many Hops");<br> exit;<br> };<br><br> if (msg:len >= 2048 ) {<br> sl_send_reply("513", "Message too big");<br> exit;<br>
};<br><br> # we record-route all messages -- to make sure that<br> # subsequent messages will go through our proxy; that's<br> # particularly good if upstream and downstream entities<br> # use different transport protocol<br>
<br> if (!method=="REGISTER")<br> record_route();<br><br> # subsequent messages withing a dialog should take the<br> # path determined by record-routing<br><br> if (loose_route()) {<br> # mark routing logic in request<br>
append_hf("P-hint: rr-enforced\r\n"); <br> route(1);<br> };<br><br> if (!uri==myself) {<br> # mark routing logic in request<br> append_hf("P-hint: outbound\r\n"); <br>
route(1);<br> };<br><br> # if the request is for other domain use UsrLoc<br> # (in case, it does not work, use the following command<br> # with proper names and addresses in it)<br> if (uri==myself) {<br>
<br> if (method=="REGISTER") {<br> if (!www_authorize("", "subscriber")) {<br> www_challenge("", "0");<br> exit;<br> };<br>
<br> save("location");<br> exit;<br> };<br><br> # requests for Media server<br> if(is_method("INVITE") && !has_totag() && uri=~"sip:\*9") {<br>
route(3);<br> exit;<br> }<br><br> # mark transaction if user is in voicemail group<br> if(is_method("INVITE") && !has_totag()<br> && is_user_in("Request-URI","voicemail"))<br>
{<br> xdbg("user [$ru] has voicemail redirection enabled\n");<br> # backup R-URI<br> avp_pushto("$ru","$avp(i:10)");<br> #avp_write("$ruri","$avp(i:10)");<br>
setflag(2);<br> };<br> # native SIP destinations are handled using our USRLOC DB<br> if (!lookup("location")) {<br> if(isflagset(2)) {<br> # route to Asterisk Media Server<br>
prefix("1");<br> rewritehostport("<a href="http://192.168.1.11:5060">192.168.1.11:5060</a>");<br> route(1);<br> } else {<br> sl_send_reply("404", "Not Found");<br>
exit;<br> }<br> };<br> append_hf("P-hint: usrloc applied\r\n"); <br> };<br><br> route(1);<br>}<br><br><br>route[1] {<br> <br> if(isflagset(2))<br> t_on_failure("1");<br>
<br> if (!t_relay()) {<br> sl_reply_error();<br> };<br> exit;<br>}<br><br><br># voicemail access<br># - *98 - listen caller's voice messages, being prompted for pin<br># - *981 - listen voice messages, being promted for mailbox and pin<br>
# - *98XXXX - leave voice message to XXXX<br>#<br>route[3] {<br> # direct voicemail<br> if (uri =~ "sip:\*98@" ) {<br> rewriteuser("1");<br> xdbg("voicemail access\n");<br>
} else if (uri =~ "sip:\*981@" ) {<br> strip(4);<br> rewriteuser("11");<br> } else if (uri =~ "sip:\*98.+@" ) {<br> strip(3);<br> prefix("1");<br>
} else {<br> xlog("unknown media extension $rU\n");<br> sl_send_reply("404", "Unknown media service");<br> exit;<br> }<br><br> # route to Asterisk Media Server<br>
rewritehostport("<a href="http://192.168.1.11:5060">192.168.1.11:5060</a>");<br> route(1);<br>}<br><br>failure_route[1] {<br> if (t_was_cancelled()) {<br> xdbg("transaction was cancelled by UAC\n");<br>
return;<br> }<br> # restore initial uri<br> avp_pushto("$ru","$avp(i:10)");<br> #avp_pushto("$ru", "i:10");<br> prefix("1");<br> # route to Asterisk Media Server<br>
rewritehostport("<a href="http://192.168.1.11:5060">192.168.1.11:5060</a>");<br> resetflag(2);<br> route(1);<br>}<br><br><br>Thank you,<br><br><br>Khan<br><br>