You can use a combination of the following dialog profiles (grouping calls) functions for this:<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><span class="section"><code class="function"><a href="http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294302">get_profile_size(profile,[value],size)</a> Check if a prifile is at limit.</code></span></div>

<div><span class="Apple-style-span" style="font-family: monospace; "><a href="http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294092">set_dlg_profile(profile,[value])</a> If not at limit, increment the count for the profile (NOTE the value option is not actually supported yet)</span></div>

<div><span class="section"><code class="function"></code></span><font class="Apple-style-span" face="monospace"><span class="section"><code class="function"><a href="http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294162">unset_dlg_profile(profile,[value])</a> If need to remove from a profile like carrier failover</code></span></font></div>

<div><font class="Apple-style-span" face="monospace"><span class="section"><code class="function"></code></span><span class="section"><code class="function"><a href="http://www.opensips.org/html/docs/modules/1.6.x/dialog.html#id294231">is_in_profile(profile,[value])</a> Not sure this would be needed but...</code></span><br>

</font></div><div><font class="Apple-style-span" face="monospace"><span class="section"><code class="function"><br></code></span></font></div><div><font class="Apple-style-span" face="monospace"><span class="section"><code class="function">When a call ends it will automatically be removed from any profiles it was part of.</code></span></font></div>

<div><font class="Apple-style-span" face="monospace"><span class="section"><code class="function"><br></code></span></font></div><div><div class="gmail_quote">On Fri, Nov 19, 2010 at 1:29 AM, Anton Zagorskiy <span dir="ltr">&lt;<a href="mailto:a.zagorskiy@oyster-telecom.ru">a.zagorskiy@oyster-telecom.ru</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Nobody uses limitation on amount of established sessions?  I don&#39;t believe!<br>
=)<br>
<div class="im"><br>
<br>
<br>
<br>
<br>
<br>
WBR, Anton Zagorskiy<br>
VoIP Developer, Oyster Telecom<br>
Phone.: +7 812 601-0666<br>
Fax: +7 812 601-0593<br>
<a href="mailto:a.zagorskiy@oyster-telecom.ru">a.zagorskiy@oyster-telecom.ru</a><br>
<a href="http://www.oyster-telecom.ru" target="_blank">www.oyster-telecom.ru</a><br>
<br>
<br>
<br>
</div><div><div></div><div class="h5">&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a> [mailto:<a href="mailto:users-">users-</a><br>
&gt; <a href="mailto:bounces@lists.opensips.org">bounces@lists.opensips.org</a>] On Behalf Of Anton Zagorskiy<br>
&gt; Sent: Thursday, November 18, 2010 4:58 PM<br>
&gt; To: &#39;OpenSIPS users mailling list&#39;<br>
&gt; Subject: [OpenSIPS-Users] Handle end of a transaction/dialog<br>
&gt;<br>
&gt; Hello.<br>
&gt;<br>
&gt; I need to control how much SIP dialogs (established or pending) has<br>
&gt; each<br>
&gt; domain. If that value is equal to certain constant then I should drop<br>
&gt; any<br>
&gt; new INVITE from that domain.<br>
&gt; There is no problem with catching initial requests, but with<br>
&gt; terminating.<br>
&gt; How can I control that an openSIPS transaction is in the terminating<br>
&gt; stage?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; WBR, Anton Zagorskiy<br>
&gt; VoIP Developer, Oyster Telecom<br>
&gt; Phone.: +7 812 601-0666<br>
&gt; Fax: +7 812 601-0593<br>
&gt; <a href="mailto:a.zagorskiy@oyster-telecom.ru">a.zagorskiy@oyster-telecom.ru</a><br>
&gt; <a href="http://www.oyster-telecom.ru" target="_blank">www.oyster-telecom.ru</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&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>
<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></div>