Source Dial String Rewriting

Introduction with a practical example (routing depending on user status)

[00:00 Video Time-Code]​

Welcome to another edition of anynode video tutorial serials. We invite you to sit back and watch as we show you how to use a specific destination number to change the source phone number.

Dial String Rewriting_CLIP no screening

In our following application example, we want to give employees of a company the opportunity to distinguish between each call, whether they want to send their extension or alternatively the main number or even a service number when making a call out to the provider.

In our example, we would like to replace the phone number +49 895 678 10 with a new source phone number. We would like the service number of our company to be taken as the originating number if the caller dials a 99 before its actual destination.

Source Dial String Rewriting

We have already prepared a configuration with a VoIP provider and a PBX. We recommend that you view the tutorial video “Basics Dial String Manipulation and Routing” as a starting point in order to get familiar with this topic. In this video, we will show you how to manipulate the source and destination fields. This usually should be done in the incoming and outgoing manipulations in the SIP node.

Source Dial String Rewriting_02_Dial String Manipulations

Route assistant: define route filter

[01:53 Video Time-Code]

Here we would like to change the source number based on the destination number and such a cross manipulation is only possible in the route.

Source Dial String Rewriting_03_Routing Domain

For this purpose, we create a new route in the routing domain, which should only be taken if the caller selects a 99. If no 99 is dialed at the beginning of the number, the previous routes should be taken without changing the source number.
With “Add” we start the Route Assistant. First, we set a route filter. The source node should be the PBX dialed by the caller with the 99.

Source Dial String Rewriting_04_Source Nodes PBX
Source Dial String Rewriting_05_Prefix99

We enter the 99 under “Destination Dial String” as a prefix route filter. With “Finish” we can then switch to the establishment, so which action should be carried out in the route.

Source Dial String Rewriting_06_Establishment Route Call

In our case, we want the call to be routed to the provider. Therefore, we choose the VoIP provider as the destination node.

Source Dial String Rewriting_07_Destination Node

Route assistant: define establishment

[02:32 Video Time-Code]​

Now it is important to create a new routing forward profile because we need to change a default value in the forwarding profile for this routing decision afterward so that the source manipulation takes effect.

Source Dial String Rewriting_08_Create new Routing Forward Profile

Now we add a Source Dial String Rewriting.

Source Dial String Rewriting_09_Rewriting Source

The source dial string should serve as a source for the rewriting. In our example, we would like to change the entire Source Dial string.

Source Dial String Rewriting_10_Rewriting Source Part

For “Delete Leading Characters”, we enter 20 to be sure that the entire number will be deleted. Alternatively, you can also keep parts of the phone number here.

Source Dial String Rewriting_11_Delete Charcters

Now we add the new number to be sent when using the 99 prefix.

Source Dial String Rewriting_12_Keep Characters
Source Dial String Rewriting_13_Add Prefix
Source Dial String Rewriting_14_Rewriting Segments

With “Destination Dial String Rewriting” we must not forget to remove the pre-dialed 99again so that the call can be forwarded by the provider.

Source Dial String Rewriting_15_Rewriting Source

Here we select the Destination Dial String as the source for the rewriting and this should also affect the entire dial string.

Source Dial String Rewriting_16_Rewriting Source Part

For “Delete Leading Characters” we enter 2so that the first two digits of the number, which are the 99, are deleted.

Source Dial String Rewriting_17_Delete Characters

Now we can click on “Finish” and give a name for this routing decision.

Source Dial String Rewriting_18_Destination Dial String Rewriting

Edit route table

[05:06 Video Time-Code]​

Since the route table is processed from top to bottom, we must necessarily set this route filter upwards so that no other route decision takes effect.

Source Dial String Rewriting_19_Routing Domain

Edit telephony forwarding

[05:38 Video Time-Code]​

Then we have to change the previously mentioned default value. Under “Telephony Forwarding” we find the default value for “Specify the changes of dial strings should be forwarded”.

Source Dial String Rewriting_20_Telephony Forwarding

The default value here is “Yes”. In order to avoid overwriting our manipulation in the routing by the automatic setting in the Routing Forward Profile, we need to use “No” here.

Source Dial String Rewriting_21_Specify changes of Dial Strings

Call test in monitor mode

[06:36 Video Time-Code]​

A look under the hood of anynode shows us the signal processes. The SIP message arrives here with an Invite and it’s taking the shortest possible route with the default Routing Forward Profile setting and the Source Dial String Rewriting is overwritten again. By switching off the default value, the source manipulation takes effect.

Source Dial String Rewriting_22_Dialstring Diagram

We are now testing the result in monitor mode. The easiest way is to use the call history and double-click on the already ended test call. Under “Source Number” we can see that the source number has changed to the desired number using the prefix 99 and also the correct route has been taken.

Source Dial String Rewriting_23_Call History
SCROLL UP