Keywords: asterisk

## Dialing destinations with different information

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:

-     exten => 201,1,Dial(SIP/0004f2040001&DAHDI/g0/14165551212,30)

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.

-     [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)

With the dialplan above, we've sent two different callerIDs to the destinations:

- "From Sales" was sent to the local device SIP/0004f2040001
- "Acme Cleaning" was sent to the remote number 1-416-555-1212 via DAHDI

Because each of the channels is independent from the other, you could perform any other call manipulation you need. Perhaps the 1-416-555-1212 number is a cell phone and you know you can only ring that device for 18 seconds before the voicemail would pick up. You could then limit the length of time the external number is dialed, but still allow the internal device to be dialed for a longer period of time.