<HTML><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16421"></HEAD>
<BODY>
<P><SPAN>Hello! </SPAN><BR><SPAN>Please help! I am ready to broke my head </SPAN><IMG class=smiley src="http://n2.nabble.com/images/smiley/anim_crazy.gif"><SPAN>&nbsp;. dont know how to solve this... </SPAN><BR><BR><SPAN>i have next: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PSTN&lt;--------&gt;OPENSIPS&lt;--------&gt;ASTERISK (IVR) </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(10.107.10.10) &nbsp;(10.130.0.140) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (10.130.0.136) </SPAN><BR><SPAN>and all i want to do is top hiding between PSTN and ASTERISK. </SPAN><BR><BR><SPAN>So I adjusted opensips.cfg so i can hear asterisk ivr. When the caller hangs up the call everything goes as it should be (PSTN send BYE, BYE precessed by opensips and sended to asterisk. asterisk returns 200, opensips sends 200 to PSTN and call drops). </SPAN><BR><BR><SPAN>But when asterisk hangs up the call it sends BYE to OPENSIPS. On the next step opensips trying to process it and send BYE to PSTN. After that PSTN gives " <B class=highlight>481</B> Call/Transaction Does Not Exist"... </SPAN><BR><SPAN>I think I understand why it response such way. Because there are two different calls with different call-id's. So please tell me what i have to do in such situation? Do I have to keep two different call-id's and replace one to another when recive BYE from ASTERISK or there is another solution. Any advice will be appresiated. opensips.cfg is attached. </SPAN><BR><SPAN>thanks! </SPAN><BR></P>
<P><SPAN>--------------------------------------------- </SPAN><BR><SPAN>port=5061 </SPAN><BR><SPAN>listen=udp:10.130.0.140:5061 </SPAN><BR><SPAN>listen=tcp:10.130.0.140:5061 </SPAN><BR><SPAN>#modparam("dialog", "dlg_flag", 13) </SPAN><BR><SPAN>#modparam("dialog", "db_mode", 2) </SPAN><BR><BR><SPAN>modparam("b2b_entities", "server_address", "sip:10.130.0.140:5061") </SPAN><BR><SPAN>modparam("tm", "pass_provisional_replies", 1) </SPAN><BR><BR><SPAN>modparam("b2b_entities", "script_reply_route", "b2b_reply") </SPAN><BR><BR><SPAN>route[b2b_reply] </SPAN><BR><SPAN>{ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; xlog("\n\n\n\n-------"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; xlog("GOT REPLY FROM $src_ip\n"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; xlog("($ci)\n"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; xlog("-------\n\n\n\n"); </SPAN><BR><SPAN>} </SPAN><BR><BR><SPAN>route </SPAN><BR><SPAN>{ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; xlog("\n\n\n\n-----------------------------START-----------------------------\n"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if (!mf_process_maxfwd_header("10")){ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_send_reply("483","Too Many Hops"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;}; </SPAN><BR><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if (msg:len &gt;= 1380 ){ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_send_reply("513", "Message too big"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;}; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if(is_method("BYE")&amp;&amp; (src_ip=="10.130.0.136")) </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; { </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; route(2); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; } </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if (!method=="REGISTER") </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; { </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("+++++++++Recording route...\n"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; record_route(); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; } </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if (loose_route()) </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; { </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; append_hf("P-hint: rr-enforced\r\n"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; route(1); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; }; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; #skip Invite messages generated by the server </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if(is_method("INVITE") &amp;&amp; !(src_ip=="10.130.0.140")) </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; { </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b2b_init_request("top hiding"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; }; </SPAN><BR><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; route(1); </SPAN><BR><SPAN>} </SPAN><BR><BR><SPAN>route[1] </SPAN><BR><SPAN>{ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rewritehostport("10.130.0.136:5060"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; xlog("+++++++++++++ROUTE 1: SENDING TO ASTERISK\n"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; # send it out now </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if (!t_relay()){ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_reply_error();}; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; exit; </SPAN><BR><SPAN>} </SPAN><BR><BR><BR><SPAN>route[2] </SPAN><BR><SPAN>{ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; xlog("+++++++++++++SENDING TO PSTN\n"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; rewritehostport("10.107.10.10:5060"); </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; # send it out now </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; if (!t_relay()){ </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sl_reply_error();}; </SPAN><BR><SPAN>&nbsp; &nbsp; &nbsp; &nbsp; exit; </SPAN><BR><SPAN>} </SPAN></P></BODY></HTML>