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

Robert Mann asterisk at easyway.com
Mon Nov 24 14:46:07 MST 2003


I actually was interested in the same question and this is the answer I was
looking for.  By looking at the original question I think he is having the same
issue I am having here.  I have two FXO lines coming in and I have a two line
FXS phone as well.  When you pick up line 1 FXS I want it to try to dial out
line 1 FXO and if you pick up line 2 FXS I want it to try to dial out line 2 FXO
but if either is busy I want it to roll over to the other FXO line.  So
ChanIsAvail is the best answer I have heard and makes the most sense to me for
this scenario.  As long as the following scenario searches for the ChanIsAvail
in the order you place in its arguments it would work fine this way.

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

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

Robert Mann


----- Original Message ----- 
From: <asterisk at lists.styx.org>
To: "Tony Kava" <asterisk at pottcounty.com>
Cc: <asterisk-users at lists.digium.com>
Sent: Monday, November 24, 2003 10:21 AM
Subject: Re: [Asterisk-Users] Picking an open channel (FXO port) for outbound
calls


> 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

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list