Asterisk configuration is often confusing and frustrating. The FreePBX GUI simplifies the many tedious configuration tasks in Asterisk. The following guide will walk through the steps to set up a SIP trunk using FreePBX.
Prerequisites
Setup the SIP Trunk
Open up a web browser and go to your Asterisk server web interface:Login as 'admin' or 'maint' (depending on your system).
Now, on the left, under Basic click Trunks, you should see a selection of trunk types, like this:
Add a Trunk
Add SIP Trunk
Add DAHDi Trunk
Sip Trunk For Home
Add Zap Trunk (DAHDi compatibility mode)
Add IAX2 Trunk
Click Add SIP Trunk. We are now presented with a page that we must fill in with our trunk info.
General Settings
In the Outbound Caller ID field, you can enter a caller ID, but it may not do anything. So, we'll skip this field. We'll also leave the Never Override CallerID unchecked.
For the Maximum Channels field, we'll put in 1. This is because the plan we are using in this guide only allows 1 incoming call at a time.
Leave the Disable Trunk and Monitor Trunk Failures at their defaults.
Dialed Number Manipulation Rules (Outgoing Dial Rules)
Dial rules are powerful, yet quite simple to learn. These rules can manipulate the dialed number before sending it out this trunk. If no rule applies, the number is not changed. The original dialed number is passed down from the route where some manipulation may have already occurred. This trunk has the option to further manipulate the number.
Dial rules follow the following basic format:
If the number matches the combined values in the prefix plus the match pattern boxes, the rule will be applied and all subsequent rules ignored. Upon a match, the prefix, if defined, will be stripped. Next the prepend will be inserted in front of the match pattern and the resulting number will be sent to the trunk. All fields are optional.
Rules:
In the following examples, we'll use dialing rules to modify numbers for US 10-digit dialing.
Let's examine what these mean:
We'll start with the first one. (1+NXXNXXXXXX) 1+ means prepends '1' to the number. N means match any number between 2 and 9. X means match any number between 0 and 9. This would match a number like, say 416-515-1234 and turn it into 1-416-555-1234 before sending it to the SIP servers. So, the next one (1416+NXXXXXX) goes like this: 1416+ prepends '1416' to the number. N matches any number between 2 and 9. X matches any number between 0 and 9. So then this one would match a number like, 555-1234 and turn it into 1-416-555-1234 before sending it to the SIP servers. In the third example (9|.) 9| prefix or remove '9' from the number. This is normally added to route calls to a trunk. So the user would dial '9' to dial-out from this trunk. . The period or dot '.' is a wildcard that matches one or more digits so this will allow any type of call to use this trunk. So then this one would match any number with a prefix 9, strip the 9 from the number and send the rest of the number to the SIP servers.
The Outbound Dial Prefix field prefixes a number to all numbers dialed through this trunk. For most cases including this example, we will leave it blank. However, if this is a trunk to another Asterisk server or a Centrex line, you many need to put '9' in this box to access an outside line.
Outgoing SettingsUnder Outgoing Settings, we see the field Trunk Name. We'll put 'Broadvoice' in this box.
Now, here comes one of the most complicated parts of setting up a SIP trunk, the PEER Details. These settings tell Asterisk how to connect to the SIP provider.
Here is a list of the most common settings with descriptions of each one:
Incoming Settings
We do not need anything under Incoming Settings, so just leave it blank.
Registration
One of the most important settings in a SIP trunk, is the register string. You will find the field under Registration. Some, like Broadvoice, use this format:Some SIP providers use a slightly different register string format than others. The formats go as below: Which translates into: While others use this format: Which translates into: The /<DID> is important because it tells Asterisk how to route incoming calls from this trunk. It is a good idea to set it to your phone number/username. Freepbx Sip Trunk ConfigurationSo, for this guide, we'll use a register string like this:Finally we can click the Submit Changes button. Now we can move on to setting up the inbound route. 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:
host=sip.***.didlogic.net
user=50841 username=50841 fromuser=50841 authname=50841 secret=********* insecure=port,invite type=friend qualify=yes disallow=all allow=ulaw allow=alaw
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 patters 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.
Correctly dialed:
442012345678 – United Kingdom 12125551212 – USA; 19055551212 – Canada 4915151234567 – Germany.
Incorrectly dialed:
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:
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.
Configure A Sip Trunk Asterisk Free
For example, you purchased a UK number at DID Logic and routed it to [email protected]. 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 “46.137.162.140”.
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 protected], and your FrePBX/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.
PLEASE NOTE: *** in the hostname configured must be replaced by the name of a regional proxy,
e.g. sip.nyc.didlogic.net
The best place to get cheats, codes, cheat codes, walkthrough, guide, FAQ, unlockables, trophies, and secrets for Tomb Raider: Definitive Edition for PlayStation 4 (PS4). Jan 28, 2014 Tomb Raider: Definitive Edition Review. The Definitive Edition of Tomb Raider is a lot like Lara Croft's excellent adventure from last year, only with enhanced visuals and extra features.
Find out more in our Setup section.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |