Address Translation
Address translations are used to translate between internal and external SIP URIs, and phone numbers. The translations are configured in the Configuration (Softdial Telephony Gateway™) file.
Changes are dynamic, i.e. a service restart is not required for changes to take effect.

When an address translation is used for CLI addresses of outbound calls, then optional attribute useSourceAsComparer can be used to specify whether pattern matching is done against
- the destination address of the call - useSourceAsComparer="false" (default)
- the source (CLI) of the call - useSourceAsComparer="true"
In both cases, the output translation is applied to the source address.
Example
A call is made from 381234 (source) to 07878123456 (destination).
If
- useSourceAsComparer="false" -
The CLI translation will look at the destination, e.g. "07*" to match mobile numbers, and then apply a translation to the source, e.g. to make it complete "+441296381234". - useSourceAsComparer="true" -
The CLI translation will look at the source - "381234" - and if it matches, apply a transformation to the source, e.g. translating "3?12*" to "+4412963?12*".

The dnis attribute is optional and provides a secondary pattern match. If used, both the primary CLI pattern and the secondary DNIS pattern must be matched for the CLI translation rule as a whole to match and be applied. It can be used for
- outbound destination address translations
- inbound CLI translations
See Example 5 below
The following examples explain how address translation in STG is done.
Please familiarise yourself with these examples before attempting to write your own address translations.


This directly translates br183 to sip:br183@192.168.53.183:65000
<translate address="br183" translated="sip:br183@192.168.53.183:65000"/>

This takes everything from the incoming string and places it where * is in the translated string:
<translate address="*" translated="sip:*@sip.gradwell.net"/>
Using the above translation:
Original | Translated |
---|---|
01296381200 | sip:01296381200@sip.gradwell.net |

This takes everything after 0 on the incoming string and places it where * is in the translated string:
<translate address="0*" translated="sip:0*@sip.gradwell.net"/>
Using the above translation:
Original | Translated |
---|---|
0711111111 | sip:0711111111@sip.gradwell.net |

This takes the data contained after sip: and before @, copies it and places it between sip: and @sip.gradwell.net:
<translate address="^sip:(?'address'.*\d)@.*$" translated="sip:${address}@sip.gradwell.net" isRegularExpression="true" />
Using the above translation:
Original | Translated |
---|---|
sip:12345@10.1.1.1 | sip:12345@sip.gradwell.net |

For all inbound calls, if the DNIS begins with sip:6469374@, the CLI will be prefixed with 09018.
If a DNIS check is not required, simply omit the DNIS parameter.
<translate address="sip:*" translated="sip:09018*" dnis="sip:6469374@*" />
Using the above translation:
Original | Translated |
---|---|
sip:12345@10.1.1.1 | sip:0901812345@10.1.1.1 |

Incoming address strings are compared in the order the translations are listed. The first address translation that matches the incoming address string is the translation which is used.
For example, consider the address translations:
<translate address="sip:07*" translated="07*"/>
<translate address="sip:0*" translated="0*"/>
Using the above translations:
Original | Translation used | Translated |
---|---|---|
sip:0711111111 | first (not the second, despite the match) | 0711111111 |
sip:01234111111 | second | 01234111111 |

Q1: We use a * translation rule to send all outbound calls to the SIP load balancer, e.g.
<translate address="*" translated="sip:*@192.168.1.175"/>
If incoming calls are passed through address translation, will incoming calls then be rerouted back out to the SIP load balancer rather than being passed to the Softdial CallGem™ processing engine?
The short answer here is No.
The generation of an InboundConnect [IC] message to the dialler (and associated logic) is controlled by the handler that has been associated with the inbound route in the following section of the STG config.xml :-
<inboundRoutes>
<inboundRoute name="FromSIP">
<!-- Either a call arriving here uses the "Internal" handler which forwards it on, or the "Dialer" handler which notifies Softdial CallGem™ that there is a call for it to handle -->
<handler>Dialer</handler>
<!-- call profile used by this route -->
<ipCallProfile>Customers</ipCallProfile>
<!-- strip sip address parts from SRC (1), DST (2) or both (3) numbers (sip:1111@10.0.0.1 would become 1111) -->
<stripSipAddress>0</stripSipAddress>
</inboundRoute>
</inboundRoutes>
Different incoming calls can be sent either to Softdial CallGem™ or proxied through STG by using ingress routing. See Configuration (Softdial Telephony Gateway™) - Ingress routes section
The translateBeforeIC setting is only applied when the route selected is Dialer. See Configuration (Softdial Telephony Gateway™) - Translations section