BYE and dialog delete (load balance, top hiding with looping and sdp fileds change)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

BYE and dialog delete (load balance, top hiding with looping and sdp fileds change)

saneku
Hello!
i have next opensips cnfg:    
          PSTN<-------->OPENSIPS<-------->ASTERISK1 (IVR)
             (10.107.10.10)  (10.130.0.140)       (10.130.0.136)
                                    <-------->ASTERISK2 (IVR)
                                            (10.130.0.137)
                                 
So it uses top hiding with looping, load balancing and SDP fields change as it uses different VLANS for signalling and for rtp.
So I have decided to put my working cnfg file here.
Hope someone will find it usefull.

But there is still one thing to do. And I dont know which...
When the called party hangs up, dialog not being deleted (i can see it in dialog table) so it causes LB module to
reject incomming calls after all available resourses becomes occupated.  

BUT! when the calling party drops the call everything goes just perfect (dialog being deleted). so there are
no rejected incoming calls.

All sip-exchange is going fine in both cases.
Hopping for your help.


config file:
----------------
...
port=5061
listen=udp:10.130.0.140:5061
listen=tcp:10.130.0.140:5061

mpath="//lib/opensips/modules/"

loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
loadmodule "acc.so"
loadmodule "load_balancer.so"
loadmodule "dialog.so"
loadmodule "nathelper.so"

loadmodule "b2b_entities.so"
loadmodule "b2b_logic.so"

modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

modparam("dialog", "dlg_flag", 13)
modparam("dialog", "db_mode", 1)


modparam("load_balancer|dialog|b2b_entities|b2b_logic", "db_url", "mysql://xxxxxxxxxxxxxxxx")
modparam("b2b_entities", "server_address", "sip:10.130.0.140:5061")
modparam("tm", "pass_provisional_replies", 1)

modparam("load_balancer", "probing_from", "sip:sip@10.130.0.140")
modparam("load_balancer", "probing_interval", 30)

route
{
        if (!method=="REGISTER")
        {
                xlog("+++++++++Recording route...\n");
                record_route();
        }
               
        if (loose_route())
        {
                xlog("+++++++++Append rr-enforced...\n");
                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"))
        {
                xlog("++++++++++Doing top hiding\n");
                b2b_init_request("top hiding");
                exit;
        };
        route(1);
}

route[1]
{
        xlog("++++++++++In route 1\n");
        if(is_method("INVITE") && (src_ip=="10.130.0.140"))
        {
                load_balance("1","pstn");
                if ($retcode<0)
                {
                         sl_send_reply("501","PROXY: all channels are busy!");
                         exit;
                }
                xlog("+++++++++Selected dst: $du\n");
        }
        #-----------------------
       
        t_on_failure("1");
        t_on_reply("1");
       
        if (!t_relay())
        {
                sl_reply_error();
        };
        exit;
}

onreply_route[1]
{
        if(t_check_status("(200)|(183)"))
        {
                if(has_body("application/sdp"))
                {
                        if(search("IN IP4 10.130.0.136"))
                        {
                                fix_nated_sdp("2","10.130.0.88");
                                fix_nated_sdp("8","10.130.0.88");
                        }

                        if(search("IN IP4 10.130.0.137"))
                        {
                                fix_nated_sdp("2","10.130.0.87");
                                fix_nated_sdp("8","10.130.0.87");
                        }
                }
        }
}

failure_route[1]
{
    if (t_check_status("(408)|(5[0-9][0-9])"))
    {
                lb_disable();
                if (load_balance("1","pstn"))
                {
                        t_on_failure("1");
                        t_on_reply("1");
               
                        xlog("PROXY: New destination is $du\n");
                        t_relay();
                }
                else
                {
                        t_reply("501", "PROXY: Service unavailable");
                }
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: BYE and dialog delete (load balance, top hiding with looping and sdp fileds change)

saneku
Hey!
Does anybody know how to solve this issue.
thanks
Reply | Threaded
Open this post in threaded view
|

Re: BYE and dialog delete (load balance, top hiding with looping and sdp fileds change)

Vlad Paiu
Hello,

 From your script, I see that you are trying to use B2B alongside with
the Dialog module. Due to OpenSIPS internals, this will not work.

So you have two options :
1) Drop the B2B and use the topology hiding integrated directly into the
Dialog module [1] , which is present in OpenSIPS 1.7 ( update may be
needed if you running older versions )
2) Split the functionality on two separate servers, one handling the B2B
topology hiding and another server handling the load balancing.

[1] http://www.opensips.org/html/docs/modules/1.7.x/dialog.html#id294709


Regards,
--

Vlad Paiu
OpenSIPS Developer


On 08/09/2011 01:12 PM, saneku wrote:

> Hey!
> Does anybody know how to solve this issue.
> thanks
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/BYE-and-dialog-delete-load-balance-top-hiding-with-looping-and-sdp-fileds-change-tp6639898p6667578.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users