
Appendix
A
:
Important
funktionen
indexterm
Applications in the dialplan
This section is a comprehensive description of the applications available for use in the dialplan
(
/etc/asterisk/extensions.conf
). To use an application, the module to which it belongs must be
loaded; this is configured in the
[modules]
section of
/etc/asterisk/modules.conf
w
ith autoload=yes
or explicitly with
load => app_
applicationname
.so
. You can see which modules and applications are
available in Asterisk with by entering
show applications
or
show application
application_name
(Asterisk 1.2) and
core show applications
oder
core show application
application_name
(Asterisk
1.4).
Take care not to confuse
applications
or
commands
with
functions
. When required, functions are called
within commands in the dialplan. "Application" is perhaps too expansive a term but it is the convention
in Asterisk when referring to dialplan commands.
A brief aside: the configuration files in Asterisk use the obtuse INI format (which may be familiar to
you if you have worked with a certain, widely−distributed operating system). No grammatical standard
was ever publicly released for INI, and the parser does not follow generally accepted conventions for
tokenizing and lexical and syntactical analysis. This is why the Asterisk fork project,
OpenPBX
, has
elected to switch over to the "property list" (
.plist
) format used in MacOS X for which the standards
are publicly available.
Hence: because of the lack of a formal specification, the expected syntax is not always clear − for
example, where spaces would be allowed or whether double quotes are required or not. In many
cases, multiple conventions are accepted. When in doubt, only experimentation will let you know for
certain. Should you identify errors, we ask that you contact us so that we may include the new
information in future editions.
It is often possible to omit parameters entirely. In those cases, it is still necessary to include the
comma delimiter to establish that a parameter is empty or not provided (
i.e.
that the default value
should be used). For example:
exten => s,1,Dial(IAX2/User:password@example.com/123,,tT)
In general, if an application exits with an error it will return −1, if successful it returns a 0. A return
value of −1 means that Asterisk will hang up the channel without passing it along the dialplan.
Be sure to separate parameters with the
","
(comma) or "
|"
(pipe) depending on the
version of Asterisk. In this book we use the "
,"
primarily.
Anyone who has used Asterisk for some time already might wonder why one or another application is
not included here. The missing applications have been deprecated in Asterisk 1.2 and have ceased to
exist altogether in Asterisk 1.4. The corresponding functions which replace them can be found in
. The
diff
output of the built−in help files provided is always shown from the newer 1.4 to
the older 1.2.
In the examples the arbitrarily chosen extension 123 and priority 1 are used, just for the purposes of
illustration.
priority jumping
Before Asterisk 1.2, many applications jumped to priority
n
+101, if present, in
case of an error (where
n
is the current priority). This old behavior (called "priority jumping") can be
re−enabled with the option
j
(jump) for some commands or globally via the parameter
priorityjumping=yes
in the
[general]
section of
extensions.conf
. This method, however, is now
评论5