Hello List,<br><br>The list sorted my problem thus I shall contribute back ;-)<br><br><br>PROBLEM:<br>========<br><br>I am posting this example, where I have a &quot;Reunion&quot; link of 30 channels. If i send all the traffic (proper + mobile) on the link, the less profitable proper traffic fills the link and leaves no channel for more profitable mobile traffic. Some kind of priority is needed to always leave space for mobile trafic: you don&#39;t want to be terminating traffic that yields 0.001 / min of profit when you could be terminating traffic yielding 10x as much instead.<br>
<br><br>SOLUTION<br>========<br><br>Use asterisk grouping and conditional fonctions to dynamically limit the proper traffic in order to always keep a few channels free.<br><br>For example, imagine you have 0 channels of mobile : allow proper to use up to 26 channels<br>
For example, imagine you have 5 channels of mobile : allow proper to use up to 21 channels<br>
For example, imagine you have 10 channels of mobile : allow proper to use up to 16 channels<br>
For example, imagine you have 28 channels of mobile : allow proper to use up to 0 channels<br><br>In order to do this, you set the SAME group for both mobile and proper channels and then you apply a conditional only on the traffic which you want to limit.<br>
<br>You could also be using the same kind of technique if you had two different classes of customers: retail and wholesale. You want wholesalers to fill your pipes of course (with best effort), but you do not want this traffic to affect your retail service.<br>
<br><br>IMPLEMENTATION<br>==============<br><br>This is the implementation on my production server, seems to work well, feel free to modify to suit up your needs.<br><br>; Reunion Proper : use a conditional statement to dynamically limit number of channels<br>
exten =&gt; _0262XXXXXX,1,Set(GROUP()=Reunion)<br>exten =&gt; _0262XXXXXX,n,NoOp(This channel is member of group: ${GROUP()})<br>exten =&gt; _0262XXXXXX,n,NoOp(Number of channels is ${GROUP_COUNT(Reunion)})<br>exten =&gt; _0262XXXXXX,n,GotoIf($[${GROUP_COUNT(Reunion)}&gt;26]?500)<br>
exten =&gt; _0262XXXXXX,n,Dial(IAX2/dedibox-etang-sale/${EXTEN})<br>exten =&gt; _0262XXXXXX,500,NoOp(Total channels congested, retuning NOCAV)<br>exten =&gt; _0262XXXXXX,501,Congestion()<br><br>; Reunion Mobile : always gets through which increments the channel count... and thus reduces proper capacity<br>
exten =&gt; _0692XXXXXX,1,Set(GROUP()=Reunion)<br>exten =&gt; _0692XXXXXX,n,NoOp(This channel is member of group: ${GROUP()})<br>exten =&gt; _0692XXXXXX,n,NoOp(Number of channels is ${GROUP_COUNT(Reunion)})<br>exten =&gt; _0692XXXXXX,n,Dial(IAX2/dedibox-etang-sale/${EXTEN})<br>
<br>exten =&gt; _0693XXXXXX,1,Set(GROUP()=Reunion)<br>exten =&gt; _0693XXXXXX,n,NoOp(This channel is member of group: ${GROUP()})<br>exten =&gt; _0693XXXXXX,n,NoOp(Number of channels is ${GROUP_COUNT(Reunion)})<br>exten =&gt; _0693XXXXXX,n,Dial(IAX2/dedibox-etang-sale/${EXTEN})<br>
<br clear="all"><br>I hope this piece of information is of use to somebody, some day!<br><br>Cheers<br>Jean-Michel<br><a href="http://ykoz.net/">http://ykoz.net/</a><br><br>