[Asterisk-Users] Picking an open channel (FXO port) for outbound calls

asterisk at lists.styx.org asterisk at lists.styx.org
Mon Nov 24 11:21:28 MST 2003


> Zap/1 and Zap/2 are analog phone lines.  What is the best method of picking
> an open line when someone tries to dial-out? i.e. if Zap/1 is in use how can
> I instruct Asterisk to use Zap/2 and vice versa? I know complex methods of
> making this happen, but I'm sure there is a very simple way to accomplish
> this task.

  -= Info about application 'ChanIsAvail' =- 

[Synopsis]:
  Check if channel is available

[Description]:
  ChanIsAvail(Technology/resource[&Technology2/resource2...]): 
Checks is any of the requested channels are available.  If none
of the requested channels are available the new priority will
be n+101 (unless such a priority does not exist, in which case
ChanIsAvail will return -1.  If any of the requested channels
are available, the next priority will be n+1, the channel variable
${AVAILCHAN} will be set to the name of the available channel and
the ChanIsAvail app will return 0.

as in:

exten => _9.,1,ChanIsAvail(Zap/1&Zap/2)
exten => _9.,2,Dial(${AVAILCHAN})
exten => _9.,102,NoOp
exten => _9.,103,Congestion

(Note that specifying a timeout in the Dial application
with FXO ports doesn't really do anything -- the channel
is considered 'answered' as soon as the call is placed
regardless of whether the remote end answers)

-w




More information about the asterisk-users mailing list