Con esta aplicación podemos verificar si uno o varios canales estan disponibles, en el siguiente dial plan verificamos al disponibilidad de dos canales ZAP (DAHDI). Luego tratara de realizar la llamada por el canal que este disponible o de lo contrario nos indicara que todas las lineas estan ocupadas.
ChanIsAvail()
; 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)
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 Dial() to the channel.
|
ChanIsAvail()
sets the following channel variables:
${AVAILCHAN}
- The name of the accessible channel, including the session number of the call.
${AVAILORIGCHAN}
- The canonical channel name (i.e., the channel name without session number).
${AVAILSTATUS}
Status code of the channel:
AST_DEVICE_UNKNOWN
(0)
- Status of the channel is unknown. It is a valid channel, but we don't know about its state.
AST_DEVICE_NOT_INUSE
(1)
- The channel is not in use.
AST_DEVICE_IN_USE
(2)
- The channel is in use.
AST_DEVICE_BUSY
(3)
- The channel is busy.
AST_DEVICE_INVALID
(4)
- The channel is unknown.
AST_DEVICE_UNAVAILABLE
(5)
- The channel is not available and not registered.
AST_DEVICE_RINGING
(6)
- The channel is ringing.
| |
This application does not behave as expected on MGCP channels.
|
No hay comentarios:
Publicar un comentario