Do you see the active calls number going up? Are you sure your calls are hitting the block performing the set_dlg_profile. I'd put an xlog right before the set_dlg_profile just to be sure. Depending on the db_mode you might not actually see this value change in the DB. Either way, the important thing is if the profile is being set on the dialog or not.
Additionally, I'm not sure where you have your get_profile_size being called, but I think if it's before the loose_route bits, you might not be associated with the dialog yet. -Brett On Wed, Jul 16, 2014 at 11:21 AM, Schneur Rosenberg < rosenberg11...@gmail.com> wrote: > 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 > >
_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users