[SR-Users] limiting concurrent calls with dialog module
Graham Wooden
graham at g-rock.net
Mon Oct 3 04:03:38 CEST 2011
Hi Uri,
I just got done tailoring this exact concept with the dialog module (you may
have just read my posts).
Here is how I am doing it, roughly, for me. I have two places where I am
executing the 3rd section below (for outbound and inbound).
Your mileage will vary.
modparam("auth_db", "load_credentials", "username")
.
.
.
.
avp_db_query("select quota from quota where username='$avp(s:username)'",
"$avp(s:quota)");
.
.
.
.
$var(SIZE) = 0;
get_profile_size("callquota", "$avp(s:username)", "$var(SIZE)");
if( $var(SIZE) >= $avp(s:quota) ){
sl_send_reply("503", "Simultaneous calls limit reached");
xlog("DEBUG: Limit of $var(SIZE) active calls has been
reached for $avp(s:username)\n");
exit;
}
set_dlg_profile("callquota","$avp(s:username)");
get_profile_size("callquota", "$avp(s:username)", "$var(SIZE)");
xlog("DEBUG: there are now $var(SIZE) active calls for
$avp(s:username)\n");
On 10/2/11 12:00 PM, "Uri Shacked" <ushacked at gmail.com> wrote:
> Hi,
>
> I am trying to create concurrent calls limitations.
> two questions:
>
> 1. should i use dialog module? or is there a better module?
> 2. i was trying to work with the dialog module, but didnt understand how and
> where to configure the commands and which to use.... any examples or ideas?
>
> BR,
> Uri
>
>
> _______________________________________________
> 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/20111002/2e06d332/attachment-0001.htm>
More information about the sr-users
mailing list