<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/en/2171/18/9/_/styles/combined.css?spaceKey=AST&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_Dial">Asterisk 10 Application_Dial</a></h2>
<h4>Page <b>added</b> by <a href="https://wiki.asterisk.org/wiki/display/~wikibot">Wiki Bot</a>
</h4>
<br/>
<div class="notificationGreySide">
<h1><a name="Asterisk10Application_Dial-Dial%28%29"></a>Dial()</h1>
<h3><a name="Asterisk10Application_Dial-Synopsis"></a>Synopsis</h3>
<p>Attempt to connect to another device or endpoint and bridge the call.</p>
<h3><a name="Asterisk10Application_Dial-Description"></a>Description</h3>
<p>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. </p>
<p>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 executing 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. </p>
<p>If the If the <tt>None</tt> - <tt>OUTBOUND_GROUP</tt> variable is set, all peer channels created by this application will be put into that group (as in Set(GROUP()=...). If the If the <tt>None</tt> - <tt>OUTBOUND_GROUP_ONCE</tt> 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. </p>
<p>This application sets the following channel variables: </p>
<ul>
        <li><tt>DIALEDTIME</tt> - This is the time from dialing a channel until when it is disconnected.</li>
        <li><tt>ANSWEREDTIME</tt> - This is the amount of time for actual call.</li>
        <li><tt>DIALSTATUS</tt> - This is the status of the call
        <ul>
                <li><tt>CHANUNAVAIL</tt></li>
                <li><tt>CONGESTION</tt></li>
                <li><tt>NOANSWER</tt></li>
                <li><tt>BUSY</tt></li>
                <li><tt>ANSWER</tt></li>
                <li><tt>CANCEL</tt></li>
                <li><tt>DONTCALL</tt> - For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'Go Away' script.</li>
                <li><tt>TORTURE</tt> - For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the 'torture' script.</li>
                <li><tt>INVALIDARGS</tt></li>
        </ul>
        </li>
</ul>
<h3><a name="Asterisk10Application_Dial-Syntax"></a>Syntax</h3>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>Dial(Technology/Resource[&Technology2/Resource2[&...]][,timeout[,options[,URL]]])</pre>
</div></div>
<h5><a name="Asterisk10Application_Dial-Arguments"></a>Arguments</h5>
<ul>
        <li><tt>Technology/Resource</tt>
        <ul>
                <li><tt>Technology/Resource</tt> - Specification of the device(s) to dial. These must be in the format of <tt>Technology/Resource</tt>, where <em>Technology</em> represents a particular channel driver, and <em>Resource</em> represents a resource available to that particular channel driver.</li>
                <li><tt>Technology2/Resource2</tt> - Optional extra devices to dial in parallel If you need more then one enter them as Technology2/Resource2&Technology3/Resourse3&.....</li>
        </ul>
        </li>
        <li><tt>timeout</tt> - Specifies the number of seconds we attempt to dial the specified devices If not specified, this defaults to 136 years.</li>
        <li><tt>options</tt>
        <ul>
                <li><tt>A</tt> - Play an announcement to the called party, where <em>x</em> is the prompt to be played
                <ul>
                        <li><tt>x</tt> - The file to play to the called party</li>
                </ul>
                </li>
                <li><tt>a</tt> - 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 as A() and M() 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.</li>
                <li><tt>C</tt> - Reset the call detail record (CDR) for this call.</li>
                <li><tt>c</tt> - If the Dial() application cancels this call, always set the flag to tell the channel driver that the call is answered elsewhere.</li>
                <li><tt>d</tt> - 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 <tt>EXITCONTEXT</tt> variable, if it exists. 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 the 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 the <tt>Answer</tt> application before dialing.</li>
                <li><tt>D</tt> - Send the specified DTMF strings <b>after</b> the called party has answered, but before the call gets bridged. The <em>called</em> DTMF string is sent to the called party, and the <em>calling</em> DTMF string is sent to the calling party. Both arguments can be used alone. If <em>progress</em> is specified, its DTMF is sent immediately after receiving a PROGRESS message.
                <ul>
                        <li><tt>called</tt></li>
                        <li><tt>calling</tt></li>
                        <li><tt>progress</tt></li>
                </ul>
                </li>
                <li><tt>e</tt> - Execute the <tt>h</tt> extension for peer after the call ends</li>
                <li><tt>f</tt> - If <em>x</em> is not provided, force the CallerID sent on a call-forward or deflection to the dialplan extension of this Dial() using a dialplan <tt>hint</tt>. For example, some PSTNs do not allow CallerID to be set to anything other than the numbers assigned to you. If <em>x</em> is provided, force the CallerID sent to <em>x</em>.
                <ul>
                        <li><tt>x</tt></li>
                </ul>
                </li>
                <li><tt>F</tt> - When the caller hangs up, transfer the <b>called</b> party to the specified destination and <b>start</b> execution at that location. Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('<em>').Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('</em>').
                <ul>
                        <li><tt>context</tt></li>
                        <li><tt>exten</tt></li>
                        <li><tt>priority</tt></li>
                </ul>
                </li>
                <li><tt>F</tt> - When the caller hangs up, transfer the <b>called</b> party to the next priority of the current extension and <b>start</b> execution at that location. Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('<em>').Any channel variables you want the called channel to inherit from the caller channel must be prefixed with one or two underbars ('</em>'). Using this option from a Macro() or GoSub() might not make sense as there would be no return points.Using this option from a Macro() or GoSub() might not make sense as there would be no return points.</li>
                <li><tt>g</tt> - Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.</li>
                <li><tt>G</tt> - If the call is answered, transfer the calling party to the specified <em>priority</em> and the called party to the specified <em>priority</em> plus one. You cannot use any additional action post answer options in conjunction with this option.You cannot use any additional action post answer options in conjunction with this option.
                <ul>
                        <li><tt>context</tt></li>
                        <li><tt>exten</tt></li>
                        <li><tt>priority</tt></li>
                </ul>
                </li>
                <li><tt>h</tt> - Allow the called party to hang up by sending the DTMF sequence defined for disconnect in <tt>features.conf</tt>.</li>
                <li><tt>H</tt> - Allow the calling party to hang up by sending the DTMF sequence defined for disconnect in <tt>features.conf</tt>. 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 the 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 the <tt>Answer</tt> application before dialing.</li>
                <li><tt>i</tt> - Asterisk will ignore any forwarding requests it may receive on this dial attempt.</li>
                <li><tt>I</tt> - Asterisk will ignore any connected line update requests or redirecting party update requests it may receiveon this dial attempt.</li>
                <li><tt>k</tt> - Allow the called party to enable parking of the call by sending the DTMF sequence defined for call parking in <tt>features.conf</tt>.</li>
                <li><tt>K</tt> - Allow the calling party to enable parking of the call by sending the DTMF sequence defined for call parking in <tt>features.conf</tt>.</li>
                <li><tt>L</tt> - Limit the call to <em>x</em> milliseconds. Play a warning when <em>y</em> milliseconds are left. Repeat the warning every <em>z</em> milliseconds until time expires. This option is affected by the following variables: If set, this variable causes Asterisk to play the prompts to the caller. If set, this variable causes Asterisk to play the prompts to the callee. If specified, <em>filename</em> specifies the sound prompt to play when the timeout is reached. If not set, the time remaining will be announced. If specified, <em>filename</em> specifies the sound prompt to play when the call begins. If not set, the time remaining will be announced. If specified, <em>filename</em> specifies the sound prompt to play as a warning when time <em>x</em> is reached. If not set, the time remaining will be announced.
                <ul>
                        <li><tt>x</tt> - Maximum call time, in milliseconds</li>
                        <li><tt>y</tt> - Warning time, in milliseconds</li>
                        <li><tt>z</tt> - Repeat time, in milliseconds</li>
                </ul>
                </li>
                <li><tt>m</tt> - Provide hold music to the calling party until a requested channel answers. A specific music on hold <em>class</em> (as defined in <tt>musiconhold.conf</tt> ) can be specified.
                <ul>
                        <li><tt>class</tt></li>
                </ul>
                </li>
                <li><tt>M</tt> - Execute the specified <em>macro</em> for the <b>called</b> channel before connecting to the calling channel. Arguments can be specified to the Macro using <tt>^</tt> as a delimiter. The macro can set the variable <tt>MACRO_RESULT</tt> to specify the following actions after the macro is finished executing: If set, this action will be taken after the macro finished executing. You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this macro.You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this macro. Be aware of the limitations that macros have, specifically with regards to use of the <tt>WaitExten</tt> application. For more information, see the documentation for Macro()
                <ul>
                        <li><tt>macro</tt> - Name of the macro that should be executed.</li>
                        <li><tt>arg</tt> - Macro arguments</li>
                </ul>
                </li>
                <li><tt>n</tt> - This option is a modifier for the call screening/privacy mode. (See the <tt>p</tt> and <tt>P</tt> options.) It specifies that no introductions are to be saved in the <tt>priv-callerintros</tt> directory.
                <ul>
                        <li><tt>delete</tt> - With <em>delete</em> either not specified or set to <tt>0</tt>, the recorded introduction will not be deleted if the caller hangs up while the remote party has not yet answered. With <em>delete</em> set to <tt>1</tt>, the introduction will always be deleted.</li>
                </ul>
                </li>
                <li><tt>N</tt> - This option is a modifier for the call screening/privacy mode. It specifies that if Caller*ID is present, do not screen the call.</li>
                <li><tt>o</tt> - If <em>x</em> is not provided, specify that the CallerID that was present on the <b>calling</b> channel be stored as the CallerID on the <b>called</b> channel. This was the behavior of Asterisk 1.0 and earlier. If <em>x</em> is provided, specify the CallerID stored on the <b>called</b> channel. Note that o(${CALLERID(all)}) is similar to option o without the parameter.
                <ul>
                        <li><tt>x</tt></li>
                </ul>
                </li>
                <li><tt>O</tt> - Enables <b>operator services</b> 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.
                <ul>
                        <li><tt>mode</tt> - With <em>mode</em> either not specified or set to <tt>1</tt>, the originator hanging up will cause the phone to ring back immediately. With <em>mode</em> set to <tt>2</tt>, when the operator flashes the trunk, it will ring their phone back.</li>
                </ul>
                </li>
                <li><tt>p</tt> - This option enables screening mode. This is basically Privacy mode without memory.</li>
                <li><tt>P</tt> - Enable privacy mode. Use <em>x</em> 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.
                <ul>
                        <li><tt>x</tt></li>
                </ul>
                </li>
                <li><tt>r</tt> - 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.
                <ul>
                        <li><tt>tone</tt> - Indicate progress to calling party. Send audio 'tone' from indications.conf</li>
                </ul>
                </li>
                <li><tt>S</tt> - Hang up the call <em>x</em> seconds <b>after</b> the called party has answered the call.
                <ul>
                        <li><tt>x</tt></li>
                </ul>
                </li>
                <li><tt>s</tt> - Force the outgoing callerid tag parameter to be set to the string <em>x</em>. Works with the f option.
                <ul>
                        <li><tt>x</tt></li>
                </ul>
                </li>
                <li><tt>t</tt> - Allow the called party to transfer the calling party by sending the DTMF sequence defined in <tt>features.conf</tt>. This setting does not perform policy enforcement on transfers initiated by other methods.</li>
                <li><tt>T</tt> - Allow the calling party to transfer the called party by sending the DTMF sequence defined in <tt>features.conf</tt>. This setting does not perform policy enforcement on transfers initiated by other methods.</li>
                <li><tt>U</tt> - Execute via Gosub the routine <em>x</em> for the <b>called</b> channel before connecting to the calling channel. Arguments can be specified to the Gosub using <tt>^</tt> as a delimiter. The Gosub routine can set the variable <tt>GOSUB_RESULT</tt> to specify the following actions after the Gosub returns. You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this routine.You cannot use any additional action post answer options in conjunction with this option. Also, pbx services are not run on the peer (called) channel, so you will not be able to set timeouts via the TIMEOUT() function in this routine.
                <ul>
                        <li><tt>x</tt> - Name of the subroutine to execute via Gosub</li>
                        <li><tt>arg</tt> - Arguments for the Gosub routine</li>
                </ul>
                </li>
                <li><tt>u</tt> - Works with the f option.
                <ul>
                        <li><tt>x</tt> - Force the outgoing callerid presentation indicator parameter to be set to one of the values passed in <em>x</em> :<br/>
<tt>allowed_not_screened</tt><br/>
<tt>allowed_passed_screen</tt><br/>
<tt>allowed_failed_screen</tt><br/>
<tt>allowed</tt><br/>
<tt>prohib_not_screened</tt><br/>
<tt>prohib_passed_screen</tt><br/>
<tt>prohib_failed_screen</tt><br/>
<tt>prohib</tt><br/>
<tt>unavailable</tt></li>
                </ul>
                </li>
                <li><tt>w</tt> - Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in <tt>features.conf</tt>.</li>
                <li><tt>W</tt> - Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch recording in <tt>features.conf</tt>.</li>
                <li><tt>x</tt> - Allow the called party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in <tt>features.conf</tt>.</li>
                <li><tt>X</tt> - Allow the calling party to enable recording of the call by sending the DTMF sequence defined for one-touch automixmonitor in <tt>features.conf</tt>.</li>
                <li><tt>z</tt> - On a call forward, cancel any dial timeout which has been set for this call.</li>
        </ul>
        </li>
        <li><tt>URL</tt> - The optional URL will be sent to the called party if the channel driver supports it.</li>
</ul>
<h3><a name="Asterisk10Application_Dial-SeeAlso"></a>See Also</h3>
<h3><a name="Asterisk10Application_Dial-ImportVersion"></a>Import Version</h3>
<p>This documentation was imported from Asterisk version SVN-branch-10-r340810.</p>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;" class="grey">
<a href="https://wiki.asterisk.org/wiki/users/removespacenotification.action?spaceKey=AST">Stop watching space</a>
<span style="padding: 0px 5px;">|</span>
<a href="https://wiki.asterisk.org/wiki/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_Dial">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Application_Dial?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>