<div dir="ltr">I don't know what exactly happened in your case but if you don't have time to investigate you can try cnxcc module [1] channel control to achieve the same goal.<div><br><div>Take a look at the sample configuration file located in [2]<br>
<div><br></div><div><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(51,51,51);line-height:18px"><div class="" id="LC585" style="padding-left:10px">
<span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">xlog("L_INFO",</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">"Setting</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">up</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">channel</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">based</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">credit</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">control")</span><span class="" style="color:rgb(153,153,136);font-style:italic">;</span></div>
<div class="" id="LC586" style="padding-left:10px"><br></div><div class="" id="LC587" style="padding-left:10px">    <span class="" style="color:rgb(0,128,128)">$var(max_chan)</span>       <span class="" style="font-weight:bold">=</span> <span class="" style="color:rgb(221,17,68)">2;</span></div>
<div class="" id="LC588" style="padding-left:10px"><span class="" style="color:rgb(221,17,68)">   $var(retcode)   = cnxcc_set_max_channels("$var(client)", "$var(max_chan)");</span></div><div class="" id="LC589" style="padding-left:10px">
<br></div><div class="" id="LC590" style="padding-left:10px">   <span class="" style="color:rgb(0,128,128)">if ($var(retcode)</span> <span class="" style="font-weight:bold">=</span><span class="" style="color:rgb(221,17,68)">= -1) {</span></div>
<div class="" id="LC591" style="padding-left:10px"><span class="" style="color:rgb(221,17,68)">           xlog("Error setting up credit control");</span></div><div class="" id="LC592" style="padding-left:10px"><span class="" style="color:rgb(221,17,68)">                return;</span></div>
<div class="" id="LC593" style="padding-left:10px"><span class="" style="color:rgb(221,17,68)">   }</span></div><div class="" id="LC594" style="padding-left:10px"><br></div><div class="" id="LC595" style="padding-left:10px">
        <span class="" style="color:rgb(0,128,128)">$var(count)</span>     <span class="" style="font-weight:bold">=</span> <span class="" style="color:rgb(221,17,68)">-1;</span></div><div class="" id="LC596" style="padding-left:10px">
<br></div><div class="" id="LC597" style="padding-left:10px">        <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">if</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">(!cnxcc_get_channel_count("$var(client)",</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">"$var(count)"))</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">{</span></div>
<div class="" id="LC598" style="padding-left:10px">                <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">xlog("Error</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">getting</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">customer's</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">channel</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">count")</span><span class="" style="color:rgb(153,153,136);font-style:italic">;</span></div>
<div class="" id="LC599" style="padding-left:10px">        <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">}</span></div><div class="" id="LC600" style="padding-left:10px"><br></div><div class="" id="LC601" style="padding-left:10px">
        <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">xlog("L_INFO",</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">"CNXCC</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">ROUTE:</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">$var(client)</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">has</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">$var(count)</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">call(s)")</span><span class="" style="color:rgb(153,153,136);font-style:italic">;</span></div>
<div class="" id="LC602" style="padding-left:10px"><br></div><div class="" id="LC603" style="padding-left:10px">    <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">if</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">($var(retcode)</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)"><</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">-1)</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">{</span></div>
<div class="" id="LC604" style="padding-left:10px">         <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">xlog("Too</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">many</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">channels</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">for</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">customer")</span><span class="" style="color:rgb(153,153,136);font-style:italic">;</span></div>
<div class="" id="LC605" style="padding-left:10px">         <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">sl_send_reply(403,</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">"Forbidden")</span><span class="" style="color:rgb(153,153,136);font-style:italic">;</span></div>
<div class="" id="LC606" style="padding-left:10px"><br></div><div class="" id="LC607" style="padding-left:10px">            <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">if</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">(!cnxcc_terminate_all("$var(client)"))</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">{</span></div>
<div class="" id="LC608" style="padding-left:10px">                 <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">xlog("Error</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">terminating</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">customer's</span> <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">calls")</span><span class="" style="color:rgb(153,153,136);font-style:italic">;</span></div>
<div class="" id="LC609" style="padding-left:10px">         <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">}</span></div><div class="" id="LC610" style="padding-left:10px"><br></div><div class="" id="LC611" style="padding-left:10px">
                <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">exit</span><span class="" style="color:rgb(153,153,136);font-style:italic">;</span></div><div class="" id="LC612" style="padding-left:10px">    <span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)">}</span></div>
<div class="" id="LC612" style="padding-left:10px"><span class="" style="color:rgb(166,23,23);background-color:rgb(227,210,210)"><br></span></div><div class="" id="LC612" style="padding-left:10px"><div style="color:rgb(34,34,34);font-family:arial;font-size:small;line-height:normal;white-space:normal">
[1] <a href="http://kamailio.org/docs/modules/devel/modules/cnxcc.html">http://kamailio.org/docs/modules/devel/modules/cnxcc.html</a></div><div style="color:rgb(34,34,34);font-family:arial;font-size:small;line-height:normal;white-space:normal">
[2] <a href="https://github.com/caruizdiaz/cnxcc/blob/master/example/kamailio-cnxcc.cfg">https://github.com/caruizdiaz/cnxcc/blob/master/example/kamailio-cnxcc.cfg</a></div><div><br></div><div>Regards,</div><div>Carlos</div>
</div></pre></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 23, 2013 at 5:16 AM, Gertjan Wolzak <span dir="ltr"><<a href="mailto:g.wolzak@foize.com" target="_blank">g.wolzak@foize.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="NL" link="blue" vlink="purple"><div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Goodmorning All,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US">I use the following route to check for concurrent calls by the same user, if a concurrent call is tried it is not allowed.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">route[CONCURRENT]<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">{<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US">        xlog("SCRIPT: Conccurrent call check");<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">        if(!get_profile_size("caller","$fu","$avp(nrcalls)"))<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">        {<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">                sl_send_reply("403", "Call not matching profile");<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">                exit;<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        }<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        xlog("SCRIPT: caller value for $fu is $avp(nrcalls)");<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">        if($avp(nrcalls)>= 1)<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        {<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">                sl_send_reply("403", "Active calls limit exceeded");<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">                exit;<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        }<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        dlg_manage();<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">        if(!set_dlg_profile("caller","$fu"))<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">        {<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US">                sl_send_reply("500", "No new channels in this profile");<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">                exit;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">        }<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">        xlog("SCRIPT: caller value for $fu is now $avp(nrcalls)");<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">}<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Now I had a situation where a user could not call because the get_profile_size for this user gave the value 1. So another call was not allowed.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">But the user did not have a call active. As no dialogs were active, checked that.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal">
<span lang="EN-US">I assume there can be a lot of reasons why this happens, also I want to use the “I don’t want to know the cause” method to solve this.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">So I looked at the dialog module documentation, to see if I can just clear the profile size for this specific user.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I wanted to use the profile_list_dlgs(8.6) to get the dialog details, then the dlg_terminate_dlg(8.4) to, you guessed it, terminate that dialog.<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">But it’s not clear to me how I can give those commands….<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there a way to give those commands on the cli, if so can someone please write down some examples…<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Would be really appreciated.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Rgds,<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></span></p>
<span class="HOEnZb"><font color="#888888"><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Gertjan<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></font></span></div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Carlos<div><a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a></div><div>+595981146623</div>
</div>