How to configure Direct Inbound Dialing (DID)
From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia
Contents |
[edit] Direct Inbound Dialing (DID)
Direct Inbound Dialing (DID) allows public PSTN numbers to be assigned to individual users. This means that a user is directly reachable without first calling the company operator (or an auto-attendant) that then transfers the call to a local extension.
DID handling depends on the connection to the carrier and is different between using a T1 or fractional T1 connection vs. analog lines. With T1 and fractional T1 connections the carrier deliveres DNIS (Dialed Number Identification Service) information, which the gateway uses to route an incoming call directly to the respective user with that DID number assigned. Analog lines do not offer that feature.
There isn’t really any configuration required in sipX dial plans to support DIDs. The dial plan in the gateway defines how the incoming DNIS information is translated into a SIP URI of a phone. The User ID or alias assigned to a user is typically chosen to be the same as the DNIS, typically the last 4-digits of the PSTN number. When the gateway receives an incoming call for a particular DID, it will send it to the sipX server and sipX will then ring the appropriate phone.
[edit] Direct Inbound Dialing (DID) with a T1 or Fractional T1
From a carrier you get a T1 line with 24 channels and a pool of DIDs, say a 100 numbers from 1-781-970-0100 to 1-781-970-0199. When someone dials one of these numbers in your group (other additional numbers can also be associated with the T1, like 800/900 numbers) the phone company will send a call to the gateway on one of the 24 channels of the T1. They will supply DNIS information so that the gateway knows what number was dialed and what extension to ring. The gateway will use its internal dial plan to translate the DNIS into a SIP URI and send the call to the sipX server. If the DNIS is 4 digits (common) and internal dialing is only 3 digits, the gateway internal dial plan will provide mapping to only send the last 3 digits of the DNIS. Internal extensions (User IDs or alias) can be formulated from DNIS, either the last few digits or prefix+DNIS, dependent on what the gateway's dial plan allows you to do.
Example: Someone dials 1-781-970-0137. The phone company sends a call on some channel of the T1 with DNIS=0137. The gateway generates a SIP INVITE to “sip:137@sipx.example.com” and the sipX server rings a phone registered with that URL.
[edit] Direct Inbound Dialing (DID) with Analog Lines
Analog lines have no DNIS, so that the only way the phone company can let us know what number was dialed is to ring a certain line. If you have 4 people, you’d buy 4 lines with 4 PSTN numbers (DIDs). When someone calls one of these numbers, that line rings and the gateway has to be programmed to send the call from that line to the respective extension. Because the extensions are mapped to lines on the gateway, they don’t necessarily have to be related to the PSTN number. However. for simplicity and user friendliness reasons it is a good practice to have an extension that is related to the PSTN number.
If you have other internal extensions that do not need direct (DID) numbers, you can aggregate those in a pool of external lines. For example if you have 6 other extensions, you will buy 3 more lines. Incoming calls on these 3 lines will be serviced by an operator or auto-attendant (programmed in the gateway). These 3 lines will also be used for outbound calls from the 6 extensions and if one of the DID extensions needs to make more than one call at the same time.
There still is a problem with outbound calls: The sipX server is able to route outbound calls to a particular gateway, but you cannot specify a certain line to be used on that gateway dependent on who (i.e. a line on a device) originated that call. Therefore, an in process outgoing call could cause an incoming call for a different internal extension to get a busy signal even though the phone for which the DID number was dialed is not in use. This problem could only be resolved by using two gateways: One used for incoming calls, the other used for outgoing calls. Therefore, it is recommended to use T1 or fractional T1 services when planning to use DIDs.
[edit] Defining a DID prefix Dialing Rule
If the gateway is unable to perform the necessary or desired mapping between incoming DNIS identifiers and the User IDs or alias of internal users, a DID prefix and internal dialing rule can be setup. This configures the sipX server to perform the desired mapping instead of the gateway.
The Custom Dialing Plan option is used to create a rule that allows for the required mapping to take place.
First, identify the DID prefix by determining the constant digits that become the prefix to an internal station number to produce a full DID number. For example, if the format of your DID numbers is 781-854-3nnn, the DID prefix is 7818543. If so desired, sipX can be configured to route internal calls addressed to extension 678 to DID number (and User ID) 7818543678.
[edit] Setup: Go to Dial Plans
- Click Add Dial Rules
- Choose Custom
- Choose a name for your rule ("DID" might be a good name)
- Select Enabled checkbox
- In the Dialed Number section: Leave the prefix empty and add select 3 digits (or whatever number of digits you use)
- In the Resulting Call section: Enter the DID prefix (7818543) and select "digits" from the drop down
- Do not check any permissions
- Do not add any gateways
Press OK and then go and activate your dialing plan.

