Connects channels.
Dial(technology/resource,timeout,options,URL)
Dial(technology1/resource1[&tech2/resource2[&...]],timeout,options,URL)
Dial(technology/user:password@host/extension,timeout,options)
Connects two channels together.[48] Dial() is perhaps the most
important application in Asterisk. We recommend you read this section
carefully and more than once if necessary.
Dial() accepts every valid channel type (e.g. SIP, IAX2, H.323, MGCP, Local oder Zap) but the allowable parameters are channel-specific; i.e., what parameters a channel requires or will accept depends on the nature of the channel technology. For example, a SIP channel will require an IP address and user information, whereas a ZAP channel requires a telephone number.
When a network-based channel type is specified, the parameters
(such as IP address, user name, password and remote extension) can be
supplied as options to Dial() or, alternatively, be
included in a host configuration section in the appropriate
.conf file. If this second approach is used, all the
required configuration information must be present.
Here's an example:
exten => s,1,Dial(SIP/richard:secret@widgets.biz)
This extension would accomplish the same thing:
exten => s,1,Dial(SIP/a_SIP_friend)
...
as long as "a_SIP_friend" is defined as a channel in
sip.conf:
[a_SIP_friend] fromuser=richard password=secret host=widgets.biz
Sometimes an extension is attached to the address information, as in this example:
exten => s,1,Dial(IAX2/user:secret@widgets.biz/500)
The
remote system is asked to connect the call to extension 500 in the
incoming channel. This extension is not required because the channel
configuration on the remote system is used, or, alternatively, the call is
passed to the default s extension in the incoming
context.
In the end, the remote host decides how the call will be processed; all you can do is request special call handling.
If no timeout is specified, the channel will ring
indefinitely. This behavior is not necessarily undesirable and so it's not
automatically necessary to set this parameter. Just be aware that
"indefinite" can end up being a very long time.[49] The timeout is specified in seconds. It always
follows the device information:
exten => s,1,Dial(IAX2/user:secret@widgets.biz/500,20)
With Dial(), you can ring multiple
channels simultaneously. The call is handled on a "first come, first
served" basis; the first extension to pick up answers the call, and all
the other extensions stop ringing and become available:
exten => s,1,Dial(SIP/2000&SIP/2001&SIP/2303)
A big part of the power in the
Dial() application is in the options,
which always follow the device and timeout information, like
so:
exten => s,1,Dial(IAX2/user:secret@widgets.biz/500,60,options)
|
|
|
If you want to provide options, you still need to provide a comma-delimited space for the timeout value even if it is empty: |
exten => s,1,Dial(IAX2/user:secret@widgets.biz/500,,options)
Here are the valid options to the
Dial() application:
d
4
extension. The extension is in the current context unless
${EXITCONTEXT} is set).t
T
w
automon key
sequence (as defined in features.conf). If
the TOUCH_MONITOR variable is set, its value is
passed to Monitor() as a parameter
when recording starts. If it is not set, WAV,,m is
passed to Monitor().W
automon key
sequence (as defined in
features.conf).f
f to overwrite the caller
ID provided by a SIP extension to that belonging to the outgoing
Zap channel on the PRI.o
o is set, Don will see
Joe's number on his display when Mary transfers him, instead of
Mary's number.r
r forces it to do so no matter the
circumstance. Sometimes called devices don't provide useful call
progress information (or none at all) and r is
needed; however, this can also lead to strange behavior, such as
initial ringing interrupted by a busy signal.m[class]
musiconhold.conf).M(x[^arg])
Runs the macro x when the call is answered, optionally
passing ^ (caret) separated arguments. The macro may set the
MACRO_RESULT channel variable to one of the following
values:
ABORT
CONGESTION
BUSY
n+101).CONTINUE
GOTO:<context>^<extension>^<priority>
h
H
C
P[(x)]
x is a family in the
AstDB. The Privacy Manager asks the caller to enter a 10 digit
telephone number if no caller ID is provided, providing a simple
way to screen for telemarketers and solicitors blocking their
caller ID. See also LookupBlacklist().g
G(context^extension^priority)
context,
extension and
priority when the call is
answered.A(x)
x is the sound file prefix. For
example, A(confirm) would play the most efficient version of
confirm (such as confirm.gsm, or
confirm.wav) that can be found in the
/var/lib/asterisk/sounds directory.D([called][:calling])
called digits are transmitted to
the called party, the calling digits to the calling
party. One or both parameters may be set.L(x[:y][:z])
Limits call duration to
milliseconds. At
x ms before the maximum
allowed duration, and thereafter every
y ms until the end of the
call, a warning is given. The zx must be
defined, y and
z are optional. The behavior can be
further controlled with the following variables:
LIMIT_PLAYAUDIO_CALLER=yes|no
LIMIT_PLAYAUDIO_CALLEE=yes|no
LIMIT_TIMEOUT_FILE=filename
LIMIT_CONNECT_FILE=filename
LIMIT_WARNING_FILE=filename
y is
set.j
Turns priority jumping on (i.e., the
call jumps to priority n+101 (where n
is the current priority) if all the channels respond
busy).
A call may be parked instead of transferred Ein Anruf
kann auch geparkt werden, statt übermittelt zu werden (was mit
t oder T-Flag der Fall ist). Anrufe
werden gewöhnlich geparkt, indem man sie der Extension 700
übermittelt, aber dieses Verhalten ist in
features.conf konfigurierbar.
Privacy Manager setting. Caller introductions are not to be saved in the priv-callerintros directory.
Privacy Manager setting. Calls are not screened if caller ID information is provided.
Mit dem Enden der Dial()-Anwendung werden die
folgenden Variablen gesetzt:
DIALEDTIME
Dial()-Anwendung an bis zu ihrer Beendigung
verstrichen ist.ANSWEREDTIME
DIALSTATUS
Der Status des Anrufs, ausgedrückt durch einen der folgenden Werte:
CHANUNAVAIL
CONGESTION
NOANSWER
BUSY
ANSWER
CANCEL
When Dial() completes, the following variables are set:
The total elapsed time from the time the Dial() command is executed until its completion.
The time elapsed during conversation.
The channel was not answered before the ring timeout had expired.
The called channel is currently busy.
The called channel was answered.
The call was interrupted before it could be completed.
; dial a number on Zap channel 2, let it ring a maximum of 10 seconds: exten => 123,1,Dial(Zap/2/1234567,10,tTm) ; otherwise proceed in the dialplan: exten => 123,n,Playback(sorry) exten => 123,n,Hangup() ; dial extension 500 over IAX on host widgets.biz: exten => 123,1,Dial(IAX/username:password@widgets.biz/500)
|
|
|
Internal help for this application in Asterisk 1.4: -= Info about application 'Dial' =-
[Synopsis]
Place a call and connect to the current channel
[Description]
Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL
]):
This application will place calls to one or more specified channels. As
soon
as one of the requested channels answers, the originating channel will b
e
answered, if it has not already been answered. These two channels will t
hen
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 executin
g will
continue if no requested channels can be called, or if the timeout expir
es.
This application sets the following channel variables upon completion:
DIALEDTIME - This is the time from dialing a channel until when it
is disconnected.
ANSWEREDTIME - This is the amount of time for actual call.
DIALSTATUS - This is the status of the call:
CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER |
CANCEL
DONTCALL | TORTURE
For the Privacy and Screening Modes, the DIALSTATUS variable will be s
et to
DONTCALL if the called party chooses to send the calling party to the 'G
o Away'
script. The DIALSTATUS variable will be set to TORTURE if the called par
ty
wants to send the caller to the 'torture' script.
This application will report normal termination if the originating cha
nnel
hangs up, or if the call is bridged and either of the parties in the bri
dge
ends the call.
The optional URL will be sent to the called party if the channel suppo
rts it.
If the OUTBOUND_GROUP variable is set, all peer channels created by th
is
application will be put into that group (as in Set(GROUP()=...).
Options:
A(x) - Play an announcement to the called party, using 'x' as the fi
le.
C - Reset the CDR for this call.
d - Allow the calling user to dial a 1 digit extension while wait
ing for
a call to be answered. Exit to that extension if it exists in
the
current context, or the context defined in the EXITCONTEXT va
riable,
if it exists.
D([called][:calling]) - Send the specified DTMF strings *after* the
called
party has answered, but before the call gets bridged. The 'ca
lled'
DTMF string is sent to the called party, and the 'calling' DT
MF
string is sent to the calling party. Both parameters can be u
sed
alone.
f - Force the callerid of the *calling* channel to be set as the
extension associated with the channel using a dialplan 'hint'
.
For example, some PSTNs do not allow CallerID to be set to an
ything
other than the number assigned to the caller.
g - Proceed with dialplan execution at the current extension if t
he
destination channel hangs up.
G(context^exten^pri) - If the call is answered, transfer the calling
party to
the specified priority and the called party to the specified
priority+1.
Optionally, an extension, or extension and context may be spe
cified.
Otherwise, the current extension is used. You cannot use any
additional
action post answer options in conjunction with this option.
h - Allow the called party to hang up by sending the '*' DTMF dig
it.
H - Allow the calling party to hang up by hitting the '*' DTMF di
git.
i - Asterisk will ignore any forwarding requests it may receive o
n this
dial attempt.
j - Jump to priority n+101 if all of the requested channels were
busy.
L(x[:y][:z]) - Limit the call to 'x' ms. Play a warning when 'y' ms
are
left. Repeat the warning every 'z' ms. The following special
variables can be used with this option:
* LIMIT_PLAYAUDIO_CALLER yes|no (default yes)
Play sounds to the caller.
* LIMIT_PLAYAUDIO_CALLEE yes|no
Play sounds to the callee.
* LIMIT_TIMEOUT_FILE File to play when time is up.
* LIMIT_CONNECT_FILE File to play when call begins.
* LIMIT_WARNING_FILE File to play as warning if 'y' is
defined.
The default is to say the time rem
aining.
m([class]) - Provide hold music to the calling party until a request
ed
channel answers. A specific MusicOnHold class can be
specified.
M(x[^arg]) - Execute the Macro for the *called* channel before conne
cting
to the calling channel. Arguments can be specified to the Mac
ro
using '^' as a delimeter. The Macro can set the variable
MACRO_RESULT to specify the following actions after the Macro
is
finished executing.
* ABORT Hangup both legs of the call.
* CONGESTION Behave as if line congestion was encountered.
* BUSY Behave as if a busy signal was encountered. Th
is will also
have the application jump to priority n+101 if
the
'j' option is set.
* CONTINUE Hangup the called party and allow the calling
party
to continue dialplan execution at the next pri
ority.
* GOTO:<context>^<xexten>^<priority> - Transfer the call to t
he
specified priority. Optionally, an extension,
or
extension and priority can be specified.
You cannot use any additional action post answer options in c
onjunction
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() fun
ction in this macro.
n - This option is a modifier for the screen/privacy mode. It spe
cifies
that no introductions are to be saved in the priv-callerintro
s
directory.
N - This option is a modifier for the screen/privacy mode. It spe
cifies
that if callerID is present, do not screen the call.
o - Specify that the CallerID that was present on the *calling* c
hannel
be set as the CallerID on the *called* channel. This was the
behavior of Asterisk 1.0 and earlier.
O([x]) - "Operator Services" mode (Zaptel channel to Zaptel channel
only, if specified on non-Zaptel interface, it will be igno
red).
When the destination answers (presumably an operator servic
es
station), the originator no longer has control of their lin
e.
They may hang up, but the switch will not release their lin
e
until the destination party hangs up (the operator). Specif
ied
without an arg, or with 1 as an arg, the originator hanging
up
will cause the phone to ring back immediately. With a 2 spe
cified,
when the "operator" flashes the trunk, it will ring their p
hone
back.
p - This option enables screening mode. This is basically Privacy
mode
without memory.
P([x]) - Enable privacy mode. Use 'x' as the family/key in the datab
ase if
it is provided. The current extension is used if a database
family/key is not specified.
r - Indicate ringing to the calling party. Pass no audio to the c
alling
party until the called channel has answered.
S(x) - Hang up the call after 'x' seconds *after* the called party h
as
answered the call.
t - Allow the called party to transfer the calling party by sendi
ng the
DTMF sequence defined in features.conf.
T - Allow the calling party to transfer the called party by sendi
ng the
DTMF sequence defined in features.conf.
w - Allow the called party to enable recording of the call by sen
ding
the DTMF sequence defined for one-touch recording in features
.conf.
W - Allow the calling party to enable recording of the call by se
nding
the DTMF sequence defined for one-touch recording in features
.conf.
k - Allow the called party to enable parking of the call by sendi
ng
the DTMF sequence defined for call parking in features.conf.
K - Allow the calling party to enable parking of the call by send
ing
the DTMF sequence defined for call parking in features.conf.
diff output to internal help in Asterisk 1.2: 62,63d61 < i - Asterisk will ignore any forwarding requests it may receive on this < dial attempt. 95,96c93 < with this option. Also, pbx services are not run on the pee r (called) channel, < so you will not be able to set timeouts via the TIMEOUT() f unction in this macro. --- > with this option. 105,114d101 < O([x]) - "Operator Services" mode (Zaptel channel to Zaptel channe l < only, if specified on non-Zaptel interface, it will be ig nored). < When the destination answers (presumably an operator serv ices < station), the originator no longer has control of their l ine. < They may hang up, but the switch will not release their l ine < until the destination party hangs up (the operator). Spec ified < without an arg, or with 1 as an arg, the originator hangi ng up < will cause the phone to ring back immediately. With a 2 s pecified, < when the "operator" flashes the trunk, it will ring their phone < back. 132,135d118 < k - Allow the called party to enable parking of the call by sen ding < the DTMF sequence defined for call parking in features.conf . < K - Allow the calling party to enable parking of the call by se nding < the DTMF sequence defined for call parking in features.conf . |
See also.
the section called “RetryDial()”