<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> . dont know how to solve this... </SPAN><BR><BR><SPAN>i have next: PSTN<-------->OPENSIPS<-------->ASTERISK (IVR) </SPAN><BR><SPAN> (10.107.10.10) (10.130.0.140) (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> xlog("\n\n\n\n-------"); </SPAN><BR><SPAN> xlog("GOT REPLY FROM $src_ip\n"); </SPAN><BR><SPAN> xlog("($ci)\n"); </SPAN><BR><SPAN> xlog("-------\n\n\n\n"); </SPAN><BR><SPAN>} </SPAN><BR><BR><SPAN>route </SPAN><BR><SPAN>{ </SPAN><BR><SPAN> xlog("\n\n\n\n-----------------------------START-----------------------------\n"); </SPAN><BR><SPAN> if (!mf_process_maxfwd_header("10")){ </SPAN><BR><SPAN> sl_send_reply("483","Too Many Hops"); </SPAN><BR><SPAN> exit;}; </SPAN><BR><BR><SPAN> if (msg:len >= 1380 ){ </SPAN><BR><SPAN> sl_send_reply("513", "Message too big"); </SPAN><BR><SPAN> exit;}; </SPAN><BR><SPAN> </SPAN><BR><SPAN> if(is_method("BYE")&& (src_ip=="10.130.0.136")) </SPAN><BR><SPAN> { </SPAN><BR><SPAN> route(2); </SPAN><BR><SPAN> } </SPAN><BR><SPAN> </SPAN><BR><SPAN> if (!method=="REGISTER") </SPAN><BR><SPAN> { </SPAN><BR><SPAN> xlog("+++++++++Recording route...\n"); </SPAN><BR><SPAN> record_route(); </SPAN><BR><SPAN> } </SPAN><BR><SPAN> </SPAN><BR><SPAN> if (loose_route()) </SPAN><BR><SPAN> { </SPAN><BR><SPAN> append_hf("P-hint: rr-enforced\r\n"); </SPAN><BR><SPAN> route(1); </SPAN><BR><SPAN> }; </SPAN><BR><SPAN> </SPAN><BR><SPAN> #skip Invite messages generated by the server </SPAN><BR><SPAN> if(is_method("INVITE") && !(src_ip=="10.130.0.140")) </SPAN><BR><SPAN> { </SPAN><BR><SPAN> b2b_init_request("top hiding"); </SPAN><BR><SPAN> exit; </SPAN><BR><SPAN> }; </SPAN><BR><BR><SPAN> route(1); </SPAN><BR><SPAN>} </SPAN><BR><BR><SPAN>route[1] </SPAN><BR><SPAN>{ </SPAN><BR><SPAN> rewritehostport("10.130.0.136:5060"); </SPAN><BR><SPAN> xlog("+++++++++++++ROUTE 1: SENDING TO ASTERISK\n"); </SPAN><BR><SPAN> # send it out now </SPAN><BR><SPAN> if (!t_relay()){ </SPAN><BR><SPAN> sl_reply_error();}; </SPAN><BR><SPAN> exit; </SPAN><BR><SPAN>} </SPAN><BR><BR><BR><SPAN>route[2] </SPAN><BR><SPAN>{ </SPAN><BR><SPAN> xlog("+++++++++++++SENDING TO PSTN\n"); </SPAN><BR><SPAN> rewritehostport("10.107.10.10:5060"); </SPAN><BR><SPAN> # send it out now </SPAN><BR><SPAN> if (!t_relay()){ </SPAN><BR><SPAN> sl_reply_error();}; </SPAN><BR><SPAN> exit; </SPAN><BR><SPAN>} </SPAN></P></BODY></HTML>