|
|
Want to know more about Packt's Article Network? Interested in contributing your article ideas? Please visit our FAQ for more information. See More See More |
Routing Rules in AsteriskNOW - The Calling Rules Tables
An interesting feature of a PBX is the ability to support multiple dial plans, meaning that you are able to create various dial-plan logics, associate different calling rules to each dial plan, and assign users to specific dial plan. Schematically speaking, the relation between the three can be illustrated as follows:
Essentially, from AsteriskNOW's point of view, any dial attempt that doesn't match a Calling Rule will be considered an internal call, and thus, AsteriskNOW will try to route the call to an internal AsteriskNOW resource—e.g. another extension or an AsteriskNOW feature code. Most telephony engineers and carrier support engineers refer to "Calling Rules" as "Routing Rules". From this point onwards in the book "Calling Rules" will be referred to as "Routing Rules". Managing Routing Rules with AsteriskNOWAt this point, after initially configuring your service providers and initial routing rules, your "Routing Rules" table should look as follows:
Edit one of these rules to get acquainted with the call rule dialog box. Click the Edit link of the all_outbound rule (rule 1). The following dialog box should appear on your screen:
Every call made from an IP phone connected to the PBX is processed by the routing rules. The processing is performed in the following order:
The above process happens for every call that is made by a phone connected to the PBX. If the process fails all the rules defined in the Routing Table, AsteriskNOW assumes that the call is supposed to be routed internally. If internal routing fails, the call will fail and a fast-busy tone will be heard from your IP phone. Some IP phones also indicate the SIP error message that was received. If routing fails, the normal error that you may encounter would be error 404 – NOT FOUND. Manually Editing Dial-Plan LogicAdditional information about Asterisk configuration files Manually editing AsteriskNOW dial-plan files isn't recommended; however, in some extreme situations it can't be avoided (especially while creating special applications with AsteriskNOW). For this specific reason, AsteriskNOW includes a facility to edit the configuration files manually. Click the File Editor menu option; the following screen should appear:
The extensions.conf file should interest you. Using the drop-down file selector, select the extensions.conf file for editing. The following screen should be observed:
Now, if you were to click one of the lightly-shaded areas (light green on your screen); a text editing box will open to enable you to edit the file.
You're probably wondering at this point—"where is routing logic located?" Scroll down the file and seek the section designated as numberplan-custom-1, which designates your DialPlan1 dial plan. If you were to create an additional dial plan using the GUI, its designation in the extensions.conf file would be numberplan-custom-2. Examine the following section:
In the above section lines indicated by the exten directive, indicate a dial-plan activity. The exten directive is then followed by some form of well formatted number string, followed by a number indicating the sequence number of the directive, then followed by an Asterisk operational command—in our case, the Macro command. Asterisk and AsteriskNOW include over 150 different applications; explanation of each and every application is beyond the scope of this book. Visit the Asterisk Wiki page at http://www.voip-info.org/wiki/index.php?page=Asterisk for more information about Asterisk and AsteriskNOW applications. The way the dial plan analyzes dialed numbers is explained next. Consider one of the dialing rules: exten=_9XXX!,1,Macro(trunkdial,${trunk_1}/${EXTEN:1})The interesting portion of this line is the _9XXX!. The following is an extract from an Asterisk documentation: ; Extension names may be numbers, letters, or combinations As this text suggest, the underscore marking (_) indicates the start of a pattern matching rule. This is then followed by a form of expression indicating the pattern to match. In the example, the pattern match is _9XXX!, so, interpreting this according to the documentation:
For example, in accordance to the above points, the number 912345 will match the rule indicated above and will simply activate the Macro application. However, bearing in mind that the routing requires at least 3 digits to follow the prefix, the number 912 will not match our above routing rule. At this point, the working of the Macro application is not explained; however, the empirical knowledge of its existence is enough. SummaryIn this article you learned what routing rules are and how they are processed within the AsteriskNOW operational model. Understanding the way routing rules work is imperative to configure your PBX for optimal usage of outbound connections.
About the AuthorNir Simionovich has been involved with the open-source community in Israel since 1997. His involvement with the open-source community started back in 1997, when he was a student in the Technion, Israel's Technology Institute in Haifa. Nir quickly became involved in organizing open-source events and promoting usage of Linux and open‑source technologies in Israel. In 1998, Nir started working for an IT consulting company (artNET experts Ltd.), where he introduced Linux-based solutions for enterprises and banks. By 2000, Nir had become a SAIR/GNU-certified Linux trainer and Administrator, slowly educating the future generations of Linux admins. In 2001, Nir moved to the cellular content market, working for a mobile content delivery company (m-Wise Inc.—OTC.BB: MWIS.OB). During his commission atm-Wise, Nir successfully migrated a company that was built purely on Windows 2000 and ColdFusion to open-source technologies, such as Mandrake Linux (today Mandriva), Apache Tomcat, and Kannel (open-source SMS/WAP gateway). By 2006, Nir had co-founded Atelis (Atelis PLC—AIM: ATEL). Atelis is a Digium distributor and integrator. During the course of 2006, Nir developed an Asterisk‑based international operator services platform for Bezeq International, which had replaced a Nortel DMS-300 switch. This platform is currently in use by Bezeq International in Israel, serving over 4000 customers a day. In mid 2007, Nir left Atelis to become a freelance Asterisk promoter and consultant. Nir currently provides Asterisk consulting and development services to various companies, ranging from early-stage start-up companies, through VoIP service providers and VoIP equipment vendors. In his spare time, Nir is the founder of the Israeli Asterisk users group, the website maintainer of the group and an Asterisk developer, dealing mainly with the localization aspects of Asterisk to Israel. Nir can be reached at nirs@greenfieldtech.net or through his website http://www.greenfieldtech.net. Books from Packt
|
|
| ||||||