Hi Bogdan and the OpenSIPS community

 I'm trying to limit concurrent calls on a group of sip devices, I got
stuck setting the profile in the dialog, its just not being set in the db.

I created to new tables, one that I store all the sip devices and to which
group they belong to, the second table has the groups, and whats the limit,
and I'm using memcache to avoid bottlenecks I'm attaching the relevant code.

in the log files, I see the value of $avp(group_$fU), but when I check the
dialog table the profiles field is empty


modparam("dialog", "profiles_with_value", "caller")
modparam("dialog", "profiles_column", "profiles")  #probably not needed
because i'm using the default

                if(cache_fetch("local", "$fU", $avp($fU)))
                {
                        cache_fetch("local", "group_$fU", $avp(group_$fU));
                        xlog("L_INFO", "cache fetch success $avp($fU)  $fU
 $avp(group_$fU) \n");

                }
                else
                {
                        avp_db_query("select  limits.conLimit,
users.conGroup  from concurrentGroupsLimits as limits, concurrentGroups as
users where users.sipDevice = '$fU' and
users.conGroup=limits.conGroup","$avp($fU);$avp(group_$fU)");
                        cache_store("local","$fU","$avp($fU)");  #in
production set timeout
                        cache_store("local","group_$fU","$avp(group_$fU)");
#in production set timeout
                        xlog("L_INFO", "cache store success $avp($fU) si
$si fU $fU $avp(group) \n");

                }

               get_profile_size("caller","$avp(group_$fU)","$var(calls)");
                xlog("L_INFO", "Active calls for  $avp($fU) is $var(calls)
\n");

#bellow is the create dialog code

xlog("L_INFO", "------ Route 5 process call $avp(group_$fU)  \n");
create_dialog("Pp");
set_dlg_profile("caller","$avp(group_$fU)");
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to