<div dir="ltr"><div style>Hello,</div><div style><br></div><div style>I&#39;m trying to limit all subscriber&#39;s active call according to setting their simultaneous use setting defined in database.</div><div style>But having problem when one subscriber&#39;s INVITE message goes to retransmission. When retranmission occures INVITE messages don&#39;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(&quot;dialog&quot;, &quot;db_url&quot;, &quot;mysql://openser:openserrw@localhost/openser&quot;)</div><div>modparam(&quot;dialog&quot;, &quot;dlg_flag&quot;, 4)</div><div>modparam(&quot;dialog&quot;, &quot;db_mode&quot;, 1)</div>
<div>modparam(&quot;dialog&quot;,&quot;profiles_with_value&quot;,&quot;callquota&quot;)</div><div>modparam(&quot;dialog&quot;, &quot;default_timeout&quot;, 3600)</div><div>modparam(&quot;dialog&quot;, &quot;dlg_match_mode&quot;,0)</div>
<div>modparam(&quot;dialog&quot;, &quot;detect_spirals&quot;, 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(&quot;INVITE&quot;) &amp;&amp; $fU == $avp(s:username)) {</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>avp_db_query(&quot;select quota from subscriber where username=&#39;$avp(s:username)&#39;&quot;, &quot;$avp(s:quota)&quot;);</div><div><span class="" style="white-space:pre">        </span></div>
<div>        $var(SIZE) = 0;</div><div>        get_profile_size(&quot;callquota&quot;, &quot;$avp(s:username)&quot;, &quot;$var(SIZE)&quot;);</div><div><span class="" style="white-space:pre">                </span>xlog(&quot;L_INFO&quot;, &quot;CALL_OPENSER:Call originated from = $fd\n&quot;);</div>
<div><span class="" style="white-space:pre">                </span>xlog(&quot;L_INFO&quot;, &quot;Active call amount for $fU is $var(SIZE) , quota=$avp(s:quota)\n&quot;);</div><div>        if( $var(SIZE) &gt;= $avp(s:quota) ){</div><div>
               sl_send_reply(&quot;403&quot;, &quot;Simultaneous calls limit reached&quot;);</div><div>               xlog(&quot;L_INFO&quot;, &quot;QUOTA:Limit of $var(SIZE) active calls has been reached for user=$avp(s:username), quota=$avp(s:quota)\n&quot;);</div>
<div>               exit;</div><div>        }</div><div>        set_dlg_profile(&quot;callquota&quot;,&quot;$avp(s:username)&quot;);</div><div>        get_profile_size(&quot;callquota&quot;, &quot;$avp(s:username)&quot;, &quot;$var(SIZE)&quot;);</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>