Hello Bogdan,<br><br>I appreciate a lot your response regarding my inquiry. I&#39;ve been reading that tutorial as well as the AVPops and dialog modules documentation for about a month now. I tried to adapt that route block for inbound calls and here&#39;s a portion of what I have on our OpenSIPS 1.5 config file:<br>
<br>-------------------------------------------------------------------------------<br>modparam(&quot;dialog&quot;, &quot;dlg_flag&quot;, 4)<br>modparam(&quot;dialog&quot;, &quot;profiles_with_value&quot;, &quot;inbound&quot;)<br>
<br>......<br><br>                } else if (uri=~&quot;sip:1234567890@.*&quot;) {<br>                        route(3);<br>                        rewritehost(&quot;111.222.111.222&quot;);<br><br>.......<br><br>route[3]<br>
{<br>        ## have we done our checking on this call?<br>        if(!isflagset(31))<br>        {<br>                # user has max channel limit set as preference<br>                if(is_avp_set(&quot;$avp(s:channels)/n&quot;) &amp;&amp; avp_check(&quot;$avp(s:channels)&quot;, &quot;gt/i:0&quot;))<br>
                {<br>                        # get the current calls for DID<br>                        get_profile_size(&quot;inbound&quot;,&quot;$tU&quot;,&quot;$var(calls)&quot;);<br><br>                        # check within limit<br>
                        if($avp(s:channels) &gt; $var(calls))<br>                        {<br>                                xlog(&quot;L_INFO&quot;, &quot;Call control: DID &#39;$tU&#39; currently has<br>                                   &#39;$var(calls)&#39; of &#39;$avp(s:channels)&#39; active calls before this one\n&quot;);<br>
                                $var(setprofile) = 1;<br>                        }<br>                        else<br>                        {<br>                                xlog(&quot;L_INFO&quot;, &quot;Call control: DID &#39;$tU&#39; channel limit exceeded [$var(calls)/$avp(s:channels)]<br>
\n&quot;);<br>                                send_reply(&quot;487&quot;, &quot;Request Terminated: Channel limit exceeded\n&quot;);<br>                                exit;<br>                        }<br>                }<br>
                else<br>                {<br>                        $var(setprofile) = 0;<br>                }<br><br>                call_control();<br><br>                switch ($retcode)<br>                {<br>                        case 2:<br>
                                # Call with no limit<br>                        case 1:<br>                                # Call with a limit under callcontrol management (either prepaid or postpaid)<br>                                break;<br>
                        case -1:<br>                                # Not enough credit (prepaid call)<br>                                xlog(&quot;L_INFO&quot;, &quot;Call control: not enough credit for prepaid call\n&quot;);<br>
                                acc_rad_request(&quot;402&quot;);<br>                                sl_send_reply(&quot;402&quot;, &quot;Not enough credit&quot;);<br>                                exit;<br>                                break;<br>
                        case -2:<br>                                # Locked by call in progress (prepaid call)<br>                                xlog(&quot;L_INFO&quot;, &quot;Call control: prepaid call locked by another call in progress\n&quot;);<br>
                                acc_rad_request(&quot;403&quot;);<br>                                sl_send_reply(&quot;403&quot;, &quot;Call locked by another call in progress&quot;);<br>                                exit;<br>
                                break;<br>                        default:<br>                                # Internal error (message parsing, communication, ...)<br>                                xlog(&quot;L_INFO&quot;, &quot;Call control: internal server error\n&quot;);<br>
                                acc_rad_request(&quot;500&quot;);<br>                                sl_send_reply(&quot;500&quot;, &quot;Internal server error&quot;);<br>                                exit;<br>                }<br>
<br>                if($var(setprofile) &gt; 0)<br>                {<br>                        create_dialog();<br>                        set_dlg_profile(&quot;inbound&quot;,&quot;$tU&quot;);<br>                }<br><br>
                ## mark checking done<br>                setflag(31);<br>        }<br>}<br><br>----------------------------------------------------------------<br><br>And here are the logs appearing on /var/log/messages:<br>
<br>Jan  6 05:53:22 opensips cdrtool[20998]: MaxSessionTime Duration=36000 CallId=<a href="mailto:28a35ce1-4d7a175-25a58684@124.123.234.229">28a35ce1-4d7a175-25a58684@124.123.234.229</a> From=si<br><a href="mailto:p%3A12135551234@124.123.234.229">p:12135551234@124.123.234.229</a> Gateway=124.123.234.229 To=sip:1234567890@124.123.234.241:5060;user=phone<br>
Jan  6 05:53:22 opensips cdrtool[20998]: MaxSessionTime=unlimited Type=postpaid CallId=<a href="mailto:28a35ce1-4d7a175-25a58684@124.123.234.229">28a35ce1-4d7a175-25a58684@124.123.234.229</a> BillingParty=<a href="mailto:12135551234@124.123.234.229">12135551234@124.123.234.229</a><br>
Jan  6 05:53:22 opensips call-control[21263]: Call id <a href="mailto:28a35ce1-4d7a175-25a58684@64.77.234.229">28a35ce1-4d7a175-25a58684@64.77.234.229</a> of <a href="mailto:12135551234@124.123.234.229">12135551234@124.123.234.229</a> to<br>
 sip:1234567890@124.123.234.241:5060;user=phone is postpaid not limited<br>Jan  6 05:53:22 opensips /usr/local/sbin/opensips[1636]: new branch at sip:1234567890@111.222.111.222:5060;user=phone<br>Jan  6 05:53:22 opensips /usr/local/sbin/opensips[1640]: incoming reply<br>
Jan  6 05:53:22 opensips /usr/local/sbin/opensips[1636]: incoming reply<br>Jan  6 05:53:22 opensips /usr/local/sbin/opensips[1636]: ACC: transaction answered: timestamp=1262786002;method=INVITE;from_t<br>ag=14fe61da-25a58684-e5ea4d40;to_tag=as6a53f46c;call_id=<a href="mailto:28a35ce1-4d7a175-25a58684@64.77.234.229">28a35ce1-4d7a175-25a58684@64.77.234.229</a>;code=200;reason=OK<br>
Jan  6 05:53:22 opensips /usr/local/sbin/opensips[1637]: Recive call variable : &lt;null&gt; &lt;null&gt;<br><br>As for the channels limit value, do I have to define it on usr_preferences table? I have these records on the said table:<br>
<br>mysql&gt; select * from usr_preferences;<br>+----+------+------------+--------+---------------+------+------------+---------------------+<br>| id | uuid | username   | domain | attribute     | type | value      | last_modified       |<br>
+----+------+------------+--------+---------------+------+------------+---------------------+<br>|  1 |      | 1234567890 |        | channels      |    0 | 3          | 1900-01-01 00:00:01 |<br>|  2 |      | 0          |        | called_number |    0 | 12135551234 | 1900-01-01 00:00:01 |<br>
+----+------+------------+--------+---------------+------+------------+---------------------+<br>2 rows in set (0.00 sec)<br><br>Unfortunately, I&#39;m not quite sure on what section or portion of opensips.cfg file I will have to put the loading of user preferences to the AVPs. Any inputs or suggestions will be greatly appreciated?<br>
<br>Thank you very much.<br><br>--conpaj--<br><br><br><div class="gmail_quote">On Wed, Jan 6, 2010 at 11:26 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Johnson,<br>
<br>
The idea is to use dialog profiles to keep trace of the ongoing calls<br>
(per resource). As a first step take a look at the following tutorial:<br>
<br>
        <a href="http://www.opensips.org/Resources/DocsTutConcurrentCalls" target="_blank">http://www.opensips.org/Resources/DocsTutConcurrentCalls</a><br>
<br>
Regards,<br>
Bogdan<br>
<div><div></div><div class="h5"><br>
Johnson Pajayat wrote:<br>
&gt; Hi!<br>
&gt;<br>
&gt; I&#39;m a newbie with OpenSIPS administration and configuration and I<br>
&gt; searched on the mail archives regarding limiting the channels but only<br>
&gt; found the site regarding &quot;Concurrent calls limitation&quot;. I&#39;ve been<br>
&gt; trying to grasp the whole idea about AVPops and dialog module but<br>
&gt; unfortunately I&#39;m having a hard time understanding it. If ever, does<br>
&gt; anyone here be kind enough to point me to any available documents or<br>
&gt; sample configurations file that will help me limit the channels on<br>
&gt; inbound calls to a single or group of DIDs? Implementation will be<br>
&gt; done static first and hopefully once I got the whole idea, will be<br>
&gt; implementing a dynamic one.<br>
&gt;<br>
&gt; Thank you very much.<br>
&gt;<br>
&gt; --conpaj--<br>
&gt;<br>
</div></div>&gt; ------------------------------------------------------------------------<br>
<div class="im">&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
<br>
<br>
</div><font color="#888888">--<br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
</font><div><div></div><div class="h5"><br>
<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>
</div></div></blockquote></div><br>