<div dir="ltr"><div style>Hello,</div><div style><br></div><div style>I'm trying to limit all subscriber's active call according to setting their simultaneous use setting defined in database.</div><div style>But having problem when one subscriber's INVITE message goes to retransmission. When retranmission occures INVITE messages don't complete with BYE and subscriber simultaneus use amount will hung.</div>
<div style>My example code block is below.<br></div><div style>Does anyone advice me for overcome INVITE retransmissions?</div><div style><br></div><div style>Thanks.</div><div style><br></div><div style><br></div><div style>
<div>modparam("dialog", "db_url", "mysql://openser:openserrw@localhost/openser")</div><div>modparam("dialog", "dlg_flag", 4)</div><div>modparam("dialog", "db_mode", 1)</div>
<div>modparam("dialog","profiles_with_value","callquota")</div><div>modparam("dialog", "default_timeout", 3600)</div><div>modparam("dialog", "dlg_match_mode",0)</div>
<div>modparam("dialog", "detect_spirals", 1)</div><div><br></div><div><br></div><div>route[QUOTA] {</div><div><br></div><div><span class="" style="white-space:pre">        </span>if (is_method("INVITE") && $fU == $avp(s:username)) {</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>avp_db_query("select quota from subscriber where username='$avp(s:username)'", "$avp(s:quota)");</div><div><span class="" style="white-space:pre">        </span></div>
<div> $var(SIZE) = 0;</div><div> get_profile_size("callquota", "$avp(s:username)", "$var(SIZE)");</div><div><span class="" style="white-space:pre">                </span>xlog("L_INFO", "CALL_OPENSER:Call originated from = $fd\n");</div>
<div><span class="" style="white-space:pre">                </span>xlog("L_INFO", "Active call amount for $fU is $var(SIZE) , quota=$avp(s:quota)\n");</div><div> if( $var(SIZE) >= $avp(s:quota) ){</div><div>
sl_send_reply("403", "Simultaneous calls limit reached");</div><div> xlog("L_INFO", "QUOTA:Limit of $var(SIZE) active calls has been reached for user=$avp(s:username), quota=$avp(s:quota)\n");</div>
<div> exit;</div><div> }</div><div> set_dlg_profile("callquota","$avp(s:username)");</div><div> get_profile_size("callquota", "$avp(s:username)", "$var(SIZE)");</div>
<div><span class="" style="white-space:pre">        </span>}</div><div>}</div></div><div><br></div><div><br></div>-- <br><div><div style="font-weight:bold"><b style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><font size="3"><font face="Calibri">Bayram KARAGÖZ</font></font></b></div>
</div>
</div>