Skip to main content

Route

Routes define what Trunk Group to use when a certain Pattern is dialed.

Adding a Route

1) Enter the CLI's configuration mode

2) Enter a name for the new Route. You will then be prompted to enter the minimum options needed to create the new route. 

vbox-nathan(config)# route      ### use tab to get an available list of routes if you are unsure
ld11_reg local    ld10     ld11     intl     ld10_reg emerg
vbox-nathan(config)# route A_Route
!! Notice: Editing new item: A_Route
!! Notice: Minimum requirements needed for insert:
!!   pattern                    ### see next step
!!   trunk_group
!!   desc
vbox-nathan(config-route A_Route)# desc "Local and Long Distance Numbers +9"
vbox-nathan(config-route A_Route)# trunk_group  ### use tab to get a list of the trunks you have made 
pbx-sip-t1 default
vbox-nathan(config-route A_Route)# trunk_group pbx-sip-t1

3) Next enter a Pattern for the route. The Pattern represents the combination of numbers that the Trunk Group will use when making a call. In many cases, there will be multiple routes to define multiple types of patterns. Below is an example of what default Routes look like on a freshly installed system.

--------------------------------------------------------------------------------------------------------------------------------------
|  Route     |  Desc.                               |  Trunk Group  |  Pattern       |  Replace  |  Remove  |  Prepend  |  Postpend  |
--------------------------------------------------------------------------------------------------------------------------------------
|  ld11_reg  |  Long Distance 11 Digit without a 9  |  pbx-sip-t1   |  1XXXXXXXXXX   |           |          |           |            |
|  intl      |  International                       |  pbx-sip-t1   |  9011X.        |           |  +1      |           |            |
|  ld11      |  Long Distance 11 Digit              |  pbx-sip-t1   |  91NXXXXXXXXX  |           |  +1      |           |            |
|  emerg     |  Emergency                           |  pbx-sip-t1   |  9911          |           |  +1      |           |            |
|  ld10      |  Long Distance 10 Digit              |  pbx-sip-t1   | 9NXXXXXXXXX    |           |  +1      |  1        |            |
|  local     |  Local 7 Digit                       |  pbx-sip-t1   |  9XXXXXXX      |           |  +1      |           |            |
|  ld10_reg  |  Long Distance 11 Digit without a 9  |  pbx-sip-t1   |  XXXXXXXXXX    |           |          |  1        |            |
--------------------------------------------------------------------------------------------------------------------------------------

Pattern

As you can see above patterns are not limited to just numbers only, but rather can include specific characters to broaden or narrow down the range of types of calls that the routes will take. You are able to use the following characters to help further define a route that is to be taken:

  • X matches any digit from 0-9
  • Z matches any digit from 1-9
  • N matches any digit from 2-9
  • [1237-9] matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
  • . wildcard, matches one or more characters
  • ! wildcard, matches zero or more characters immediately
  • [a-z] matches any lowercase letter (not frequently used/recommended) 
  • [A-Z] matches any UPPER case letter (not frequently used/recommended) 

Replace (processed first)

The replace function will replace a pattern of numbers completely with the defined number included in the replace function. 

  • Example: The number 518-268-3769 matches the pattern of a route with a replace function set to 5000. Instead of using the 518 number it uses the 5000 number instead plus any of the other functions listed thereafter (such as remove, prepend or postpend)

Remove (processed second)

The remove function will remove numbers from the beginning or end of a pattern depending on how it is configured. For example, a +1, will remove the first digit from a number pattern, whereas -3 would remove the last 3 from a pattern. 

  • Example 1: If the number "518-268-3769" matches the pattern of a Route with a remove of "+1", it will remove the first number ("5") leaving "18-268-3769" (just an example, obviously this is an invalid number unless it were an internal extension).
  • Example 2: If the same number as above matches the Pattern of a Route with a remove of "-3". It will remove the last numbers in the sequence leaving the number "5182683" to be dialed (again just an example).

Prepend (processed third)

Prepend will add a specific string of numbers depending on what numbers are defined. In the default routes above, many of the numbers are prepended with a 1 to make them valid long-distance phone numbers that can be used on the PSTN (public switched telephone network).

  • Example 1: The number "518-268-3769" matches a route with a prepend of 1, so it will add the number 1 in front, making the actual number used by the trunk handler "1-518-268-3769".
  • Example 2: The number "268-3769" matches a route with a prepend of 518, so it will add the numbers "518" in front of the original number so the actual number being used by the trunk handler would be 518-268-3769.

Postpend (processed last)

Postpend is the exact opposite of prepend, instead of adding numbers to the beginning of a pattern, it will add numbers to an end of a pattern.

  • Example: The number "518-268" matches a route with a postpend of "3769", it will add the number "3769" to the end of the original number making the actual number dialed out to the trunk handler "518-268-3769".

By using a mix of the above settings, you can dial in highly specific routes meant to send specific calls to certain places. In the example below, we are going to use this route as a means of calling a long-distance number when someone is using a 9 dial-out number. 

vbox-nathan(config-route A_Route)# pattern 9NXXXXXXXXX
vbox-nathan(config-route A_Route)# mangle_remove +1
vbox-nathan(config-route A_Route)# mangle_prepend 1

4) Lastly use the show command to ensure your settings have been saved.

vbox-nathan(config-route A_Route)# show
! Generating running-config
!!
 
! -------------- Routes ----------------
route A_Route
  callerid passthrough
  desc "Local and Long Distance Numbers +9"
  mangle_prepend 1
  mangle_remove +1
  pattern 9NXXXXXXXXX
  record inherit
  trunk_group pbx-sip-t1
  exit
 
exit

Route Settings Description

You can also use the "?" key to view the description while in the CLI.  * indicates a required setting.

Setting
Comments
callerid Callerid option for when this route is utilized.
desc (*) Non-functional description of this route.
do

To run exec commands in config mode

exit

Exit from this level (with notification of incomplete config)

mangle_postpend Number Mangle: Add digits to the end of the dialed destination.  This option is processed third.
mangle_prepend

Number Mangle: Add digits to the beginning of the dialed destination. This option is processed second.

mangle_remove Number Mangle: Remove digits from the dialed destination. This option is processed first.
mange_replace Number Mangle: Replace the dialed destination with this.  (Enabling this option will override all other number-mangling options)
no

Clear settings

override_callerid_name Callerid name to force, if this route is utilized.
override_callerid_number

Callerid number to force, if this route is utilized.

pattern (*) Pattern to match dialed destination against that will activate this route.
record Call recording option for when this route is utilized.
show

Show the running-config for the current item

trunk_group  (*) The trunk group that this route will use to dial out.