Skip to Content
Switching to VoIP
book

Switching to VoIP

by Theodore Wallingford
June 2005
Intermediate to advanced
502 pages
21h 48m
English
O'Reilly Media, Inc.
Content preview from Switching to VoIP
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
432
|
Chapter 17: Asterisk Reference
automatically remove extensions when customers’ bills are overdue in an external
billing system.
Consider the following line of Perl:
system("asterisk –r –x add extension $newExt,$newPri,$appl,$args into $context");
This Perl command launches Asterisk in client mode and runs the add extension CLI
command with an entirely dynamic extension definition—one that another part of
the Perl script establishes according to the programmer’s design.
In order to use the CLI wrapper from a CGI script, the web server run-
ning the script must have permission to execute Asterisk. Usually, this
means putting Asterisk and your web server in the same user group.
This could pose a potential security risk, so use this trick with care.
The Asterisk Gateway Interface
One of the most compelling ingredients in the Asterisk recipe, AGI gives developers
the ability to create custom interfaces between the dial-plan and outside systems.
The AGI is to Asterisk what CGI is to a web server. In a nutshell, it allows you to use
your favorite programming language—Perl, Python, Pascal, RealBASIC, whatever—
to affect or control interaction with a telephone user who’s attached to the PBX.
Here a few examples of things you can do with the AGI:
Show the caller ID of an incoming phone call ...
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

Voice over IP First-Step

Voice over IP First-Step

Kevin Wallace
Securing VoIP

Securing VoIP

Regis Jr (Bud) Bates
Low-cost Smart Antennas

Low-cost Smart Antennas

Qi Luo, Steven Shichang Gao, Chao Gu, Wei Liu

Publisher Resources

ISBN: 0596008686Catalog PageErrata