When configuring inbound routing, a common scenario arises when a provider offers a single SIP account for multiple purchased phone numbers.
For example, at MIKO, there are phone numbers:
+7(495)229-30-42
+7(499)638-25-84
In the MikoPBX interface, only one "Telephony Provider" account is created. Each phone number needs to be directed to its own route, such as different IVRs.
This is where the DID number comes to the rescue, which the provider can transmit during inbound calls. Knowing the DID number, you can define multiple inbound routes for the provider, each with a different DID, which solves the described problem.
How It Works
For call analysis, I usually use the "Sngrep application". Here's an example request from the provider for an incoming call:
When receiving such a packet, MikoPBX analyzes the first line with the keyword "INVITE," extracts the value "84996382584," and considers it as the DID number.
Possible Issues
DID in the To Header
In practice, it's not always so straightforward. For example, I've encountered a provider that sends the following INVITE:
In this case, the account login is described in the "INVITE" line, while the DID is described in the "To" header. To set it up correctly, you just need to add the following lines to the Customize System Files section at the end of the "extensions.conf" file: