Asterisk SIP trunk setup
Basic setup guide
This guide was created using the FreePBX distribution. It will also work for Elastix and other Asterisk installations. Vicidial, 3CX and other IP PBX system are not covered here, however, using the information below, you should be able to setup these other systems as well.
SIP username is numeric and 5-digits long, for example, 40400. This username is different from your account number. You need to create a SIP login and generate a password before you can use Asterisk or any other SIP device – please see instructions here.
1. In this example, we route the DID to "SIP Device", the SIP account we're going to register with the sip proxy from our Asterisk box. Use the dropdown list if you have several.
2. Create a SIP trunk.
Leave all dialed number manipulation fields blank. Do not enter any patterns. Leave CID options as is. SIP proxy address: sip.***.didlogic.net Codecs supported are G711u, G711a, G.722 and G729. In this example, we're assuming you have amble bandwidth and wish to use G711u exclusively for highest voice quality.
Finish adding trunk description. Leave incoming settings fields empty. If your username is, for example, "50841", PEER details would be:
Register string: 50841:your_password@sip.***.didlogic.net /442035198131
This is an example. We’re expecting the inbound route to have DID= 442035198131, hence it's /442035198131. Change that to any DID you wish to use with the inbound route. Important: didlogic gateway automatically bans IP addresses after several consecutive incorrect authentication attempts. If your IP is banned, you will not be able to register to sip.***.didlogic.net or browse the didlogic.com website for 3 hours. Make sure you are using your numeric SIP login and SIP password – not website password. This username is different from your account number. You need to create a numeric SIP login and generate a password before you can use Asterisk or any other SIP device.
3. Add outbound route.
In this example, dial patterns are set to "XX." (anything). However, your FreePBX likely has more than one trunk already and you will need to specify the prefixes you wish to send via your didlogic trunk.
Important: dialing format is E164. Dialing with 00 or 011 in front will not work. You need to send the dialed number full international format, with country code, area code and number (1 for NANPA countries). Dialing US/Canada requires a "1" in front.
442012345678 – United Kingdom 12125551212 – USA;
19055551212 – Canada 4915151234567 – Germany.
011442012345678 or 00442012345678 or 02012345678 – this is NOT how you dial UK. 2125551212 or 9055551212 – this is NOT how you call US/Canada, you must dial with "1" in front.
4. Inbound route setup.
We now have an active registration to sip.***.didlogic.net
Verify the registration is active with the "sip show registry" command:
Refresh Stat 105 Registered
Since our register string, in this example, takes form of 50841:your_password@sip.***.didlogic.net /442035198131, we will then need to setup an inbound route to process calls to that DID number. Go to "Inbound routes", click "Add incoming routes" and enter "442035198131" in the "DID Number" field. Under "Set destination", route the call to one of your Asterisk extension (ext. 101 in this example):
5. Routing DID to your Asterisk server by SIP URI – alternative option.
To forward DIDLogic numbers in your account to your Asterisk system using the SIP URI format and without setting up a trunk to our gateway, use the "SIP" option and the "exten@your_IP" syntax. Choose "SIP" instead of "DIDLogic SIP" and enter your external SIP address. Your system needs to either have a static IP, or a hostname that updates to your real IP.
For example, you purchased a UK number at DID Logic and routed it to firstname.lastname@example.org. Your Asterisk will need to process a call on extension 441224607177 coming from our gateway (sip.***.didlogic.net).
In most Elastix or FreePBX versions, this is done by adding an incoming route and specifying the DID as "442035198131". You may need to manually edit your sip.conf or use the “Add DID” option if using A2billing. The most important thing to remember is that your Asterisk must be able to recognize the extension the call is coming in on.
6. Incoming context: accept external SIP calls.
To receive inbound SIP URI calls, you may need to turn on the "Allow Anonymous Inbound SIP Calls" option in your FreePBX/Elastix system. This may or may not be required depending on your current setup, however, in the default install, this parameter needs to be set to “YES” before you can accept calls from the public Internet. Go to "Setup", "General settings" and edit this option under "Security Settings".
7. SIP URI destination setup example.
Go to the “Purchased” tab in your DID Logic account. Edit the destination and set your
number to ring on extension “442035198131” to the IP address of “184.108.40.206”.
Create an inbound route in your FreePBX/Elastix setup and specify the extension or custom app you wish to process calls on DID 442035198131 in your Asterisk system.
In this example, if you route your DID Logic number to SIP URI of email@example.com, and your FreePBX/Elastix will process that incoming call and will look for extension 442035198131 in your “from-sip-external” context.
FAQ. If you still can't make calls - checklist to go through prior to contacting support.
- 603 declined on outbound is caused by lack of active registration. SIP registration is currently required to send calls.
- Dial the full international number: 1-212-555-1212 (US), 44-208-500-0000 (London). Dialing 212-555-1212 won't work. Do not dial with 0 or 00 or 011 in front. This is by far the most frequent reason for outgoing calls to fail.
- Incoming calls problem: issue the "sip set debug ip sip.***.didlogic.net" command and review incoming traffic from us. 99.8% of such issues are caused by wrong context or other incorrect route setup. Each Asterisk installation is unique. You may have various contexts enabled that interact in your own customized way; please look at your syntax first.
- If in doubt, stop all registrations, comment out the trunk config, download X-lite and attempt placing calls. This will tell you right away that the problem is somewhere in your local Asterisk configuration.
- By default, the CLI sent with your call is your DID number. Customers looking to send their own CLI must provide proof of address (scanned utility bill) and business information. This is for compliance reasons. Sending your existing caller IDs using our SIP trunk is covered here.
PLEASE NOTE: *** in the hostname configured must be replaced by the name of a regional proxy,
Find out more in our Setup section.