Dial([Technology/Resource,timeout,options,URL])
Full arguments reference
Technology/ResourceTechnology/Resourcerequired - Specification of the device(s) to dial. These must be in the format ofTechnology/Resource, where Technology represents a particular channel driver, and Resource represents a resource available to that particular channel driver.Technology2/Resource2- Optional extra devices to dial in parallel (multiple)
timeout- Specifies the number of seconds we attempt to dial the specified devices.optionsA- Play an announcement to the called and/or calling parties, where x is the prompt to be played to the called party and y is the prompt to be played to the caller. The files may be different and will be played to each party simultaneously.x- The file to play to the called partyy- The file to play to the calling party
a- Immediately answer the calling channel when the called channel answers in all cases. Normally, the calling channel is answered when the called channel answers, but when options such asA()andM()are used, the calling channel is not answered until all actions on the called channel (such as playing an announcement) are completed. This option can be used to answer the calling channel before doing anything on the called channel. You will rarely need to use this option, the default behavior is adequate in most cases.b- Before initiating an outgoing call,Gosubto the specified location using the newly created channel. TheGosubwill be executed for each destination channel.contextextenpriorityrequiredarg1required (multiple)argN
B- Before initiating the outgoing call(s),Gosubto the specified location using the current channel.contextextenpriorityrequiredarg1required (multiple)argN
C- Reset the call detail record (CDR) for this call.c- If the Dial() application cancels this call, always set HANGUPCAUSE to 'answered elsewhere'd- Allow the calling user to dial a 1 digit extension while waiting for a call to be answered. Exit to that extension if it exists in the current context, or the context defined in the EXITCONTEXT variable, if it exists. NOTE: Many SIP and ISDN phones cannot send DTMF digits until the call is connected. If you wish to use this option with these phones, you can use theAnswerapplication before dialing.D- Send the specified DTMF strings after the called party has answered, but before the call gets bridged. The called DTMF string is sent to the called party, and the calling DTMF string is sent to the calling party. Both arguments can be used alone. If progress is specified, its DTMF is sent to the called party immediately after receiving aPROGRESSmessage. SeeSendDTMFfor valid digits. If mfprogress is specified, its MF is sent to the called party immediately after receiving aPROGRESSmessage. If mfwink is specified, its MF is sent to the called party immediately after receiving aWINKmessage. SeeSendMFfor valid digits. If sfprogress is specified, its SF is sent to the called party immediately after receiving aPROGRESSmessage. If sfwink is specified, its SF is sent to the called party immediately after receiving aWINKmessage. SeeSendSFfor valid digits.calledcallingprogressmfprogressmfwinksfprogresssfwink
E- Enable echoing of sent MF or SF digits back to caller (e.g. "hearpulsing"). Used in conjunction with the D option.e- Execute thehextension for peer after the call endsf- If x is not provided, force the CallerID sent on a call-forward or deflection to the dialplan extension of thisDial()using a dialplanhint. For example, some PSTNs do not allow CallerID to be set to anything other than the numbers assigned to you. If x is provided, force the CallerID sent to x.x
F- When the caller hangs up, transfer the called party to the specified destination and start execution at that location. NOTE: Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('_').contextextenpriorityrequired
F- When the caller hangs up, transfer the called party to the next priority of the current extension and start execution at that location. NOTE: Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('_'). NOTE: Using this option from a Gosub() might not make sense as there would be no return points.g- Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.G- If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one. NOTE: You cannot use any additional action post answer options in conjunction with this option.contextextenpriorityrequired
h- Allow the called party to hang up by sending the DTMF sequence defined for disconnect infeatures.conf.H- Allow the calling party to hang up by sending the DTMF sequence defined for disconnect infeatures.conf. NOTE: Many SIP and ISDN phones cannot send DTMF digits until the call is connected. If you wish to allow DTMF disconnect before the dialed party answers with these phones, you can use theAnswerapplication before dialing.i- Asterisk will ignore any forwarding requests it may receive on this dial attempt.I- Asterisk will ignore any connected line update requests or any redirecting party update requests it may receive on this dial attempt.j- Use the initial stream topology of the caller for outgoing channels, even if the caller topology has changed. NOTE: For this option to work, it has to be present in all invocations of Dial that the caller channel goes through.k- Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking infeatures.conf.K- Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking infeatures.conf.L- Limit the call to x milliseconds. Play a warning when y milliseconds are left. Repeat the warning every z milliseconds until time expires. This option is affected by the following variables:xrequired - Maximum call time, in millisecondsy- Warning time, in millisecondsz- Repeat time, in milliseconds
m- Provide hold music to the calling party until a requested channel answers. A specific music on hold class (as defined inmusiconhold.conf) can be specified.class
n- This option is a modifier for the call screening/privacy mode. (See thepandPoptions.) It specifies that no introductions are to be saved in thepriv-callerintrosdirectory.delete- With delete either not specified or set to0, the recorded introduction will not be deleted if the caller hangs up while the remote party has not yet answered.
N- This option is a modifier for the call screening/privacy mode. It specifies that if CallerID is present, do not screen the call.o- If x is not provided, specify that the CallerID that was present on the calling channel be stored as the CallerID on the called channel. This was the behavior of Asterisk 1.0 and earlier. If x is provided, specify the CallerID stored on the called channel. Note thato(${CALLERID(all)})is similar to optionowithout the parameter.x
O- Enables operator services mode. This option only works when bridging a DAHDI channel to another DAHDI channel only. If specified on non-DAHDI interfaces, it will be ignored. When the destination answers (presumably an operator services station), the originator no longer has control of their line. They may hang up, but the switch will not release their line until the destination party (the operator) hangs up.mode- With mode either not specified or set to1, the originator hanging up will cause the phone to ring back immediately.
p- This option enables screening mode. This is basically Privacy mode without memory.P- Enable privacy mode. Use x as the family/key in the AstDB database if it is provided. The current extension is used if a database family/key is not specified.x
Q- Specify the Q.850/Q.931 cause to send on unanswered channels when another channel answers the call. As withHangup(), cause can be a numeric cause code or a name such asNO_ANSWER,USER_BUSY,CALL_REJECTEDorANSWERED_ELSEWHERE(the default if Q isn't specified). You can also specify0orNONEto send no cause. See thecauses.hfile for the full list of valid causes and names.causerequired
r- Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. Pass no audio to the calling party until the called channel has answered.tone- Indicate progress to calling party. Send audio 'tone' from theindications.conftonezone currently in use.
R- Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. Allow interruption of the ringback if early media is received on the channel.S- Hang up the call x seconds after the called party has answered the call.xrequired
s- Force the outgoing CallerID tag parameter to be set to the string x. Works with thefoption.xrequired
t- Allow the called party to transfer the calling party by sending the DTMF sequence defined infeatures.conf. This setting does not perform policy enforcement on transfers initiated by other methods.T- Allow the calling party to transfer the called party by sending the DTMF sequence defined infeatures.conf. This setting does not perform policy enforcement on transfers initiated by other methods.U- Execute viaGosubthe routine x for the called channel before connecting to the calling channel. Arguments can be specified to theGosubusing^as a delimiter. TheGosubroutine can set the variable GOSUB_RESULT to specify the following actions after theGosubreturns. NOTE: You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are run on the called channel, so you will not be able to set timeouts via theTIMEOUT()function in this routine.xrequired - Name of the subroutine context to execute viaGosub. The subroutine execution starts in the named context at the s exten and priority 1.arg- Arguments for theGosubroutine (multiple)
u- Works with thefoption.xrequired - Force the outgoing callerid presentation indicator parameter to be set to one of the values passed in x:allowed_not_screenedallowed_passed_screenallowed_failed_screenallowedprohib_not_screenedprohib_passed_screenprohib_failed_screenprohibunavailable
w- Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch recording infeatures.conf.W- Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch recording infeatures.conf.x- Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor infeatures.conf.X- Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor infeatures.conf.z- On a call forward, cancel any dial timeout which has been set for this call.
URL- The optional URL will be sent to the called party if the channel driver supports it.
This application will place calls to one or more specified channels. As soon as one of the requested channels answers, the originating channel will be answered, if it has not already been answered. These two channels will then be active in a bridged call. All other channels that were requested will then be hung up.
Unless there is a timeout specified, the Dial application will wait indefinitely until one of the called channels answers, the user hangs up, or if all of the called channels are busy or unavailable. Dialplan execution will continue if no requested channels can be called, or if the timeout expires. This application will report normal termination if the originating channel hangs up, or if the call is bridged and either of the parties in the bridge ends the call.
If the OUTBOUND_GROUP variable is set, all peer channels created by this application will be put into that group (as in Set(GROUP()=...). If the OUTBOUND_GROUP_ONCE variable is set, all peer channels created by this application will be put into that group (as in Set(GROUP()=...). Unlike OUTBOUND_GROUP, however, the variable will be unset after use.
same => n,Dial(PJSIP/alice,30)
same => n,Dial(PJSIP/alice&PJIP/bob,45)
same => n,Dial(PJSIP/alice,,g)
same => n,Log(NOTICE, Alice call result: ${DIALSTATUS})
same => n,Dial(PJSIP/alice,,TX)
same => n,Dial(PJSIP/alice,,L(60000:30000:10000))
same => n,Dial(PJSIP/alice&PJSIP/bob,,Q(NO_ANSWER))
[default]
exten => callee_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
same => n,Log(NOTICE, I'm called on channel ${CHANNEL} prior to it starting the dial attempt)
same => n,Return()
exten => called_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
same => n,Log(NOTICE, I'm called on outbound channel ${CHANNEL} prior to it being used to dial someone)
same => n,Return()
exten => _X.,1,NoOp()
same => n,Dial(PJSIP/alice,,b(default^called_channel^1(my_gosub_arg1^my_gosub_arg2))B(default^callee_channel^1(my_gosub_arg1^my_gosub_arg2)))
same => n,Hangup()
[my_gosub_routine]
exten => s,1,NoOp(ARG1=${ARG1} ARG2=${ARG2})
same => n,Playback(hello)
same => n,Return()
[default]
exten => _X.,1,NoOp()
same => n,Dial(PJSIP/alice,,U(my_gosub_routine^my_gosub_arg1^my_gosub_arg2))
same => n,Hangup()
same => n,Dial(PJSIP/alice,,G(jump_to_here))
same => n(jump_to_here),Goto(confbridge)
same => n,Goto(confbridge)
same => n(confbridge),ConfBridge(${EXTEN})
This application sets the following channel variables:
- DIALEDTIME - This is the time from dialing a channel until when it is disconnected.
- DIALEDTIME_MS - This is the milliseconds version of the DIALEDTIME variable.
- ANSWEREDTIME - This is the amount of time for actual call.
- ANSWEREDTIME_MS - This is the milliseconds version of the ANSWEREDTIME variable.
- RINGTIME - This is the time from creating the channel to the first RINGING event received. Empty if there was no ring.
- RINGTIME_MS - This is the milliseconds version of the RINGTIME variable.
- PROGRESSTIME - This is the time from creating the channel to the first PROGRESS event received. Empty if there was no such event.
- PROGRESSTIME_MS - This is the milliseconds version of the PROGRESSTIME variable.
- DIALEDPEERNAME - The name of the outbound channel that answered the call.
- DIALEDPEERNUMBER - The number that was dialed for the answered outbound channel.
- FORWARDERNAME - If a call forward occurred, the name of the forwarded channel.
- DIALSTATUS - This is the status of the call
CHANUNAVAIL- Either the dialed peer exists but is not currently reachable, e.g. endpoint is not registered, or an attempt was made to call a nonexistent location, e.g. nonexistent DNS hostname.CONGESTION- Channel or switching congestion occurred when routing the call. This can occur if there is a slow or no response from the remote end.NOANSWER- Called party did not answer.BUSY- The called party was busy or indicated a busy status. Note that some SIP devices will respond with 486 Busy if their Do Not Disturb modes are active. In this case, you can use DEVICE_STATUS to check if the endpoint is actually in use, if needed.ANSWER- The call was answered. Any other result implicitly indicates the call was not answered.CANCEL- Dial was cancelled before call was answered or reached some other terminating event.DONTCALL- For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'Go Away' script.TORTURE- For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'torture' script.INVALIDARGS- Dial failed due to invalid syntax.
Technology/ResourceTechnology/Resourcerequired - Specification of the device(s) to dial. These must be in the format ofTechnology/Resource, where Technology represents a particular channel driver, and Resource represents a resource available to that particular channel driver.Technology2/Resource2- Optional extra devices to dial in parallel (multiple)
timeout- Specifies the number of seconds we attempt to dial the specified devices.optionsA- Play an announcement to the called and/or calling parties, where x is the prompt to be played to the called party and y is the prompt to be played to the caller. The files may be different and will be played to each party simultaneously.x- The file to play to the called partyy- The file to play to the calling party
a- Immediately answer the calling channel when the called channel answers in all cases. Normally, the calling channel is answered when the called channel answers, but when options such asA()andM()are used, the calling channel is not answered until all actions on the called channel (such as playing an announcement) are completed. This option can be used to answer the calling channel before doing anything on the called channel. You will rarely need to use this option, the default behavior is adequate in most cases.b- Before initiating an outgoing call,Gosubto the specified location using the newly created channel. TheGosubwill be executed for each destination channel.contextextenpriorityrequiredarg1required (multiple)argN
B- Before initiating the outgoing call(s),Gosubto the specified location using the current channel.contextextenpriorityrequiredarg1required (multiple)argN
C- Reset the call detail record (CDR) for this call.c- If the Dial() application cancels this call, always set HANGUPCAUSE to 'answered elsewhere'd- Allow the calling user to dial a 1 digit extension while waiting for a call to be answered. Exit to that extension if it exists in the current context, or the context defined in the EXITCONTEXT variable, if it exists. NOTE: Many SIP and ISDN phones cannot send DTMF digits until the call is connected. If you wish to use this option with these phones, you can use theAnswerapplication before dialing.D- Send the specified DTMF strings after the called party has answered, but before the call gets bridged. The called DTMF string is sent to the called party, and the calling DTMF string is sent to the calling party. Both arguments can be used alone. If progress is specified, its DTMF is sent to the called party immediately after receiving aPROGRESSmessage. SeeSendDTMFfor valid digits. If mfprogress is specified, its MF is sent to the called party immediately after receiving aPROGRESSmessage. If mfwink is specified, its MF is sent to the called party immediately after receiving aWINKmessage. SeeSendMFfor valid digits. If sfprogress is specified, its SF is sent to the called party immediately after receiving aPROGRESSmessage. If sfwink is specified, its SF is sent to the called party immediately after receiving aWINKmessage. SeeSendSFfor valid digits.calledcallingprogressmfprogressmfwinksfprogresssfwink
E- Enable echoing of sent MF or SF digits back to caller (e.g. "hearpulsing"). Used in conjunction with the D option.e- Execute thehextension for peer after the call endsf- If x is not provided, force the CallerID sent on a call-forward or deflection to the dialplan extension of thisDial()using a dialplanhint. For example, some PSTNs do not allow CallerID to be set to anything other than the numbers assigned to you. If x is provided, force the CallerID sent to x.x
F- When the caller hangs up, transfer the called party to the specified destination and start execution at that location. NOTE: Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('_').contextextenpriorityrequired
F- When the caller hangs up, transfer the called party to the next priority of the current extension and start execution at that location. NOTE: Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('_'). NOTE: Using this option from a Gosub() might not make sense as there would be no return points.g- Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.G- If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one. NOTE: You cannot use any additional action post answer options in conjunction with this option.contextextenpriorityrequired
h- Allow the called party to hang up by sending the DTMF sequence defined for disconnect infeatures.conf.H- Allow the calling party to hang up by sending the DTMF sequence defined for disconnect infeatures.conf. NOTE: Many SIP and ISDN phones cannot send DTMF digits until the call is connected. If you wish to allow DTMF disconnect before the dialed party answers with these phones, you can use theAnswerapplication before dialing.i- Asterisk will ignore any forwarding requests it may receive on this dial attempt.I- Asterisk will ignore any connected line update requests or any redirecting party update requests it may receive on this dial attempt.j- Use the initial stream topology of the caller for outgoing channels, even if the caller topology has changed. NOTE: For this option to work, it has to be present in all invocations of Dial that the caller channel goes through.k- Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking infeatures.conf.K- Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking infeatures.conf.L- Limit the call to x milliseconds. Play a warning when y milliseconds are left. Repeat the warning every z milliseconds until time expires. This option is affected by the following variables:xrequired - Maximum call time, in millisecondsy- Warning time, in millisecondsz- Repeat time, in milliseconds
m- Provide hold music to the calling party until a requested channel answers. A specific music on hold class (as defined inmusiconhold.conf) can be specified.class
n- This option is a modifier for the call screening/privacy mode. (See thepandPoptions.) It specifies that no introductions are to be saved in thepriv-callerintrosdirectory.delete- With delete either not specified or set to0, the recorded introduction will not be deleted if the caller hangs up while the remote party has not yet answered.
N- This option is a modifier for the call screening/privacy mode. It specifies that if CallerID is present, do not screen the call.o- If x is not provided, specify that the CallerID that was present on the calling channel be stored as the CallerID on the called channel. This was the behavior of Asterisk 1.0 and earlier. If x is provided, specify the CallerID stored on the called channel. Note thato(${CALLERID(all)})is similar to optionowithout the parameter.x
O- Enables operator services mode. This option only works when bridging a DAHDI channel to another DAHDI channel only. If specified on non-DAHDI interfaces, it will be ignored. When the destination answers (presumably an operator services station), the originator no longer has control of their line. They may hang up, but the switch will not release their line until the destination party (the operator) hangs up.mode- With mode either not specified or set to1, the originator hanging up will cause the phone to ring back immediately.
p- This option enables screening mode. This is basically Privacy mode without memory.P- Enable privacy mode. Use x as the family/key in the AstDB database if it is provided. The current extension is used if a database family/key is not specified.x
Q- Specify the Q.850/Q.931 cause to send on unanswered channels when another channel answers the call. As withHangup(), cause can be a numeric cause code or a name such asNO_ANSWER,USER_BUSY,CALL_REJECTEDorANSWERED_ELSEWHERE(the default if Q isn't specified). You can also specify0orNONEto send no cause. See thecauses.hfile for the full list of valid causes and names.causerequired
r- Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. Pass no audio to the calling party until the called channel has answered.tone- Indicate progress to calling party. Send audio 'tone' from theindications.conftonezone currently in use.
R- Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. Allow interruption of the ringback if early media is received on the channel.S- Hang up the call x seconds after the called party has answered the call.xrequired
s- Force the outgoing CallerID tag parameter to be set to the string x. Works with thefoption.xrequired
t- Allow the called party to transfer the calling party by sending the DTMF sequence defined infeatures.conf. This setting does not perform policy enforcement on transfers initiated by other methods.T- Allow the calling party to transfer the called party by sending the DTMF sequence defined infeatures.conf. This setting does not perform policy enforcement on transfers initiated by other methods.U- Execute viaGosubthe routine x for the called channel before connecting to the calling channel. Arguments can be specified to theGosubusing^as a delimiter. TheGosubroutine can set the variable GOSUB_RESULT to specify the following actions after theGosubreturns. NOTE: You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are run on the called channel, so you will not be able to set timeouts via theTIMEOUT()function in this routine.xrequired - Name of the subroutine context to execute viaGosub. The subroutine execution starts in the named context at the s exten and priority 1.arg- Arguments for theGosubroutine (multiple)
u- Works with thefoption.xrequired - Force the outgoing callerid presentation indicator parameter to be set to one of the values passed in x:allowed_not_screenedallowed_passed_screenallowed_failed_screenallowedprohib_not_screenedprohib_passed_screenprohib_failed_screenprohibunavailable
w- Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch recording infeatures.conf.W- Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch recording infeatures.conf.x- Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor infeatures.conf.X- Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor infeatures.conf.z- On a call forward, cancel any dial timeout which has been set for this call.
URL- The optional URL will be sent to the called party if the channel driver supports it.
User Notes
Know a tip or gotcha for this topic? Share it below and help others.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.