1.4.1 Dialed number processing
The original dialed number coming in the call from a client is first transformed according to the dialing rules defined for the client account. The purpose of the dialing rules is to modify the number before it is passed to the routing plan where an appropriate route for the call is to be found. You may want a particular client to use a premium route, different than the other clients. In order to do so add a prefix for example PREM to the routing plan and choose the premium termination carrier for this route.
In the client account panel, in the Dialing rules field put PREM which will cause that the PREM prefix will be added to the dialed number coming from that client. Instead of entering the relevant string rule directly you can instead click on the menu button next to the field and use the dialog window. In the Prefix field there put just PREM. The rules are stored in the tech_prefix column in the client table.
In addition, if your client sends calls with 00 or + in front of the dialed number you should remove these prefixes to get the dialed number in E164 format first and then add our special prefix PREM.
The following rule will strip the + or 00 from the number and replace with PREM.
+->PREM OR 00->PREM
The dialed number version 2, after first transformation, is then sent to the routing plan procedure which finds the best matching route.
In the routing plan the dialing rules can be configured per route (i.e. the routing plan’s entry). In its edit panel, in Advanced tab, there is the Dialing rules field. The modifications to the dialed number done here will be passed to the destination object where the number is processed for the last time before it is sent to the destination endpoint. In our example you should get rid of the PREM string from the number as it is no longer needed (the routing has been already chosen). To do so put the PREM-> string rule in the Dialing rule field.
In the destination definition, only if it is a gateway or registrar type, there is another dialing rules field. Here you should add any modification required by the specific carrier. For example some of them need a special prefix to be added before the dialed number. It is sometimes used for billing purposes. Whatever the prefix is, for example 3333, to add it just put the string into the Dialing rules field.
