Some email asked for some examples. He's an example system that will use ViaTalk lines (which allow 2 concurrent calls on a channel, so I use GroupCount to check for a value of 2). It isn't round-robin and actually I'd pay someone good money to make a revised Dial() function that would do round robbin on a defined set of SIP trunks. I solve the Round Robbin issue right now by periodicly changing
<br> where SIP/trunk0 ... SIP/trunkN point to and then reloading the configurations. Periodic for me is midnight each night. So every night the order in priority order is reset.<br><br><strong>Again, just in case someone from Asterisk-Dev or Asterisk-Bus is reading this: I will donate/pay to have a Round Robbin outbound trunk balancing scheme developed. Should be able to use any Asterisk supported trunk type (SIP, IAX2, etc). No need to care about maximum concurrent connections since if it fails then we're out of lines anyways.
</strong><br><br>[globals]<br>TRY1=SIP/trunk0<br>TRY2=SIP/trunk1<br>TRY3=SIP/trunk2<br>TRY4=SIP/trunk3<br>TRY5=SIP/trunk4<br>TRY6=SIP/trunk5<br>TRY7=SIP/trunk6<br>TRY8=SIP/trunk7<br>TRY9=SIP/trunk8<br>TRY10=SIP/trunk9<br>
TRY11=SIP/trunk10<br><br>[macro-which-line]<br>exten => s,1,set(TRIES=0)<br>exten => s,n(nextone),set(TRIES=$[${TRIES} + 1]) ; increment TRIES by 1<br>exten => s,n,set(DIALSTRING=${TRY${TRIES}}) ; assign TRYn to DIALSTRING
<br>exten => s,n,gotoif($["${DIALSTRING}" = ""]?donehere) ; see if we've run out of things to try<br>exten => s,n,ChanIsAvail(${DIALSTRING}) ; it will be up or down, no need for this to be exclusive
<br>exten => s,n,gotoif($[${AVAILSTATUS} = 0]?:nextone)<br>exten => s,n,gotoif($[${GROUP_COUNT(${DIALSTRING})} >= 2]?nextone) ; have we used up the allowed calls on this channel<br>exten => s,n,set(GROUP()=${DIALSTRING}) ; Lock the line! Yay...
<br>exten => s,n,Dial(${DIALSTRING}/1${ARG1}) ; dial the phone<br>exten => s,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?donehere) ; Don't keep dialing<br>exten => s,n,NoOp("Moving to the next one...");
<br>exten => s,n,goto(nextone) ; TEMP<br>exten => s,n(donehere),MacroExit() ; we only get here if everything failed<br><br><br>=================<br><br>Okay, that's one example. Your simple two line thing might be better done another way. Let's say we try this:
<br><br>1) Place a call two two phone lines at once, but have a single line delayed by 3 seconds.<br><br>Something to this effect:<br><br>>> Dial(SIP/trunk0&Local/delayed_trunk1)<br><br>Where Delayed_Trunk1 is a macro which calls SLEEP(3) and then Dial(Trunk1). I could go into more detail, but I'm going to assume you can figure out how to do this.
<br>