Millions of individuals and businesses on planet Earth use a communications system in which the Asterisk and DIDX direct inward dialing are used for convenient, feature-rich, inexpensive calling. Here is how to configure the technical side of this empowering combination. (We will include a demo video on this blog that goes with this description soon.)
Let’s create SIP trunks in Asterisk with the IP addresses of DIDX SIP server. Use any
preferred editor to edit the “SIP.conf” file. The file path is “/etc/asterisk/sip.conf”.
Here you have to define the SIP trunks with the IP addresses of DIDX.
All the IP addresses of DIDX are mentioned on this link which is “www.didx.net/pages/asterisk”. If you are using USA DID, then the call can come from sip4, us1 and us2 addresses. If you are using UK DID, then call can come from eu2 and eu3 addresses. It is recommended to create the SIP trunk with all the IP addresses which are mentioned on this page.
Let’s create the SIP trunk with “sip4”.
The format for this follows:
Let’s make a second SIP trunk of “sip8”.
Similarly, in this format you will define the remaining IP addresses of DIDX.
Next, you will create an extension in this file. The format for creating the “10005” extension is like
secret=DIDx (Please make sure to use strong, complex password.)
disallow=all (This will disallow all the codecs.)
allow=alaw (You will allow only “ulaw” and “alaw.”)
You have created the extension successfully in the file. Now save and exit the file.
Let’s go to the extension file using the preferred editor. The file path is same; just replace …
“sip.conf” with “extensions.conf”.
You will define your “Dial Plan” in this format where we are using DID 15672446030 as an example:
exten => 15672446030,1,Dial(SIP/10005)
exten => 15672446030,2,Hangup()
All incoming calls on this “DID” will land on this extension “10005”.
Instead of defining all the DIDs separately in the “Dial Plan”, you can customize your Dial plan like this:
exten => _X.,1,Dial(SIP/10005) (Here “X” means number from 0-9 and “.” means any length.)
exten => _X.,1,Hangup()
After this, save and exit the file.
Now you will go to Asterisk CLI to reload all your configuration. For that type “Asterisk -rvvvv”. Then hit Enter.
Now type “reload” and hit Enter. Your configuration is reloaded successfully.
Now you will register the extension on your softphone that you have created in your “sip.conf” file. You can use any softphone such as your own or Zoiper, X-lite, Jitsi, SwitchVox softphone, and Eyebeam because they are easily available and can be configured in no time. In our demo video, we use Zoiper.
In Zoiper, click on “Setting” and then use the SIP protocol. Click “next”.
Type your extension in the “User” box. Type the password that you have defined in your extension.
Last, type the IP address of your Asterisk server and then click “next”. Again “next”.
You will see: “Your account has been added to account list”.
Again, go to your Asterisk CLI. Check if your extension is registered on the softphone or
not by using this command “sip show peers”. Here you can see your extension has been registered.
Once your configuration is completed successfully, dial the DID that you have purchased and had provisioned from the DIDX marketplace, you will see the incoming call on this DID reach this extension successfully which is registered on your softphone.
Feel free to double-check the call on the “Asterisk CLI”. Welcome to your Asterisk server with DIDX direct inward dialing with a coverage of 100 + nations.