Page 411 - Asterisk™: The Future of Telephony
P. 411
options to Dial(), or you can refer to the name of a channel entry in the appropri-
ate .conf file; all the required information will then need to be obtained from that file.
The username and password can be replaced with the name contained within square
brackets ([]) of the channel configuration file. The hostname is optional.
This is a valid Dial statement:
exten => s,1,Dial(SIP/sake:arigato@thathostoverthere.tld)
This is effectively identical:
exten => s,1,Dial(SIP/some_SIP_friend)
but will work only if there is a channel defined in sip.conf as [some_SIP_friend], whose
channel definition contains fromuser=sake, password=arigato, and host=thathostover
there.tld.
An extension number is often attached after the address information, like this:
exten => s,1,Dial(IAX2/user:pass@otherend.com/500)
This asks the far end to connect the call to extension 500 in the context in which the
channel arrived. The extension is not required by Dial(), as the information in the
remote end’s channel configuration file may be used, or the remote server will pass the
call to the s extension in the context in which the call came in. Ultimately, the far end
controls what happens to the call; you can only request a specific treatment.
If no ring-timeout is specified, the channel will ring indefinitely. This is not always a
bad thing, so don’t feel you need to set it; just be aware that “indefinitely” could mean
a very long time. ring-timeout is specified in seconds. The ring timeout always follows
the addressing information, like this:
exten => s,1,Dial(IAX2/user:pass@otherend.com/500,ring-timeout)
Much of the power of the Dial() application is in the flags. These are assigned following
the addressing and timeout information, like this:
exten => s,1,Dial(IAX2/user:pass@otherend.com/500,60,flags)
If you don’t have a timeout specified, and you want to assign flags, you
must still assign a spot for the timeout. You do this by adding an extra
comma in the spot where the timeout would normally go, like this:
exten => s,1,Dial(IAX2/user:pass@otherend.com/500,,flags)
The valid flags that may be used with the Dial() application are:
A( x )
Plays an announcement to the called party; x is the filename of the sound file to
play as the announcement.
Dial() | 383