Address translations are configured in the STG config.xml file. Changes are dynamic, i.e. a service restart is not required for changes to take effect.
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 is equal to 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*" useSourceAsComparer="false" 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 Inbound Connect [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 STG Configuration - Ingress routes section
The translateBeforeIC setting is only applied when the route selected is Dialer. See STG Configuration - Translations section