[OpenSIPS-Users] Dialog Concurrency Control Issue.
logan
voipmaster at me.com
Tue Mar 15 15:15:30 CET 2011
I have a uuid in the usr_preferences table set to attribute = sim_calls with value = 15 calls allowed but am getting the concurrency limit error when 2 calls are up and trying to establish the 3rd call. Can anyone help figure out why?
Config Snips:
modparam("avpops", "avp_table", "usr_preferences")
modparam("avpops", "use_domain", 0)
modparam("avpops", "uuid_column", "uuid")
modparam("avpops", "username_column", "username")
modparam("avpops", "domain_column", "domain")
modparam("avpops", "attribute_column", "attribute")
modparam("avpops", "value_column", "value")
modparam("avpops", "type_column", "type")
loadmodule "dialog.so"
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "db_mode", 1)
# TODO: rename profile "caller" to something more deliberate
modparam("dialog", "profiles_with_value", "caller;carrierin;carrierout")
# fetch group the user belongs to
avp_db_query("select grp from grp where username='$avp(s:username)'", "$avp(s:group)");
if(avp_check("$avp(s:group)","re/.*/g")) {
xlog("L_INFO", "----- user $avp(s:username) belongs to $avp(s:group) group\n");
# find out how many calls are allowed, match username to uuid column
if(avp_db_load("$avp(s:group)/uuid","$avp(s:sim_calls)")) {
xlog("L_INFO", "----- group $avp(s:group) can have max $avp(s:sim_calls) calls\n");
# check active calls
get_profile_size("caller","$avp(s:group)","$avp(s:cnt)");
xlog("L_INFO", "----- currently the group $avp(s:group) has $avp(s:cnt) active outgoing calls\n");
# reject if there is more than $sim_calls active calls from this user
if($avp(s:cnt) >= $avp(s:sim_calls)) {
sl_send_reply("486","Concurrency Limit Exceeded");
exit;
} else {
# store dialog on the profile
set_dlg_profile("caller","$avp(s:group)");
}
} else {
xlog("L_INFO", "----- group $avp(s:group) doesn't have sim_calls limit\n");
}
} else {
xlog("L_INFO", "----- user $avp(s:username) doesn't belong to any groups\n");
};
root at sip01:~# opensipsctl fifo profile_get_values caller
value:: 80 count=2
root at sip01:~# opensipsctl fifo profile_get_values carrierin
value:: 192.168.1.234 count=2
profile_list_dlgs:
opensipsctl fifo profile_list_dlgs caller
dialog:: hash=57:1237628390
state:: 4
user_flags:: 0
timestart:: 1299009653
timeout:: 1786844
callid:: 32d75fda0adefcc6454938161fa8f488 at 192.168.1.234
from_uri:: sip:+16465222041 at 192.168.1.234
to_uri:: sip:+18642227540 at 10.1.0.141
caller_tag:: as303e8090
caller_contact:: sip:+16465222041 at 192.168.1.234
callee_cseq:: 102
caller_route_set::
caller_bind_addr:: udp:10.1.0.141:5060
callee_tag:: as6b251cdf
callee_contact:: sip:8642227540 at 10.1.0.137
caller_cseq:: 102
callee_route_set::
callee_bind_addr:: udp:10.1.0.141:5060
dialog:: hash=1234:1922532974
state:: 4
user_flags:: 0
timestart:: 1299009708
timeout:: 1786898
callid:: 61e4b8a31839e0c311ed482c6453317a at 192.168.1.234
from_uri:: sip:+12127858470 at 192.168.1.234
to_uri:: sip:+18642227540 at 10.1.0.141
caller_tag:: as7c87f91d
caller_contact:: sip:+12127858470 at 192.168.1.234
callee_cseq:: 102
caller_route_set::
caller_bind_addr:: udp:10.1.0.141:5060
callee_tag:: as7bd2b3e8
callee_contact:: sip:8642227540 at 10.1.0.137
caller_cseq:: 102
callee_route_set::
callee_bind_addr:: udp:10.1.0.141:5060
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110315/03035c70/attachment-0001.htm>
More information about the Users
mailing list