<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>