O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required