Indicates whether the specified channel is available.
ChanIsAvail(technology1/resource1[&technology2/resource2...][,options])
Verifies that the one or more of the queried channels is available, in the order specified. Returns 0 on success or -1 on failure.
If the s (state) option is given, Asterisk will
treat the channel as unavailable if it is in use, even if it is capable of
taking another call. Option j sets priority jumping to
n+101 if the channel is unavailable.
|
|
|
The mere fact of a channel being available does not
automatically mean that it is free for use or that the device on the
channel will accept a call. That is determined using a
|
ChanIsAvail() sets the following
channel variables:
${AVAILCHAN}
${AVAILORIGCHAN}
${AVAILSTATUS}
Status code of the channel:
AST_DEVICE_UNKNOWN (0)
AST_DEVICE_NOT_INUSE (1)
AST_DEVICE_IN_USE (2)
AST_DEVICE_BUSY (3)
AST_DEVICE_INVALID (4)
AST_DEVICE_UNAVAILABLE (5)
AST_DEVICE_RINGING (6)
|
|
|
This application does not behave as expected on MGCP channels. |
; Check the availability of Zap/1 and Zap/2:
exten => 123,1,ChanIsAvail(Zap/1&Zap/2,j)
; As an exception, using priority jumping, because we want to announce
; something to the caller if no channel is available
; at least one channel is available - dial this channel:
exten => 123,2,NoOp(${AVAILORIGCHAN} is available)
exten => 123,3,Dial(${AVAILORIGCHAN}/123456)
; if the call goes to priority 102 landen, neither Zap/1 nor Zap/2 is av
ailable
exten => 123,102,Playback(all-channels-busy)
|
|
|
Internal help for this application in Asterisk 1.4: -= Info about application 'ChanIsAvail' =-
[Synopsis]
Check channel availability
[Description]
ChanIsAvail(Technology/resource[&Technology2/resource2...][|options]):
This application will check to see if any of the specified channels are
available. The following variables will be set by this application:
${AVAILCHAN} - the name of the available channel, if one exists
${AVAILORIGCHAN} - the canonical channel name that was used to create
the channel
${AVAILSTATUS} - the status code for the available channel
Options:
s - Consider the channel unavailable if the channel is in use at all
j - Support jumping to priority n+101 if no channel is available
diff output to internal help in Asterisk 1.2: - none - |