Hi all,<br><br>I am a beginner in openser and I really appreciate the help I have been getting from this group. I am setting up an interop with a PSTN gateway with intermittent success. I will try to explain my setup below.
<br><br> <br><br> redirect server<br> / /<br> 2 / / 3<br> 1 / / 4 5<br>
asterisk -----> openser (v1.2.1) -----> pstnGateway ------> PSTN (cell phone)<br><br><br>Calls are generated from asterisk (step 1) with a 3-digit prefix (say, 999) on the ANI to identify a particular group of calls, and sent to openser (
v1.2.1). Openser checks the from_uri; detects the 999 prefix, strips the leading 3 digits and forwards the INVITE to the redirect server (step 2). The redirect server responds with a 301, containing the location of the pstnGateway (step 3). Openser sends an INVITE to address in the 301 to the pstnGateway (step 4) and the call gets completed (step 5)
<br><br>This setup works intermittently. I sometimes have to restart openser before it works again. When it works, I get a 100 trying message back from the PSTN gateway, but when it fails, I see a number of invites sent from openser to the gateway without getting a 100 trying message back. And the invite times out with a 408 message. After a few seconds, the PSTN number actually rings, but I get dead air.
<br><br>My configuration is as below:<br><br>**********************************************************<br>loadmodule "uac_redirect.so"<br>loadmodule "uac.so"<br><br># ----------------- setting module-specific parameters ---------------
<br><br># -- mi_fifo params --<br>modparam("mi_fifo", "fifo_name", "/etc/openser_fifo")<br>modparam("rr", "enable_full_lr", 1)<br>modparam("tm", "wt_timer", 30)
<br>modparam("tm", "fr_inv_timer", 120)<br>modparam("tm", "fr_timer", 2)<br>modparam("dispatcher", "list_file", "/etc/openser/dispatcher.list")<br>modparam("dispatcher", "flags", 2)
<br>modparam("dispatcher", "dst_avp", "$avp(i:271)")<br>modparam("dispatcher", "grp_avp", "$avp(i:272)")<br>modparam("dispatcher", "cnt_avp", "$avp(i:273)")
<br>modparam("uac","from_restore_mode","auto")<br><br># main routing logic<br>route {<br> if (!mf_process_maxfwd_header("16"))<br> {<br> xlog("L_INFO", " Reply: 483 - Too Many Hops\n");
<br> sl_send_reply("483","Too Many Hops");<br> exit;<br> };<br> if ( msg:len > max_len )<br> {<br> xlog("L_INFO", " Reply: 513 - Message Too Big\n");
<br> sl_send_reply("513", "Message too big");<br> exit;<br> };<br><br> if (loose_route())<br> {<br> record_route();<br> t_relay();<br> exit;<br> };<br><br>
record_route(); <br><br># Outgoing route route(1);<br> route(1);<br> <br>}<br><br><br># ROUTE 1 - OUTGOING CALLS<br>route[1] {<br> # Check prefix - if the ANI of the tenant starts with 999<br> # and the total number of digits is more than 12
<br> if ((from_uri=~"^sip:999.*")&&$(fu{s.len}) > 12)<br> {<br> # replace both display and uri<br> # Strip out the leading 999 digits before sending it to redirect server
<br> uac_replace_from("$(fU{s.substr,3,0})","sip:$(fU{s.substr,3,0})@$fd");<br><br> # Check for re-directs<br> t_on_failure("4");<br> xlog("L_INFO", "RequestUri:[$ru] FromUri:[$fu] forwarding to redirect server...\n");
<br> ds_select_dst("6", "0"); # forward to redirect server<br> t_relay();<br> exit;<br> }<br> }<br>}<br><br><br>###############################################################################
<br># Process Replies <br>###############################################################################<br>onreply_route[1]<br>{<br> if( status =~ "18[0-9]" )<br> {<br> # Reset the flag<br> t_on_failure("0");
<br> }<br>}<br><br>#=============================================<br># Default redirect handler - PSTN gateway inter-op<br>#=============================================<br>failure_route[4]<br>{<br> get_redirects("*");
<br> t_relay();<br>}<br><br>*********************************************************************************************<br><br>Below is a snippet of my logs when the call fails.<br><br>-----Call 1<br>Aug 28 19:53:27 [12103]: [INVITE] [from: asterisk] [calling: 15552121212] [caller: 99915553131313]
<br>Aug 28 19:53:27 [12103]: RequestUri:[sip:15552121212@openser] FromUri:[sip:99915553131313@asterisk] forwarding to redirect server...<br>Aug 28 19:53:35 [12103]: [ACK] [from: asterisk] [calling: 15552121212] [caller: 99915553131313]
<br>Aug 28 19:53:35 [12103]: ERROR:uac:replace_from: decline FROM replacing in sequential request in auto mode (has TO tag)<br>Aug 28 19:53:35 [12103]: RequestUri:[sip:15552121212@openser] FromUri:[sip:99915553131313@asterisk
] forwarding to redirect server...<br>Aug 28 19:53:41 [12107]: [BYE] [from: redirectServer] [calling: 99915553131313] [caller: 15552121212]<br><br>-----Call 2<br>Aug 28 19:53:53 [12105]: [INVITE] [from: asterisk] [calling: 15552121212] [caller: 99915553131313]
<br>Aug 28 19:53:53 [12105]: RequestUri:[sip:15552121212@openser] FromUri:[sip:99915553131313@asterisk] forwarding to redirect server...<br>Aug 28 19:53:56 [12105]: ERROR:tm:w_t_relay: t_forward_nonack failed<br><br><br>
Thanks and many regards,<br><br>Tolu<br>