[OpenSIPS-Users] top hiding and BYE problem

Anca Vamanu anca.vamanu at gmail.com
Mon Jul 18 14:39:23 CEST 2011


Hi,

You are looping once the generated Invite to IVR because you are not setting
the destination host and port before you call b2b_init_request. Add the
rewritehostport("10.130.0.136:5060");  lines before calling b2b function,
like this:

  if(is_method("INVITE") && !(src_ip=="10.130.0.140"))
  {
                rewritehostport("10.130.0.136:5060");
                b2b_init_request("top hiding");
                exit;
  };

Regards,
Anca Vamanu

2011/7/18 Ухов Александр Ильич <ukhov at ycc.ru>

>  Hello!
> Please help! I am ready to broke my head  . dont know how to solve this...
>
>
> i have next:          PSTN<-------->OPENSIPS<-------->ASTERISK (IVR)
>                                    (10.107.10.10)  (10.130.0.140)
> (10.130.0.136)
> and all i want to do is top hiding between PSTN and ASTERISK.
>
> 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).
>
> 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 " *481* Call/Transaction Does Not Exist"...
> 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.
> thanks!
>
> ---------------------------------------------
> port=5061
> listen=udp:10.130.0.140:5061
> listen=tcp:10.130.0.140:5061
> #modparam("dialog", "dlg_flag", 13)
> #modparam("dialog", "db_mode", 2)
>
> modparam("b2b_entities", "server_address", "sip:10.130.0.140:5061")
> modparam("tm", "pass_provisional_replies", 1)
>
> modparam("b2b_entities", "script_reply_route", "b2b_reply")
>
> route[b2b_reply]
> {
>         xlog("\n\n\n\n-------");
>         xlog("GOT REPLY FROM $src_ip\n");
>         xlog("($ci)\n");
>         xlog("-------\n\n\n\n");
> }
>
> route
> {
>
> xlog("\n\n\n\n-----------------------------START-----------------------------\n");
>
>         if (!mf_process_maxfwd_header("10")){
>                 sl_send_reply("483","Too Many Hops");
>                 exit;};
>
>         if (msg:len >= 1380 ){
>                 sl_send_reply("513", "Message too big");
>                 exit;};
>
>         if(is_method("BYE")&& (src_ip=="10.130.0.136"))
>         {
>                 route(2);
>         }
>
>         if (!method=="REGISTER")
>         {
>                 xlog("+++++++++Recording route...\n");
>                 record_route();
>         }
>
>         if (loose_route())
>         {
>                 append_hf("P-hint: rr-enforced\r\n");
>                 route(1);
>         };
>
>         #skip Invite messages generated by the server
>         if(is_method("INVITE") && !(src_ip=="10.130.0.140"))
>         {
>                 b2b_init_request("top hiding");
>                 exit;
>         };
>
>         route(1);
> }
>
> route[1]
> {
>               rewritehostport("10.130.0.136:5060");
>         xlog("+++++++++++++ROUTE 1: SENDING TO ASTERISK\n");
>         # send it out now
>         if (!t_relay()){
>                 sl_reply_error();};
>         exit;
> }
>
>
> route[2]
> {
>         xlog("+++++++++++++SENDING TO PSTN\n");
>         rewritehostport("10.107.10.10:5060");
>         # send it out now
>         if (!t_relay()){
>                 sl_reply_error();};
>         exit;
> }
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110718/c0b26d14/attachment-0001.htm>


More information about the Users mailing list