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

Call Files

Call files allow you to create calls through the Linux shell. These powerful events are triggered by depositing a .call file in the directory /var/spool/asterisk/outgoing/. The actual name of the file does not matter, but it’s good form to give the file a meaningful name and to end the filename with .call.

The Flash Operator Panel management interface

Figure 10-1. The Flash Operator Panel management interface

When a call file appears in the outgoing folder, Asterisk will almost immediately[81] act on the instructions contained therein.

Call files are formatted in the following manner. First, we define where we want to call:

    Channel: <channel>

We can control how long to wait for a call to be answered (the default is 45 seconds), how long to wait between call retries, and the maximum number of retries. If MaxRetries is omitted, the call will be attempted only once:

    WaitTime: <number>
    RetryTime: <number>
    MaxRetries: <number>

If the call is answered, we specify where to connect it here:

    Context: <context-name>
    Extension: <ext>
    Priority: <priority>

Alternatively, we can specify a single application and pass arguments to it:

    Application: Playback()
    Data: hello-world

Next, we set the Caller*ID of the outgoing call:

    CallerID: Asterisk <800-555-1212>

Then we set channel variables, as follows:

    SetVar: john=Zap/1/5551212
    SetVar: sally=SIP/1000

and add a CDR account code:

    Account: documentation

Warning

When you create a call file, do not ...

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