[OpenSIPS-Users] Dialog Concurrency Control Issue.
Bogdan-Andrei Iancu
bogdan at opensips.org
Wed Apr 6 17:15:16 CEST 2011
Hi Logan,
what are the printed xlogs from your script ? interesting is to see the
values for $avp(s:cnt) and $avp(s:sim_calls) .
Regards,
Bogdan
On 03/15/2011 04:15 PM, logan wrote:
>
> 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
> <mailto:32d75fda0adefcc6454938161fa8f488 at 69.25.128.234>
>
> from_uri:: sip:+16465222041 at 192.168.1.234
> <mailto:sip%3A%2B16465222041 at 69.25.128.234>
>
> to_uri:: sip:+18642227540 at 10.1.0.141
> <mailto:sip%3A%2B19194397540 at 72.15.219.141>
>
> caller_tag:: as303e8090
>
> caller_contact:: sip:+16465222041 at 192.168.1.234
> <mailto:sip%3A%2B16465222041 at 69.25.128.234>
>
> callee_cseq:: 102
>
> caller_route_set::
>
> caller_bind_addr:: udp:10.1.0.141:5060 <http://72.15.219.141:5060/>
>
> callee_tag:: as6b251cdf
>
> callee_contact:: sip:8642227540 at 10.1.0.137
> <mailto:sip%3A9194397540 at 72.15.219.137>
>
> caller_cseq:: 102
>
> callee_route_set::
>
> callee_bind_addr:: udp:10.1.0.141:5060 <http://72.15.219.141:5060/>
>
> dialog:: hash=1234:1922532974
>
> state:: 4
>
> user_flags:: 0
>
> timestart:: 1299009708
>
> timeout:: 1786898
>
> callid:: 61e4b8a31839e0c311ed482c6453317a at 192.168.1.234
> <mailto:61e4b8a31839e0c311ed482c6453317a at 69.25.128.234>
>
> from_uri:: sip:+12127858470 at 192.168.1.234
> <mailto:sip%3A%2B12127858470 at 69.25.128.234>
>
> to_uri:: sip:+18642227540 at 10.1.0.141
> <mailto:sip%3A%2B19194397540 at 7215.219.141>
>
> caller_tag:: as7c87f91d
>
> caller_contact:: sip:+12127858470 at 192.168.1.234
> <mailto:sip%3A%2B12127858470 at 69.25.128.234>
>
> callee_cseq:: 102
>
> caller_route_set::
>
> caller_bind_addr:: udp:10.1.0.141:5060 <http://72.15.219.141:5060/>
>
> callee_tag:: as7bd2b3e8
>
> callee_contact:: sip:8642227540 at 10.1.0.137
> <mailto:sip%3A9194397540 at 72.15.219.137>
>
> caller_cseq:: 102
>
> callee_route_set::
>
> callee_bind_addr:: udp:10.1.0.141:5060 <http://72.15.219.141:5060/>
>
>
--
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110406/aa5e9e5a/attachment.htm>
More information about the Users
mailing list