<div dir="ltr">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. <div>
<br></div><div>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.</div><div><br></div><div>
-Brett</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 16, 2014 at 11:21 AM, Schneur Rosenberg <span dir="ltr"><<a href="mailto:rosenberg11219@gmail.com" target="_blank">rosenberg11219@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Bogdan and the OpenSIPS community<div><br></div><div> 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.<div>
<br></div><div>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.</div>
<div><br></div><div>in the log files, I see the value of $avp(group_$fU), but when I check the dialog table the profiles field is empty</div><div><br></div><div><br></div><div><div>modparam("dialog", "profiles_with_value", "caller") </div>
<div>modparam("dialog", "profiles_column", "profiles") #probably not needed because i'm using the default</div></div><div><br></div><div><div> if(cache_fetch("local", "$fU", $avp($fU)))</div>
<div> {</div><div> cache_fetch("local", "group_$fU", $avp(group_$fU));</div><div> xlog("L_INFO", "cache fetch success $avp($fU) $fU $avp(group_$fU) \n");</div>
<div><br></div><div> }</div><div> else</div><div> {</div><div> 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)");</div>
<div> cache_store("local","$fU","$avp($fU)"); #in production set timeout</div><div> cache_store("local","group_$fU","$avp(group_$fU)"); #in production set timeout</div>
<div> xlog("L_INFO", "cache store success $avp($fU) si $si fU $fU $avp(group) \n");</div><div><br></div><div> }</div><div><br></div><div> get_profile_size("caller","$avp(group_$fU)","$var(calls)");</div>
<div> xlog("L_INFO", "Active calls for $avp($fU) is $var(calls) \n");</div></div><div><br></div><div>#bellow is the create dialog code</div><div><br></div><div><div>xlog("L_INFO", "------ Route 5 process call $avp(group_$fU) \n");</div>
</div><div><div>create_dialog("Pp");</div><div>set_dlg_profile("caller","$avp(group_$fU)");</div></div><div><br></div><div><br></div></div></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>