In Asterisk, Local channels are a method used to treat an extension in the dialplan as if it were an external device. In essense, Asterisk will send the call back into the dialplan as the destination of the call, versus sending the call to a device.
Two of the most common areas where Local channels are used include members configured for queues, and in use with callfiles. There are also other uses where you want to ring two destinations, but with different information, such as different callerID for each outgoing request.
Delay Dialing Devices Example
Skip to end of metadata
Go to start of metadata
Go to start of metadata
Lets say when someone calls extension 201, we want to
ring both the desk phone and their cellphone at the same time, but we
want to wait about 6 seconds to start dialing the cellphone. This is
useful in a situation when someone might be sitting at their desk, but
don't want both devices ringing at the same time, but also doesn't want
to wait for the full ring cycle to execute on their desk phone before
rolling over to their cellphone.
The dialplan for this would look something like the following:
When someone dials extension 201 in the [devices] context, it will
execute the Dial() application, and call two Local channels at the same
time:
It will then ring both of those extensions for 30 seconds before
rolling over to the Voicemail() application and playing the appropriate
voicemail recording depending on whether the ${DIALSTATUS} variable
returned BUSY or not.
When reaching the deskphone-201 extension, we execute the Dial() application which calls the SIP device configured as '0004f204001' (the MAC address of the device). When reaching the cellphone-201 extension, we dial the cellphone via the DAHDI channel using group zero (g0) and dialing phone number 1-416-555-1212.
The dialplan for this would look something like the following:
[devices] exten => 201 , 1 ,Verbose( 2 ,Call desk phone and cellphone but with delay) exten => 201 ,n,Dial(Local/deskphone- 201 @extensions &Local/cellphone- 201 @extensions , 30 ) exten => 201 ,n,Voicemail( 201 @default ,${IF($[${DIALSTATUS} = BUSY]?b:u)}) exten => 201 ,n,Hangup() [extensions] ; Dial the desk phone exten => deskphone- 201 , 1 ,Verbose( 2 ,Dialing desk phone of extension 201 ) exten => deskphone- 201 ,n,Dial(SIP/0004f2040001) ; SIP device with MAC address ; of 0004f2040001 ; Dial the cellphone exten => cellphone- 201 , 1 ,Verbose( 2 ,Dialing cellphone of extension 201 ) exten => cellphone- 201 ,n,Verbose( 2 ,-- Waiting 6 seconds before dialing) exten => cellphone- 201 ,n,Wait( 6 ) exten => cellphone- 201 ,n,Dial(DAHDI/g0/ 14165551212 ) |
Local/deskphone-201@extensions Local/cellphone-201@extensions
When reaching the deskphone-201 extension, we execute the Dial() application which calls the SIP device configured as '0004f204001' (the MAC address of the device). When reaching the cellphone-201 extension, we dial the cellphone via the DAHDI channel using group zero (g0) and dialing phone number 1-416-555-1212.
Dialing Destinations with Different Information
Skip to end of metadataGo to start of metadata
With Asterisk, we can place a call to multiple
destinations by separating the technology/destination pair with an
ampersand (&). For example, the following Dial() line would ring two
separate destinations for 30 seconds:
That line would dial both the SIP/0004f2040001 device (likely a SIP
device on the network) and dial the phone number 1-416-555-1212 via a
DAHDI interface. In our example though, we would be sending the same
callerID information to both end points, but perhaps we want to send a
different callerID to one of the destinations?
We can send different callerIDs to each of the destinations if we want by using the Local channel. The following example shows how this is possible because we would Dial() two different Local channels from our top level Dial(), and that would then execute some dialplan before sending the call off to the final destinations.
With the dialplan above, we've sent two different callerIDs to the destinations:
Fuente :
https://wiki.asterisk.org/wiki/display/AST/Local+Channel
exten => 201 , 1 ,Dial(SIP/0004f2040001&DAHDI/g0/ 14165551212 , 30 ) |
We can send different callerIDs to each of the destinations if we want by using the Local channel. The following example shows how this is possible because we would Dial() two different Local channels from our top level Dial(), and that would then execute some dialplan before sending the call off to the final destinations.
[devices] exten => 201 , 1 ,NoOp() exten => 201 ,n,Dial(Local/ 201 @internal &Local/ 201 @external , 30 ) exten => 201 ,n,Voicemail( 201 @default ,${IF($[${DIALSTATUS} = BUSY]?b:u)}) exten => 201 ,n,Hangup() [internal] exten => 201 , 1 ,Verbose( 2 ,Placing internal call for extension 201 ) exten => 201 ,n,Set(CALLERID(name)=From Sales) exten => 201 ,n,Dial(SIP/0004f2040001, 30 ) [external] exten => 201 , 1 ,Verbose( 2 ,Placing external call for extension 201 ) exten => 201 ,n,Set(CALLERID(name)=Acme Cleaning) exten => 201 ,n,Dial(DAHDI/g0/ 14165551212 ) |
- "From Sales" was sent to the local device SIP/0004f2040001
- "Acme Cleaning" was sent to the remote number 1-416-555-1212 via DAHDI
Fuente :
https://wiki.asterisk.org/wiki/display/AST/Local+Channel
No hay comentarios:
Publicar un comentario