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@gmail.com wrote:
Hi, I am trying to create concurrent calls limitations. two questions:
- should i use dialog module? or is there a better module?
- 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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users