Commit 627eec59 authored by Etienne Allovon's avatar Etienne Allovon

Add examples to the Dialed Number Transformation section

parent 282d877e
......@@ -13,37 +13,64 @@ An outgoing call is composed with a **definition** of a outgoing route (the exte
:scale: 80%
Definition
----------
==========
A route can define
* **Priority**: A number that will prioritize a route compare to another one, if both routes are available for a same matching extension.
* **Call Pattern**:
* :guilabel:`Priority`: A number that will prioritize a route compare to another one, if both routes are available for a same matching extension.
* :guilabel:`Call Pattern`:
* **Extension**: The pattern that will match an extension. More details on `the Asterisk wiki <https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching>`_.
* (advanced) **RegExp**: Transformation to apply on the extension once route is found.
* (advanced) **Target**: Allow to perform filtering like stripping number based on transformation Regexp.
* (advanced) **Caller ID**: Override the presented number once call is performed.
* :guilabel:`Extension`: The pattern that will match an extension. More details on `the Asterisk wiki <https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching>`_.
* (advanced) :guilabel:`RegExp`: A pattern that will match the dialed number - see :ref:`outgoing_calls-dialednumxform` below.
* (advanced) :guilabel:`Target`: The transformation to apply to the dialed number - see :ref:`outgoing_calls-dialednumxform` below.
* (advanced) :guilabel:`Caller ID`: Override the presented number once call is performed.
* **Media server**: define the route only for specific media server.
* **Context**: define the route only for specific context.
* **Internal**: set the route to forward the internal caller鈥檚 caller ID to the trunk. This option is useful when the other side of the trunk can reach the user with it鈥檚 caller ID number.
* :guilabel:`Internal`: set the route to forward the internal caller鈥檚 caller ID to the trunk. This option is useful when the other side of the trunk can reach the user with it鈥檚 caller ID number.
* :guilabel:`Media server`: define the route only for specific media server.
* :guilabel:`Context`: define the route only for specific context.
Here some examples of how you can take advantage of **RegExp** and **Target**:
.. _outgoing_calls-dialednumxform:
Dialed Number Transformation
============================
The fields :guilabel:`RegExp` and :guilabel:`Target` can be used to change the dialed number before it is sent via the trunk defined in the *Route*.
Basically one uses:
* the :guilabel:`RegExp` field to define a pattern that will match the dialed number
* and the :guilabel:`Target` field to define how to transform the dialed number
Below are some examples of how you can take advantage of **RegExp** and **Target**:
Add or Remove Prefix
--------------------
========== ======== =======================================================================================================================
Regexp Target Result
========== ======== =======================================================================================================================
0(.*) \\1 Delete prefix 0 from dialed number and keep the rest (e.g. 00123456789 鈫 0123456789)
14(.*).. \\1 Delete prefix 14 and last two digits from dialed number and keep the rest (e.g. 1455660 鈫 556)
.{1}(.*) \\1 Delete leading digit from dialed number and keep the rest (e.g. 03601 鈫 3601)
+33(.*) 0\\1 Replcae leading +33 with 0 from dialed number and keep the rest (e.g. +33123456789 鈫 0123456789)
0(.*) +33\\1 Replace leading 0 with +33 from dialed number with 33 (e.g. 0123456789 鈫 +33123456789)
14(.*).. 33\\18 Delete prefix 14 and last two digits, and then prefix the dialed number with 33 and suffix it with 8 (1455660 鈫 335568)
========== ======== =======================================================================================================================
Change the Number
-----------------
========== ======== ======================================================================================================================
Regexp Target Result
========== ======== ======================================================================================================================
(.*) \\1 get whole called number
(.*) 445 Replace called number with 445 number
14(.*) \\1 Delete 14 prefix and keep only following part
14(.*).. \\1 Delete 14 prefix and last two digits and keep the rest (e.g. 1455660 鈫 556)
(.*) 33\\18 Prefix the called number with 33 and suffix it with 8
14(.*).. 33\\18 Delete 14 prefix and last two digits and then prefix the called number with 33 and suffix it with 8 (1455660 鈫 335568)
(.*) \\1 Get whole called number (e.g. 0123456789 鈫 0123456789)
(.*) 445 Replace called number with 445 number (e.g. 0123456789 鈫 445)
========== ======== ======================================================================================================================
Destination
-----------
===========
Once route is defined and therefore can be selected if an extension match the route, you need to set the wanted destination.
A route destination is materialized by:
......@@ -53,7 +80,7 @@ A route destination is materialized by:
Rights and schedules
--------------------
====================
A route can define **rights** aka call permissions, it means that a call can be discarded if missing the right to use this route.
The same applies for **schedules** where you can define time slots of availability of the route.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment