[SR-Users] How to limit number of calls in Kamailio proxy

Austin Einter austin.einter at gmail.com
Sun Oct 30 02:53:10 CET 2011


Hi All
Still I am struggling to find a solution how to control the number of calls.

I have few more doubts regarding this.

1. Do I need to enable mysql , so that these counters such as $DLG_count
will be updated properly. Now  I am getting 0 always irrespective of number
of calls in system.

2. For testing purpose, I wanted to set max calls at any point of time
should not be more than 1.
So I had the check as below

*if($DLG_count > 1) *

I read in some previous posts  where someone was mentioning the check as

*if ( avp_check("$DLG_count", "gt/i:10") )
*
Please let me know which one is correct.


3. How do I debug whats going wrong. Why $DBG_count is not updated.

Thanks in advance.

Regards,
Austin



On Sat, Oct 29, 2011 at 2:40 PM, Austin Einter <austin.einter at gmail.com>wrote:

> Alex
> Initially I did not put dlg_manage(), after reading your post I added the
> dlg_manage(). Now in route section my code in kamailio.config looks as
> below.
>
>
> *        dlg_manage();
>         if (is_method("INVITE"))
>         {
>              if (!has_totag())
>
>              {
>                 if($DLG_count > 1)
>                 {
>                         sl_send_reply("503","RESOURCE UNAVAILABLE");
>                         exit;
>                 }
>                 else
>                 {
>                         setflag(FLD_DLG);
>
>                         xlog("Dialog count = $DLG_count\n");
>                 }
>              }
> *
> The end result still remains same. The DLG_count still shows as 0
> irrespective of number of calls present in system.
>
> Can somebody points whats wrong I am doing here.
>
> Regards,
> Austin
>
>
>
>
>
> On Sat, Oct 29, 2011 at 8:58 AM, Alex Balashov <abalashov at evaristesys.com>wrote:
>
>> Are you calling dlg_manage() when processing the initial INVITE request?
>>
>> --
>> This message was painstakingly thumbed out on my mobile, so apologies for
>> brevity, errors, and general sloppiness.
>>
>> Alex Balashov - Principal
>> Evariste Systems LLC
>> 260 Peachtree Street NW
>> Suite 2200
>> Atlanta, GA 30303
>> Tel: +1-678-954-0670
>> Fax: +1-404-961-1892
>> Web: http://www.evaristesys.com/
>>
>> On Oct 28, 2011, at 8:57 PM, Austin Einter <austin.einter at gmail.com>
>> wrote:
>>
>> > This is continuation with limiting number of calls per Kamailio proxy
>> server.
>> > I modified kamailio.cfg as below.
>> >
>> > 1. loadmodule "dialog.so"
>> > 2. modparam("dialog", "enable_stats", 1)
>> > 3. modparam("dialog", "dlg_flag", 4)
>> > Next, as dialog module I can use either active_dialogs() or $DLG_count
>> to find number of calls present at any given point of time.
>> > However if I use active_dialogs() I get parse error when I run kamailio
>> proxy.
>> > Next I used $DLG_count , but always I am getting value of $DLG_count as
>> 0.
>> >
>> > In route section, I added code as below.
>> >
>> >         if (is_method("INVITE"))
>> >         {
>> >                 if($DLG_count > 1)
>> >                 {
>> >                         sl_send_reply("503","RESOURCE UNAVAILABLE");
>> >                         exit;
>> >                 }
>> >                 else
>> >                 {
>> >                         xlog("Dialog count = $DLG_count\n");
>> >                 }
>> >         }
>> > Everytime a new call starts , it prints $DLG_count as 0.
>> >
>> > Kindly let me know whats going wrong here.
>> >
>> > Regards
>> > Austin
>> >
>> >
>> > _______________________________________________
>> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> > sr-users at lists.sip-router.org
>> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20111030/a70ef145/attachment.htm>


More information about the sr-users mailing list