|
This topic applies to MonTel 2.12.1 onwards
What are trunk routes.
Trunk routes are the general grouping of phone trunk lines on a PABX. A trunk line means connections two exchanges, where a telephone system is consider a private exchange, so for out purposes the trunk line is a line from the telephone system to the telephone central office of telephone exchange.
The telephone system, or PABX (for here on just PABX) may assign a number or a name to each group of trunk lines, for example a PRA ISDN channel (of 20 lines) might be trunk route 1 and a group of say 4 PSTN lines might be trunk route 2. In this simple case the MonTel PABX driver for that PABX system would just return trunk routes of 1 and 2.
MonTel identifies trunk routes by a digit rather than by an name, partly because this is how most PABX refer to them, and also because it save a lot of space. MonTel then uses a lookup list in the PABX.INI file to name them if needed. You could use the TrunkRouteNames setting in the PABX.INI file to directly name these (using up to 4 characters), for example:
TrunkRouteNames = TR1, TR2 or more accurately TrunkRouteNames = ISDN, PSTN.
In some PABXs however, things are not so easy, as the trunk routes are assigned rather arbitrary number. In one real world system there was a PSTN trunk_route (or group) named 398, an ISDN named 399 and some other (rarely used) route numbered 469. It would not be practical to map to the TrunkRouteNames settings directly, and besides the PABX.INI file supports up to 254 characters, not values. To get around this problem we use TrunkRouteKeys.
In the example above we would set TrunkRouteKeys = 399,398,469. This way we can set TrunkRouteNames = ISDN, PSTN, UNKW and when a trunk route of 399 appears it is given the virtual number of 1, which maps to ISDN. This virtual number we call the Trunk route key, so in our example 398 has a trunk route key of 2. If we don't specify the trunk route key, then it defaults to the same value as the trunk route sent from the PABX driver up to a maximum value of 24. So in effect the default TrunkRouteKeys is 1,2,3,4 .. 23,24. Since the trunk route is often programmed into the PABX on a site by site basis, any translation cannot be handled by the driver, and needs to be performed in the MonTel server with TrunkRouteKeys. Each call record will store the original trunk route, and will use the trunk route keys values to do the translation (should they exists). For this reason, PABX installers should not change the trunk route value or name in a PABX with out consideration of how this would affect historical call records.
The Trunk routes should be interpreted by the relevant driver to return the actual value supplied by the PABX, unless if can be mapped to a value below, or it if it is a string value, in which case an attempt should be made to translate that into a matching number. The two obvious ones are PSTN (1) ISDN (2). If the call in an internal call then the trunk route should correspond to the internal trunk value, which is set to 26 (above the expected values for trunk routes). Where possible trunk routes should be in the range 1 to 23, and correspond to to the following values.
TR_NONE 0
TR_ISDN 1
TR_PSTN 2
TR_USER1 1
TR_USER2 2
TR_USER3 3
TR_USER4 4
TR_USER5 5
TR_USER6 6
TR_USER7 7
TR_USER8 8
TR_USER9 9
TR_USER10 10
TR_USER11 11
TR_USER12 12
TR_USER13 13
TR_USER14 14
TR_USER15 15
TR_USER16 16
TR_USER17 17
TR_USER18 18
TR_USER19 19
TR_USER20 20
TR_USER21 21
TR_USER22 22
TR_USER23 23
TR_ISDN_DATA 24
TR_INTERNAL_DATA 25
TR_INTERNAL 26
TR_FAXSERVICE 27
TR_UNKNOWN -1
When the trunk routes are likely to be outside these values TrunkRouteKeys should be used to translate the trunk routes into the value range shown above.
In version 2.12.1 onwards of MonTel, you can use multiple rate tables in the setting TrunkRouteRateTables. If we use TrunkRouteRateTables = tbcompq, tbcomp -- then MonTel will search through the list loading each unique table into memory one, and then remembers the position it occupies in the table as a trunk route key number. If a trunk route has a trunk route key then it will look for the rate code shown in that position, if not, then it will look for a rate code that corresponds to the trunk route number. In either or any case if it can't find a matching rate code in the TrunkRouteRateTables list then it will use the default, which is the entry in MonTelRateTableFile.