|
Linux PBX Pt 3
Asterisk is a flexible call automation system that can be configured for a wide variety of applications. The following description is excerpted from the Asterisk Handbook. For more details on configuring Asterisk, see the Asterisk web site.
|
|
By
Henry
Davis
|

Page 1 of 2

|
Audio DesignLine
(08/25/2006 6:28 AM EDT)
|

|
Running Asterisk is actually rather straight forward. Asterisk, if run
with no arguments, is launched as a daemon process. Often, it is
useful to execute Asterisk in a verbose, console mode, providing you
with useful debugging and state information, as well as access to the
powerful Asterisk command line interface.
Like most Linux applications, Asterisk has several command line
options. These are typically preceded by a "-", and several options
may be specified in a row after a single "-".
For example:
# asterisk -vvvgc
The above example is probably the most commonly used asterisk command line.
-c
Enables console mode. If console mode is enabled, Asterisk will
provide a command line that can be used to issue commands and
view the state of the system. Implies -f as well
-c
Executes Asterisk with a different configuration file.
-d
Enables extra debugging across all modules.
-f
Prevents Asterisk from daemonizing into the background.
-g
Forces Asterisk to dump core in the unlikely event of a segmentation
violation.
-h
Displays basic command line help.
-i
Forces Asterisk to prompt for cryptographic initialization passcodes
at startup.
-n
Disables ANSI color support.
-p
Run with a real-time priority.
-q
Run in quiet mode.
-r
Connects to an already running instance of Asterisk.
-v
Causes asterisk to produce more verbose output. More -v's mean
more verbose.
-x
Executes a command in Asterisk (when combined with -r)
The Asterisk command line is one of the most powerful interfaces for
obtaining status on a running Asterisk. Although a complete
description of all options is beyond the scope of this document, a
brief introduction is certainly in order. When running Asterisk with
the -r or -c flag, the user is provided with the Asterisk CLI prompt,
which looks, unimpressively, like this:
*CLI>
or
localhost*CLI>
In any case, once you are at the command line, you enter instructions
by typing them in and pressing enter. The Asterisk CLI includes
command completion, available by pressing the tab key. The most
obvious, and useful, command is help, which will show you a list of
all the Asterisk CLI commands you can enter:
*CLI> help
add extension Add new extension into context
.
.
.
zap show channel Show information on a channel
*CLI>
For more information about a specific command, you can type help . For example:
*CLI> help soft hangup
Usage: soft hangup
Request that a channel be hung up. The
hangup takes effect the next time the
driver reads or writes from the channel
*CLI>
This shows you that the soft hangup command takes an argument (a
channel name) and that it requests the channel be hungup. This
command can be used, for example, to hangup any active call in the
system.
A few more extremely useful commands:
iax debug: Enable IAX debugging
mgcp debug: Enable MGCP debugging
reload: Reload configuration files
restart when convenient: Restarts Asterisk when all calls are gone
show agi: Displays AGI commands
show applications: Shows all Asterisk apps
show application : Shows usage of a specific Asterik app
show channels: Shows all active channels
show channel : Shows information on a specific channel
sip debug: Enable SIP debugging
stop now: Stops Asterisk immediately
The most important part of understanding Asterisk is
understanding its dialplan. It is the dialplan which routes
every call in the system from its source through various
applications, to its final destination. Everything from voicemail, to
conferencing, to auto attendant voice menus is done through a
consistent concept and logic.
The dialplan is composed of one or more extension contexts. Each
extension context is itself simply a collection of extensions. Each
extension context in a dialplan has a unique name associated with it.
The use of contexts can be used to implement a number of important
features including:
Security Permit long distance calls from certain phones only
Routing Route calls based on extension
Autoattendant Greet callers and ask them to enter extensions
Multilevel menus Menus for sales, support, etc.
Authentication Ask for passwords for certain extensions
Callback Reduce long distance changes
Privacy Blacklist annoying callers from contacting you
PBX Multihosting Yes, you can have .virtual hosts. on your PBX
Daytime/Nighttime You can vary behavior after hours
Macros Create scripts for commonly used functions
The goal of this chapter is to familiarize you with the concepts behind
the dialplan, show some examples, and empower you with the
knowledge you need to perform neat tricks and impress friends,
coworkers, and competitors with your Asterisk-foo like a pro.
|
|
|
|
CAREER CENTER
|
Ready to take that job and shove it?
|
|
SPONSOR
|
|
|
|
RECENT JOB POSTINGS
|
|
|
For more great jobs, career related news, features and services, please visit EETimes' Career Center.
|
|