This topic was specifically written to describe how Route Configuration can be used with multiple gateways (gateway clusters) but the information is also applicable to single gateways with multiple routes configured.
In a multiple gateway configuration, the only difference is that each route configured in the STG config.xmlfile will map directly to a specific gateway.
<route name="IPDialout">
<targetPortGroups>
<portGroup>TRUNKS</portGroup>
</targetPortGroups>
<acceptList>
<item>sip:</item>
</acceptList>
<presentation>
<orig_numbering_presentation>0</orig_numbering_presentation>
<originating_addr>IpDialout1</originating_addr>
</presentation>
<ipCallProfile>Agents</ipCallProfile>
<priority>1</priority>
<congestionThreshold>1</congestionThreshold>
<postfix>IpDialout1</postfix>
</route>
From V10.6.52 - the elements priority and congestionThreshold have been added to config.xml in the STG installer.
The priority value indicates the priority that STG will distribute calls to the routes.
For example, given two routes (R1 and R2), if R1 has priority 1 and R2 has priority 3, STG will first try to launch calls through R1 and then through R2 provided that all of the other route criteria have been met (i.e. call is in acceptList, call is not in rejectList, route is valid for the current time and date, etc).
Two routes are allowed to have the same priority.
If a route is given priority 0, (which is the default priority), it is the only route that will be used for any valid calls.
The congestionThreshold is used by STG to determine how many calls must be congested on a route before that route is put "out of service" for a period of 10 seconds to allow the route to decongest. Default value is 5.
Currently a call is deemed to have failed on account of congestion if one of the following clearing causes has been received from the network:
A postfix can be applied to each individual route to direct calls passing through it to a specific gateway.
For example, R1 could apply a postfix of @gateway1.co.uk and R2 could have a postfix of @gateway2.co.uk (where gateway1.co.uk and gateway2.co.uk are valid IP addresses of two separate gateways).
In the same fashion, each route can be configured to apply separate prefixes and or strip prefixes from the numbers that pass through them.
Route translations are performed after address translation.
Setting a route which includes...
<stripPrefix> 06 </stripPrefix>
<prefix> +316 </prefix>
will strip the 06 from the number, and then prepend +316 to whatever was left after the strip.
Therefore:
Number: 0612345678
Replace prefix rule: If number begins with 06, then replace 06 with +316
Number after applying replace prefix rule: +31612345678
If you always want to use a specific route for a specific type of call (e.g. you will always nail up agents through route R1), then this can be achieved by
If we only want to nail agents up through route AgentRoute, where we know all agent extension numbers are of the format sip:agentExample@ipaddress, then we could use the following configuration:
<route name="AgentRoute">
<targetPortGroups>
<portGroup>TRUNKS</portGroup>
</targetPortGroups>
<acceptList>
<item>sip:agent</item>
</acceptList>
<presentation>
<orig_numbering_presentation>0</orig_numbering_presentation>
<originating_addr>AgentRoute</originating_addr>
</presentation>
<ipCallProfile>Agents</ipCallProfile>
<priority>1</priority>
<congestionThreshold>5</congestionThreshold>
<postfix>AgentRoute</postfix>
</route>
<route name="IPDialout">
<targetPortGroups>
<portGroup>TRUNKS</portGroup>
</targetPortGroups>
<rejectList>
<item>sip:agent</item>
</rejectList>
<presentation>
<orig_numbering_presentation>0</orig_numbering_presentation>
<originating_addr>IPDialout</originating_addr>
</presentation>
<ipCallProfile>Agents</ipCallProfile>
<priority>1</priority>
<congestionThreshold>5</congestionThreshold>
<postfix>IPDialout</postfix>
</route>