<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/en/2172/18/9/_/styles/combined.css?spaceKey=AST&amp;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+11+Application_Dial">Asterisk 11 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="Asterisk11Application_Dial-Dial%28%29"></a>Dial()</h1>

<h3><a name="Asterisk11Application_Dial-Synopsis"></a>Synopsis</h3>

<p>Attempt to connect to another device or endpoint and bridge the call.</p>
<h3><a name="Asterisk11Application_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 <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 <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 <tt>OUTBOUND_GROUP</tt>, however, the variable will be unset after use.</p>

<p>This application sets the following channel variables:</p>
<ul>
        <li>DIALEDTIME - This is the time from dialing a channel until when it is disconnected.</li>
        <li>ANSWEREDTIME - This is the amount of time for actual call.</li>
        <li>DIALSTATUS - This is the status of the call
        <ul>
                <li>CHANUNAVAIL</li>
                <li>CONGESTION</li>
                <li>NOANSWER</li>
                <li>BUSY</li>
                <li>ANSWER</li>
                <li>CANCEL</li>
                <li>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.</li>
                <li>TORTURE - 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>INVALIDARGS</li>
        </ul>
        </li>
</ul>


<h3><a name="Asterisk11Application_Dial-Syntax"></a>Syntax</h3>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>Dial(Technology/Resource[&amp;Technology2/Resource2[&amp;...]][,timeout[,options,URL]])</pre>
</div></div>
<h5><a name="Asterisk11Application_Dial-Arguments"></a>Arguments</h5>


