Graham,
Good deal. The one improvement I would suggest would be to use sqlops for custom DB
queries as it is more flexible, and is the canonical way to do them now as of >= 1.5.0.
avp_db_query() could go away at some point.
--
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 2, 2011, at 10:03 PM, Graham Wooden <graham(a)g-rock.net> wrote:
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(a)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(a)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(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users