Courseware:IT Plus - Number manipulations
Jump to navigation
Jump to search
Imagine you have different extension numbers, externally and internally. This book gives us an idea how to solve this issue.
Start
In the scenario of this book each user has a different number externally then internally. We will examine solutions and discuss the limitations of these solutions.
Afterwards please configure an MSN trunk to our SIP provider simulation using the Trunks plugin in the Settings App. Use the following parameters:- Set Name and SIP to
trunk and Number to0
- Then add an SBC on your hq PBX using the Default SIP Trunk template. Use the following parameters:
- Country code:
+49
- Connection type:
MSN
- Individual registration:
Yes - set the Number mappings & credentials as follows:
MSN number
internal extension
SIP username
SIP password
+4962134282323 15
MSN49.621.34282323 pw123 +4962134282327 12 MSN49.621.34282327 pw123 +4962134282335 13 MSN49.621.34282335 pw123 +4962134282336 14 MSN49.621.34282336 pw123
- Protocol:
TCP
- Domain:
siptrunk.class.local - Proxy: <leave empty>
- Media Relay:
on
Configuration limitations
After setting up the MSN trunk, you will see that the Trunks plugin in the Settings App has created
an outgoing and an incoming route for your SIP trunk (RS1) in your routing table. The outgoing route contains multiple maps to adapt the number. This is fine for such a small PBX we are currently using, but keep in mind that each device has its configuration limitations. Please take a look at
our wiki where we have summarized the most important limitations.
an outgoing and an incoming route for your SIP trunk (RS1) in your routing table. The outgoing route contains multiple maps to adapt the number. This is fine for such a small PBX we are currently using, but keep in mind that each device has its configuration limitations. Please take a look at
our wiki where we have summarized the most important limitations.A common issue is that the routing table and interface maps contain a lot of number manipulation because customers want to use different numbers internally and externally. As configurations grow over time, those maps may exceed the limit of global config change lines, which could lead to disaster.
This must be avoided. This book contains PBX solutions to help you design your system without breaking the limitations.
Multiple registrations on the trunk object
In our current configuration, our trunk object in the PBX (PBX/Objects)
has a single registration on the Hardware Id 0090334000b3-SIP1. This registration
originates from the internal registration of our SIP1 interface. Furthermore, the Trunks Settings plugin has created
multiple maps in the routing table. These maps will route an outbound call to the correct SIP interface based on the CGPN.
has a single registration on the Hardware Id 0090334000b3-SIP1. This registration
originates from the internal registration of our SIP1 interface. Furthermore, the Trunks Settings plugin has created
multiple maps in the routing table. These maps will route an outbound call to the correct SIP interface based on the CGPN.Although this is a perfectly viable configuration, we're going to have a little fun and test other features of the firmware. Our goal in this chapter is to get rid of the number maps in the routing but still each user should use their own MSN registration for inbound and outbound calls.
The first step is to enable the
in our Trunks plugin because this gives us full ability to experiment with all featutres of the SIP interface. Note that when this mode is enabled, the Trunks plugin cannot show or modify the configuration any more. From this point on, you must use the Advanced UI. However, you can still delete the trunk. If you accidentally turn on Expert Mode, you can delete the entire trunk and add it again.
As a next step, please delete all outgoing and incoming maps for RS1/SIP1 in the routing table.Don't worry, the SIP1 -> RS1 and RS1 -> SIP1
routes will reappear. As long as a SIP interface is registered internally, an outbound and inbound route to and from the PBX is created for that interface.
routes will reappear. As long as a SIP interface is registered internally, an outbound and inbound route to and from the PBX is created for that interface.
Now,
configure a password
Register the SIP2, SIP3 and SIP4 interfaces internally on the new hardware ID trunk. For each Internal Registration,
configure the properties Protocol (
Now, have John, Richard, and Jane make outbound calls to 00900 12345678 . Then, go to Gateway/Calls. Although you have four registrations on the trunk object,
all calls are routed through the SIP1 interface. This is the expected behavior. A trunk line object will always use hardware IDs in sequence.
The next hardware ID in the list will only be used if the previous one has no registration or a call is disconnected with a
reroute cause code (e.g. No circuit/channel available) which triggers a reroute of the call.
Now, delete the Hardware Id 0090334000b3-SIP1 and have John, Richard, and Jane call 00900 12345678 again. If you check Gateway/Calls again, you see that the calls are
routed to SIP2, SIP3, and SIP4.
routed to SIP2, SIP3, and SIP4.
If multiple interfaces are registered to the same hardware ID, round-robin is used.Hardware ID name
Now, anyone can use any SIP interface wich will result in a random MSN number as CGPN to the provider. However, this is not what your customer wanted. He wanted the following:
To do this, please create these Hardware Ids:
- 15 is using SIP1 (MSN +4962134282323)
- 12 is using SIP2 (MSN +4962134282327)
- 13 is using SIP3 (MSN +4962134282335)
- 14 is using SIP4 (MSN +4962134282336)
This solution can still be achieved without using the routing table.
To create the solution we first need
4 different Hardware Ids on our trunk object. Each interface should register at a different Hardware Id.
4 different Hardware Ids on our trunk object. Each interface should register at a different Hardware Id.
To do this, please create these Hardware Ids:0090334000b3-SIP1 0090334000b3-SIP2 0090334000b3-SIP3 0090334000b3-SIP4 - Furthermore please remove the name and password from the internal registration of all your SIP interfaces as it is not necessary anymore. We will use H323/TLS to authenticate the interface on the correct hardware id.
You need to wait a couple of seconds until all your interfaces are registered internally again.
This means:
- Hardware Id 0090334000a8-SIP1 should have the name
#15 - Hardware Id 0090334000a8-SIP2 should have the name
#12 - Hardware Id 0090334000a8-SIP3 should have the name
#13 - Hardware Id 0090334000a8-SIP4 should have the name
#14
To test your configuration open Gateway/Calls again and call 00900 12345678 from John, Jane and Richard. You will see that Jane will always use SIP2, Richard will use SIP3 and John will use SIP4.
External option
Imagine the company grows and changes from an MSN trunk to a DDI trunk. As more employees join the company, the external numbering range increases from two digits to three digits. John, Jane, Henry and Richard want to keep their old two-digit internal numbers. Consequently, you must map the three-digit external number to a two-digit internal number and vice versa.
You could create interface or routing maps, to map each number independently. However, this is not recommended, as it could quickly become unmanageable and exceed configuration limits.
- Trunk object Name/SIP
trunk
- Trunk object Number
0
- Country code:
+49
- Connection type:
DDI
- International number
+496213428231
- Lowest extension:
0
- Number mappings:
+496213428231 -> <empty>
- User:
DDI49.621.3428231
- Password:
pw123
- Protocol:
TCP
- Domain:
siptrunk.class.local - Proxy: <leave empty>
- Media Relay:
on
After a successful registration of your DDI trunk, open John Doe's user object. John Doe wants to use the external number 360 for all external calls, but he will keep the number 14 for internal calls.
To complete the configuration you have to tell the trunk object to apply the number configured in the external field instead of the extension number when forwarding calls to the relay.
To do this, open the Trunk object and
enter a question mark
To use the external configuration in an E164 setup, configure a "!" instead of a "?".Test your configuration by calling 0062134282398 from your IP111 (John Doe). Look at the display on your IP232. You should see that the last 3 digits of the calling party's number are 360. If so, congratulations! You have achieved the desired configuration.
Dial In
But what about incoming calls?
Note that this will only work if the external number configured in the user object is unique. If multiple users have the same external number, or if an extension with the same number exists, the call will not be routed to the correct destination. The same is true for an overlapping destination. For example, if the external number is 360, but extension 36 exists, the call will not be routed correctly.
When you dial 06213428231360 from your IP232 or call back, the call is routed to the PBX with CDPN 360, but no object is found. For this to work, a check mark is missing.
Note that this will only work if the external number configured in the user object is unique. If multiple users have the same external number, or if an extension with the same number exists, the call will not be routed to the correct destination. The same is true for an overlapping destination. For example, if the external number is 360, but extension 36 exists, the call will not be routed correctly.Now, when you call 06213428231360 from your IP232, the call will be routed to John Doe, and your IP111 will ring.