I&#39;ve improved this since this revision, but now a days I don&#39;t use limited systems.  But my code has been used in places that need 100 concurrent outgoing lines.<br><br>[macro-which-line]<br>exten =&gt; s,1,set(TRIES=0)<br>
exten =&gt; s,n(nextone),set(TRIES=$[${TRIES} + 1]) ; increment TRIES by 1<br>exten =&gt; s,n,set(DIALSTRING=${TRY${TRIES}}) ; assign TRYn to DIALSTRING<br>exten =&gt; s,n,gotoif($[&quot;${DIALSTRING}&quot; = &quot;&quot;]?donehere) ; see if we&#39;ve run out of things to try<br>
exten =&gt; s,n,ChanIsAvail(${DIALSTRING}) ; it will be up or down, no need for this to be exclusive<br>exten =&gt; s,n,gotoif($[${AVAILSTATUS} = 0]?:nextone)<br>exten =&gt; s,n,gotoif($[${GROUP_COUNT(${DIALSTRING})} &gt;= 2]?nextone) ; have we used up the allowed calls on this channel<br>
exten =&gt; s,n,set(GROUP()=${DIALSTRING}) ; Lock the line! Yay...<br>exten =&gt; s,n,Dial(${DIALSTRING}/1${ARG1}) ; dial the phone<br>exten =&gt; s,n,GotoIf($[&quot;${DIALSTATUS}&quot; = &quot;BUSY&quot;]?donehere) ; Don&#39;t keep dialing<br>
exten =&gt; s,n,NoOp(&quot;Moving to the next one...&quot;);<br>exten =&gt; s,n,goto(nextone) ; TEMP<br>exten =&gt; s,n(donehere),MacroExit() ; we only get here if everything failed<br><br>Then in GLOBALS you just set things like:<br>
<br>TRY0=SIP/trunk1<br>TRY1=SIP/trunk2<br>TRY3=SIP/other1<br><br>The above code is limited to 2 lines per channel.  The code I used originally (not sure where I found it anymore, might have been this mailing list or might have been Voip-Info) support defining how many channels you wanted to use for each provider (ie, provider1 has 2 lines free, but provider2 has 5 lines).  The original code didn&#39;t hold up though since if multiple lines were being dialed at the exact same instance they would both return the same availability before dialing the line.  So in this one, I try to lock the line early and if I get some other kind of error I move on to the next group because I might have failed due to another race condition.<br>
<br>Anyways, tons of problems when you&#39;re limited on channels.  Mine is the best and one of a very few I&#39;ve ever seen.  SuperDial, I feel, is a silly idea.  It&#39;s exactly the same as a regular Dial string.  No clue why you&#39;d use it over Dial.  And the reason Dial doesn&#39;t work is because if the Dial&#39;ed line hangs up it returns back to the orginal Dial Plan.  Doesn&#39;t help at all.  You hang up on the person, the person goes to the next line in the dial plan, and you get called again.  You hang up, they call you back again.  Soulds like a good way to use up air time.<br clear="all">
<br>Nicholas Blasgen<br>Partner / Network Operations<br>Refractive Dialer LLC<br>415.692-5277 (w)<br>408.497.9796 (c)<br><br>