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

Austin Einter austin.einter at gmail.com
Sat Oct 29 04:57:53 CEST 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20111029/d3d2f753/attachment.htm>


More information about the sr-users mailing list