How dial out on any channel?

hello everyone
I have 10 outgoing iax channel ,i would normally want to dial out on any iax channel that was available, not a specific one. what can i do in the extensions!

You have to add ur all 10 outgoing numbers in the extensions.conf as this.

exten =>100,1, Dial(IAX/100@,20,r)
exten =>100,2, Pickup(100@
exten =>100,3, Answer
exten =>100,4, Hangup
exten =>105,1, Dial(IAX/105@,20,r)
exten =>105,2, Pickup(105@
exten =>105,3, Answer
exten =>105,4, Hangup

Here 105 and 100 are your outgoing numbers. Also add your outgoing phone details in sip.conf.Hope this will make you call.

Hm. Interesting. I don’t think that will work.

I would write a dialplan macro something like this:

TRUNK1=IAX2/NNNN ; use your real IAX peer here obviously
; …etc…

; ARG1 = number to dial
exten => s,1,Set(numTrunks=4) ; or however many IAX trunks you have
exten => s,2,Set(currentTrunk=1)
exten => s,3,Dial(${TRUNK${currentTrunk}}/${ARG1}|60)
exten => s,4,Goto(s-${DIALSTATUS}|1)

exten => s-CHANUNAVAIL,1,Goto(s-CONGESTION|1)

exten => s-CONGESTION,1,Set(currentTrunk=${MATH(${currentTrunk}+1)})
exten => s-CONGESTION,2,GotoIf($[${currentTrunk} > ${numTrunks}]?3:4)
exten => s-CONGESTION,3,Congestion
exten => s-CONGESTION,4,Goto(s|3)

exten => _NXXXXXXX,1,Macro(outbound|${EXTEN})

I’m sorry but I haven’t had time to test the above yet, but I think this is more what you need.

Good luck!


exten => _NXXXXXX,1,Dial(${TRUNK1}/${EXTEN})
exten => _NXXXXXX,2,Dial(${TRUNK2}/${EXTEN})
exten => _NXXXXXX,3,Dial(${TRUNK3}/${EXTEN})
exten => _NXXXXXX,4,Dial(${TRUNK4}/${EXTEN})

In 1.2.4 for example this works well enough because iax.conf autokill=yes allows 2000ms (or as you set) then the plan will fall through the priority. SIP can behave similarly. If the dialplan runs out of places to go, a congestion tone is generated or add it to priority 5 to be nice. You can also use qualify=yes in iax.conf (and sip.conf) and this may be required for DIALSTATUS CHANUNAVAIL CONGESTION but I didn’t really test such precise control as simple fallthrough works well enough for me today. I have priorityjumping=no in extensions.conf. I try to keep it simple… on call termination (hangup) it (leaves or moves through) the current context to priority h.