Name

Dial() — Attempts to connect channels

Synopsis

    Dial(tech/username:password@hostname/extension,ring-timeout,flags)

Allows you to connect together all of the various channel types.[98] Dial() is the most important application in Asterisk—you’ll want to read through this section a few times.

Any valid channel type (such as SIP, IAX2, H.323, MGCP, Local, or Zap) is acceptable to Dial(), but the parameters that need to be passed to each channel will depend on the information the channel type needs to do its job. For example, a SIP channel will need a network address and user to connect to, whereas a Zap channel is going to want some sort of phone number.

When you specify a channel type that is network-based, you can pass the destination host (name or IP address), username, password, and remote extension as part of the options to Dial(), or you can refer to the name of a channel entry in the appropriate .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=thathostoverthere.tld.

An extension ...

Get Asterisk: The Future of Telephony now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.