Skip to Content
Asterisk: The Future of Telephony, 2nd Edition
book

Asterisk: The Future of Telephony, 2nd Edition

by Jim Van Meggelen, Jared Smith, Leif Madsen
August 2007
Intermediate to advanced
608 pages
20h 33m
English
O'Reilly Media, Inc.
Content preview from Asterisk: The Future of Telephony, 2nd Edition

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.

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

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 do so from the spool directory. Asterisk monitors the spool aggressively and will try to grab your file before you’ve even finished writing it! Create call files in some other folder, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Asterisk: The Future of Telephony

Asterisk: The Future of Telephony

Jim Van Meggelen, Jared Smith, Leif Madsen
Switching to VoIP

Switching to VoIP

Theodore Wallingford

Publisher Resources

ISBN: 9780596510480Errata Page