<ul>
        <li>Technology/Resource
        <ul>
                <li>Technology/Resource - 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>Technology2/Resource2 - Optional extra devices to dial in parallelIf you need more then one enter them as Technology2/Resource2&amp;Technology3/Resourse3&amp;.....</li>
        </ul>
        </li>
        <li>timeout - Specifies the number of seconds we attempt to dial the specified devicesIf not specified, this defaults to 136 years.</li>
        <li>options
        <ul>
                <li>A - Play an announcement to the called party, where <em>x</em> is the prompt to be played
                <ul>
                        <li>x - The file to play to the called party</li>
                </ul>
                </li>
                <li>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 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>b - Before initiating an outgoing call, Gosub to the specified location using the newly created channel. The Gosub will be executed for each destination channel.
                <ul>
                        <li>context</li>
                        <li>exten</li>
                        <li>priority
                        <ul>
                                <li>arg1</li>
                                <li>argN</li>
                        </ul>
                        </li>
                </ul>
                </li>
                <li>B - Before initiating the outgoing call(s), Gosub to the specified location using the current channel.
                <ul>
                        <li>context</li>
                        <li>exten</li>
                        <li>priority
                        <ul>
                                <li>arg1</li>
                                <li>argN</li>
                        </ul>
                        </li>
                </ul>
                </li>
                <li>C - Reset the call detail record (CDR) for this call.</li>
                <li>c - If the Dial() application cancels this call, always set HANGUPCAUSE to 'answered elsewhere'</li>
                <li>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 <tt>EXITCONTEXT</tt> variable, if it exists.</li>
                <li>D - 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>called</li>
                        <li>calling</li>
                        <li>progress</li>
                </ul>
                </li>
                <li>e - Execute the <tt>h</tt> extension for peer after the call ends</li>
                <li>f - 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>x</li>
                </ul>
                </li>
                <li>F - When the caller hangs up, transfer the <b>called</b> party to the specified destination and <b>start</b> execution at that location.
                <ul>
                        <li>context</li>
                        <li>exten</li>
                        <li>priority</li>
                </ul>
                </li>
                <li>F - 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.</li>
                <li>g - Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.</li>
                <li>G - 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.
                <ul>
                        <li>context</li>
                        <li>exten</li>
                        <li>priority</li>
                </ul>
                </li>
                <li>h - Allow the called party to hang up by sending the DTMF sequence defined for disconnect in <tt>features.conf</tt>.</li>
                <li>H - Allow the calling party to hang up by sending the DTMF sequence defined for disconnect in <tt>features.conf</tt>.</li>
                <li>i - Asterisk will ignore any forwarding requests it may receive on this dial attempt.</li>
                <li>I - Asterisk will ignore any connected line update requests or any redirecting party update requests it may receive on this dial attempt.</li>
                <li>k - 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>K - 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>L - 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:
                <ul>
                        <li>LIMIT_PLAYAUDIO_CALLER - If set, this variable causes Asterisk to play the prompts to the caller.
                        <ul>
                                <li>YES default: (true)</li>
                                <li>NO</li>
                        </ul>
                        </li>
                        <li>LIMIT_PLAYAUDIO_CALLEE - If set, this variable causes Asterisk to play the prompts to the callee.
                        <ul>
                                <li>YES</li>
                                <li>NO default: (true)</li>
                        </ul>
                        </li>
                        <li>LIMIT_TIMEOUT_FILE - 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.
                        <ul>
                                <li>FILENAME</li>
                        </ul>
                        </li>
                        <li>LIMIT_CONNECT_FILE - If specified, <em>filename</em> specifies the sound prompt to play when the call begins. If not set, the time remaining will be announced.
                        <ul>
                                <li>FILENAME</li>
                        </ul>
                        </li>
                        <li>LIMIT_WARNING_FILE - 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>FILENAME</li>
                        </ul>
                        </li>
                        <li>x - Maximum call time, in milliseconds</li>
                        <li>y - Warning time, in milliseconds</li>
                        <li>z - Repeat time, in milliseconds</li>
                </ul>
                </li>
                <li>m - 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>class</li>
                </ul>
                </li>
                <li>M - 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:
                <ul>
                        <li>MACRO_RESULT - If set, this action will be taken after the macro finished executing.
                        <ul>
                                <li>ABORT - Hangup both legs of the call</li>
                                <li>CONGESTION - Behave as if line congestion was encountered</li>
                                <li>BUSY - Behave as if a busy signal was encountered</li>
                                <li>CONTINUE - Hangup the called party and allow the calling party to continue dialplan execution at the next priority</li>
                                <li>GOTO:[<span class="error">&#91;&lt;CONTEXT&gt;^&#93;</span>&lt;EXTEN&gt;^]&lt;PRIORITY&gt; - Transfer the call to the specified destination.</li>
                        </ul>
                        </li>
                        <li>macro - Name of the macro that should be executed.</li>
                        <li>arg - Macro arguments</li>
                </ul>
                </li>
                <li>n - 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>delete - 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>N - 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>o - 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>x</li>
                </ul>
                </li>
                <li>O - 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>mode - 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>p - This option enables screening mode. This is basically Privacy mode without memory.</li>
                <li>P - 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>x</li>
                </ul>
                </li>
                <li>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.
                <ul>
                        <li>tone - Indicate progress to calling party. Send audio 'tone' from indications.conf</li>
                </ul>
                </li>
                <li>S - Hang up the call <em>x</em> seconds <b>after</b> the called party has answered the call.
                <ul>
                        <li>x</li>
                </ul>
                </li>
                <li>s - Force the outgoing callerid tag parameter to be set to the string <em>x</em>.Works with the f option.
                <ul>
                        <li>x</li>
                </ul>
                </li>
                <li>t - 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>T - 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>U - 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.
                <ul>
                        <li>GOSUB_RESULT
                        <ul>
                                <li>ABORT - Hangup both legs of the call.</li>
                                <li>CONGESTION - Behave as if line congestion was encountered.</li>
                                <li>BUSY - Behave as if a busy signal was encountered.</li>
                                <li>CONTINUE - Hangup the called party and allow the calling party to continue dialplan execution at the next priority.</li>
                                <li>GOTO:[<span class="error">&#91;&lt;CONTEXT&gt;^&#93;</span>&lt;EXTEN&gt;^]&lt;PRIORITY&gt; - Transfer the call to the specified destination.</li>
                        </ul>
                        </li>
                        <li>x - Name of the subroutine to execute via Gosub</li>
                        <li>arg - Arguments for the Gosub routine</li>
                </ul>
                </li>
                <li>u - Works with the f option.
                <ul>
                        <li>x - Force the outgoing callerid presentation indicator parameter to be set to one of the values passed in <em>x</em>: <tt>allowed_not_screened</tt> <tt>allowed_passed_screen</tt> <tt>allowed_failed_screen</tt> <tt>allowed</tt> <tt>prohib_not_screened</tt> <tt>prohib_passed_screen</tt> <tt>prohib_failed_screen</tt> <tt>prohib</tt> <tt>unavailable</tt></li>
                </ul>
                </li>
                <li>w - 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>W - 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>x - 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>X - 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>z - On a call forward, cancel any dial timeout which has been set for this call.</li>
        </ul>
        </li>
        <li>URL - The optional URL will be sent to the called party if the channel driver supports it.</li>
</ul>



<h3><a name="Asterisk11Application_Dial-ImportVersion"></a>Import Version</h3>

<p>This documentation was imported from Asterisk Version SVN-trunk-r370322</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+11+Application_Dial">View Online</a>
              |
       <a href="https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_Dial?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>