I have two zap lines and I when calling out I would like asterisk to find an open line. I currently use:
exten => _1NXXNXXXXXX,1,ChanIsAvail(${LINES},s)
exten => _1NXXNXXXXXX,2,Dial(${AVAILORIGCHAN}/${EXTEN},Tt)
exten => _1NXXNXXXXXX,3,Congestion( )
exten => _1NXXNXXXXXX,103,Congestion( )
Where LINES is a global variable and defined as:
LINES => Zap/3&Zap/4
Currently if Zap/3 is being used then it will dial using zap/4. If there is no line connected to zap/3 it still attempts to use it. The problem is that I do not know if there will be a line connected to zap/3. How do I have asterisk determine if the line is useable?