Monday, March 10, 2008

> Asterisk Manager API

Asterisk Manager API
Asterisk provides application programming interface (API) for its PBX system to further
manage overall performance and add feature functionality. Unlike the AGI, the
API is used to control functionality of a PBX system from remote external application
over a TCP/IP socket. API allows external programs to monitor call activity, build
remote extensions, and perform basic call controls such as hanging up channels and
transferring calls. Access to this socket API functionality is managed with the
manager.conf file inside the /etc/asterisk/ directory. Figure 2.1 displays an example of the
manager.conf file configured to allow sockets on TCP port 5038. As with every administrative
application, the firewall should restrict access to administration ports. Further
administrative restrictions to the administration port can be applied with deny and
permit syntax lines defined in the manager.conf file as shown in Figure 2.1.
Figure 2.1 manager.conf Configuration File
Dial Plans
Dial plans are key to the routing function of PBX systems; they control how
incoming and outgoing calls should be processed within the PBX. Dial plans consist
of a set of programmed rules defined by the administrator that directs PBX on how
to handle a specific call and its functions. When a call comes into the PBX system
from the analog line, digital line, or VoIP, the system determines its proper destination
based on extension number and dial plan properties.
Figure 2.2 illustrates the following example of a dial plan’s function. When an
employee with a 55xx extension inside the headquarters network dials a 7551 extension
to reach one of his associates in the remote branch office A, his first stop will be
PBX 1. PBX 1 receives this call and immediately looks up its Dial Plan procedures.
PBX 1 looks up directions on how to handle calls going into 7551 destination and
forwards it accordingly. PBX 2 will receive this call and go through a process similar
to that of PBX 1. It will look up its Dialer Plan, recognize the destination 7551 as
one of its own, and start the signaling/forwarding according to its final telephone
equipment destination. In this scenario, a dialer plan was used in both PBX systems
1 and 2 to determine the proper procedure for incoming and outgoing calls.
Dialer plans could combine multiple call procedures. What happens when a user
tries to dial 8551 extension in Branch B from the headquarters? Which path will the
call most likely take? Again as explained in the previous paragraph, PBX 1 will look
up its dialer plan upon receiving this call and search for 8551 destination procedures.
It is likely that there will be multiple defined procedures for this destination in PBX
1. A dial plan in this example could be configured to forward this specific voice call
via the IP-Internet as VoIP or it can forward this voice call through a Public
Switched Telephone Network (PSTN). Decision on forwarding a call over VoIP
versus PSTN could be made based on the time of day or based on call capacity.
During peak hours the dial plan procedures could indicate to forward this call using
VoIP data links in order to save the company money on the local telephone charges
that this call would cost. During off-hours when calls might be free of charge from
the telephone company, the business could choose to implement a procedure in their
dial plan to forward the call over PSTN. Further dial plan decisions could be made
based on priority of multiple defined paths.The dial plan can place priority on multiple
paths so that multiple paths can coexist, and when trunks for the preferred path
are full or otherwise unavailable, the calls can be sent on another path via another
trunk group.

Figure 2.2 Dial Plan Effect


Numbering Plans
Dial plans use the numbers entered by users to identify commands and perform
functions.The three most basic numbering plans that exist are the International
Numbering Plan (E.164), Country Numbering Plans, and Private Numbering Plans.
The E.164 International Numbering Plan allows telephone companies to route
calls across national borders. Standards developed by The International
Telecommunications Union–Telecommunication Standardization Committee
(ITU–T) must be closely followed and are accepted globally in the PSTN network
to achieve interoperability between systems. Figure 2.3 presents the format of
ITU–T recommended telephone numbers. Country Code (CC) represents one to
three digits of the country, National Destination Code (NDC) specifies the numbering
area within the country, and Subscriber Number (SN) defines the locally
assigned number within the area.
NOTE
Article E.164, which replaced E.163 in 1997, is an ITU–T statute that establishes
the international numbering plan used by public telecommunications. For more
information on ITU and its standards visit the www.itu.int Web site.
Figure 2.3 ITU–T Format for International Dial Plan over PSTN
Country Numbering Plans allows telephone companies to route calls nationally.
North America follows the North American Numbering Plan (NANP), which is
shared with other North American countries. Figure 2.4 represents the format of
NANP.The first three digits represent the area code within United States. Note that
the first number N can be any number between 2 and 9.The next three digits represent
location within an area code, and the last four digits is the actual number of
the end-user.
CC NDC SN
NPA - NXX - XXXX
Private Numbering Plans are used by organizations that create and use their own
dial plans, which is typical of PBX systems and networks made up of such systems.
Figure 2.2 is an example of a private dial plan being used on PBX systems. In Figure
2.2, employees use a four-digit number plan to reach associates in a different geographical
location rather then using the NANP nine-digit numbering plan. PBX
systems use their own private dialing plans, which will be our primary focus in this
section. A private dial plan differs from the public PSTN network in that it is a
homogeneous design maintained by private businesses.
Interconnecting an organization’s branches privately, rather than using public
telephone systems, allows the organization to simplify its telephone numbering plan
and overall communication between members of the organization.

No comments: