Hello Daniel,

 

I’ve enabled the cfgtrace. Now all I have to do is wait till it happens again, as the problem does not occur often.

 

For now I’m getting the following:

2012-11-20T09:56:15+01:00 kamailio /usr/local/sbin/kamailio[16350]: ERROR: *** cfgtrace: c=[/etc/kamailio/kamailio.cfg] l=302 a=25 n=dlg_manage

 

Debug is currently set to 2: debug=2

Should I set this to 4?

 

Grant

 

From: Daniel-Constantin Mierla [mailto:miconda@gmail.com]
Sent: maandag 19 november 2012 9:59
To: Grant Bagdasarian
Cc: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Subject: Re: [SR-Users] Dialog module not decrementing profile size

 

Hello,

On 11/16/12 8:54 AM, Grant Bagdasarian wrote:

Hello Daniel,

 

Yes, dlg_manage() is being called in the BYE, yet it sometimes still occurs that dialogs aren’t being cleared.

It is critical for us the dialogs are being cleared as we have an application which heavily relies on this.

Do you get any error messages in syslog?

Can you add an xlog(...) message (or load the debugger module and enable cfgtrace parameter), then look at the log messages to be sure dlg_manage() is executed for BYE requests?

Cheers,
Daniel

 

Kind regards,

 

Grant Bagdasarian

 

From: Daniel-Constantin Mierla [mailto:miconda@gmail.com]
Sent: donderdag 8 november 2012 8:03
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Cc: Grant Bagdasarian
Subject: Re: [SR-Users] Dialog module not decrementing profile size

 

Hello,

On 10/30/12 10:51 AM, Grant Bagdasarian wrote:

Hello Community,

 

I’ve recently started to use the Dialog module to manage the amount of incoming calls from our SIP provider allowed to pass through by using profiles_with_values and setting the size of these profiles to a certain amount.

Most of the time this works as it should, but sometimes the ‘slots’ available for a profile aren’t cleared even though a dialog has finished. This seems to happen when an high amount of regular traffic is hitting kamailio.

 

Has anyone else experienced this? Are there perhaps any other ways to control the slots available for certain incoming SIP traffic?

 

Below parts of my configuration file. Perhaps I’m doing something wrong which causes this to happen.

In my route[WITHINDLG] -> loose_route -> is_method(“BYE”) I’m not calling dlg_manage(), could this be the problem?

is the dlg_manage() executed or not for BYE? You say no above, but the example has it. Because you have dlg_match_mode=2, you must call dlg_manage() for BYE explicitly.

Cheers,
Daniel


 

Other comments are welcome too, as I’m fairly new to Kamailio.

 

modparam("dialog", "enable_stats", 1)

modparam("dialog", "dlg_flag", 4)

modparam("dialog", "hash_size", 4096)

modparam("dialog", "profiles_with_value", "318005004");

modparam("dialog", "default_timeout", 43200)

modparam("dialog", "dlg_match_mode",2)

modparam("dialog", "detect_spirals", 1)

 

request_route {

 

        # per request initial checks

        route(REQINIT);

 

        # handle requests within SIP dialogs

        route(WITHINDLG);

 

        ### only initial requests (no To tag)

 

        # CANCEL processing

        if (is_method("CANCEL"))

        {

                if (t_check_trans())

                        t_relay();

                exit;

        }

 

        t_check_trans();

 

        # record routing for dialog forming requests (in case they are routed)

        # - remove preloaded route headers

        remove_hf("Route");

 

       if (is_method("INVITE")) {

              xlog("L_INFO", "Incoming request for $rU from $fU");

              if ($rU == "318005004") {

                     route(DIALOG);

              }

        }

 

        # handle registrations

        route(REGISTRAR);

 

        if ($rU==$null)

        {

                # request with no Username in RURI

                sl_send_reply("484","Address Incomplete");

                exit;

        }

 

        # dispatch destinations

        route(DISPATCH);

 

        route(RELAY);

}

 

route[DIALOG] {

       dlg_manage();

       record_route();

       $var(SIZE) = 0;

 

       sql_query("vf", "exec dbo.SelectAvailableSlots '00$rU'", "ra");

       $avp(s:limit) = $dbr(ra=>[0,7]);

       xlog("L_INFO", "Maximum simultaneous calls is configured at $avp(s:limit) ....");

       sql_result_free("ra");

      

       if ($rU == "318005004") {

              get_profile_size("318005004", "$rU", "$var(SIZE)");

       }

 

 

       xlog("L_INFO", "There are currently $var(SIZE) calls for $rU, excluding the current call");

       if($var(SIZE) >= $avp(s:limit)) {

              xlog("L_INFO", "Simultaneous calls limit of $avp(s:limit) reached for $rU: $var(SIZE)\n");

              sl_send_reply("603", "Simultaneous calls limit reached");

              exit;

       }

 

       if ($rU == "318005004") {

              set_dlg_profile("318005004", "$rU");

       }

 

 

       if ($rU == "318005004") {

              if(get_profile_size("318005004", "$var(SIZE)")) {

                     xlog("L_INFO", "There are currently $var(SIZE) calls for $rU, including the current call");

              }

       }

}

 

route[WITHINDLG] {

        if (has_totag()) {

                # sequential request withing a dialog should

                # take the path determined by record-routing

                if (loose_route()) {

                     #Used for call transfer

                     if($fU == "318005004") {

                        if (is_method("UPDATE")) {

                            sl_send_reply("405","Method not allowed");

                            xlog("L_INFO", "Dropping UPDATE message...\n");

                            exit;

                        }

                        if (is_method("INVITE")) {

                            record_route();

                        }

                        if (is_method("BYE")) {

                            dlg_manage();

                        }

                     }

                        if (is_method("BYE")) {

                                setflag(1); # do accounting ...

                                setflag(3); # ... even if the transaction fails

                        }

                        route(RELAY);

                } else {

                        if (is_method("SUBSCRIBE") && uri == myself) {

                                # in-dialog subscribe requests

                                route(PRESENCE);

                                exit;

                        }

                        if ( is_method("ACK") ) {

                                if ( t_check_trans() ) {

                                        # non loose-route, but stateful ACK;

                                        # must be ACK after a 487 or e.g. 404 from upstream server

                                        t_relay();

                                        exit;

                                } else {

                                        # ACK without matching transaction ... ignore and discard.

                                        exit;

                                }

                        }

                        sl_send_reply("404","Not here");

                }

                exit;

        }

}

 

 

Regards,

 

Grant

 





_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - http://asipto.com/u/katu



-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda