Dialog Concurrency Control Issue.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Dialog Concurrency Control Issue.

Logan

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@sip01:~# opensipsctl fifo profile_get_values caller

value:: 80 count=2


root@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:: [hidden email]

    from_uri:: [hidden email]

    to_uri:: [hidden email]

    caller_tag:: as303e8090

    caller_contact:: [hidden email]

    callee_cseq:: 102

    caller_route_set:: 

    caller_bind_addr:: udp:10.1.0.141:5060

    callee_tag:: as6b251cdf

    callee_contact:: [hidden email]

    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:: [hidden email]

    from_uri:: [hidden email]

    to_uri:: [hidden email]

    caller_tag:: as7c87f91d

    caller_contact:: [hidden email]

    callee_cseq:: 102

    caller_route_set:: 

    caller_bind_addr:: udp:10.1.0.141:5060

    callee_tag:: as7bd2b3e8

    callee_contact:: [hidden email]

    caller_cseq:: 102

    callee_route_set:: 

    callee_bind_addr:: udp:10.1.0.141:5060


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Dialog Concurrency Control Issue.

Bogdan-Andrei Iancu-2
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@sip01:~# opensipsctl fifo profile_get_values caller

value:: 80 count=2


root@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:: [hidden email]

    from_uri:: [hidden email]

    to_uri:: [hidden email]

    caller_tag:: as303e8090

    caller_contact:: [hidden email]

    callee_cseq:: 102

    caller_route_set:: 

    caller_bind_addr:: udp:10.1.0.141:5060

    callee_tag:: as6b251cdf

    callee_contact:: [hidden email]

    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:: [hidden email]

    from_uri:: [hidden email]

    to_uri:: [hidden email]

    caller_tag:: as7c87f91d

    caller_contact:: [hidden email]

    callee_cseq:: 102

    caller_route_set:: 

    caller_bind_addr:: udp:10.1.0.141:5060

    callee_tag:: as7bd2b3e8

    callee_contact:: [hidden email]

    caller_cseq:: 102

    callee_route_set:: 

    callee_bind_addr:: udp:10.1.0.141:5060



-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Dialog Concurrency Control Issue.

Logan
Hi, thanks for the reply. The issue was that my comparison was being treated as a string instead of an integer so 2 > 15. Once I converted to integers this looked to be resolved:

$avp(s:sim_calls) = $(avp(s:sim_calls){s.int});

$avp(s:cnt) = $(avp(s:cnt){s.int});

 if($avp(s:cnt) >= $avp(s:sim_calls)) {

On Apr 06, 2011, at 11:15 AM, Bogdan-Andrei Iancu <[hidden email]> wrote:

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@sip01:~# opensipsctl fifo profile_get_values caller

value:: 80 count=2


root@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:: [hidden email]

    from_uri:: [hidden email]

    to_uri:: [hidden email]

    caller_tag:: as303e8090

    caller_contact:: [hidden email]

    callee_cseq:: 102

    caller_route_set:: 

    caller_bind_addr:: udp:10.1.0.141:5060

 

    callee_tag:: as6b251cdf

    callee_contact:: [hidden email]

    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:: [hidden email]

    from_uri:: [hidden email]

    to_uri:: [hidden email]

    caller_tag:: as7c87f91d

    caller_contact:: [hidden email]

    callee_cseq:: 102

    caller_route_set:: 

    caller_bind_addr:: udp:10.1.0.141:5060

 

    callee_tag:: as7bd2b3e8

    callee_contact:: [hidden email]

    caller_cseq:: 102

    callee_route_set:: 

    callee_bind_addr:: udp:10.1.0.141:5060

 



-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Dialog Concurrency Control Issue.

jing
In reply to this post by Bogdan-Andrei Iancu-2
hi,Bogdan


 I want to limit the total number of active dialogs ,what should I do ?

I found there are many questions about "Concurrent calls limitation " based on per user, it's not what I need.

I appreciate your advice very much,  more detailed the better.

Thanks,
Regards,
jing
Reply | Threaded
Open this post in threaded view
|

Re: Dialog Concurrency Control Issue.

Schneur Rosenberg

Very simple, before creating a new dialog check how many open dialogs exist.

On Jul 14, 2014 9:05 AM, "jing" <[hidden email]> wrote:
hi,Bogdan


 I want to limit the total number of active dialogs ,what should I do ?

I found there are many questions about "Concurrent calls limitation " based
on per user, it's not what I need.

I appreciate your advice very much,  more detailed the better.

Thanks,
Regards,
jing



--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Dialog-Concurrency-Control-Issue-tp6172931p7592368.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users