For Asterisk 17 PJSIP (Vanilla) click here
For Asterisk version 14 click here
For Asterisk version >= 1.6.2, 1.8, 10 click here
For Asterisk version 1.6 - 1.6.1 click here
For Asterisk versions 1.4 and 1.2 click here
|
GENERAL INFORMATION |
 |
Asterisk is an extremely powerful piece of open source software that gives you the ability to run a full-featured software based PBX on your computer.
Asterisk is NOT plug and play software and because of its extremely versatile nature, it can be difficult for first-time users to setup.
Below is a basic setup guide, as well as links to several resources that you can use to assist you in configuring your Asterisk system. Due to the complexity and dynamic nature of the Asterisk Platform, unfortunately we cannot assist in fully customizing your install.
DID based routing with Asterisk
Please note, Callcentric is not responsible for preventing unwanted physical or remote access to your IP PBX. If your IP PBX is compromised, you will be responsible for all associated damages.
Please be sure to read this guide regarding securing your IP PBX solution.
|
|
RESOURCES |
 |
Websites
Asterisk Homepage
Help / Support:
Asterisk Support Page
Asterisk Forum
Asterisk Wiki
Broadband Reports VoIP Forum
|
|
Configuring Asterisk 17 - (chan_sip) |
 |
|
The instructions below are meant to assist you with the basic configuration of Asterisk (chan_sip). We recommend reading each step through in its entirety before performing the action(s) indicated within the step.
We also recommend checking which version of Asterisk your PBX is based on, as there are significant differences between each revision. To check which version your PBX is based on, please log into your PBX's command line interface and execute the command core show version. In doing so, you should see an output similar to the following:
Asterisk 17.5.1 built by root @ server on a x86_64 running Linux on 2020-06-19 22:40:24 UTC
STEP 1 |
Setting up your trunk and global options |
|
Edit the sip.conf file with your favorite text editor and make the following changes:
- Add the following underneath the [general] section of your sip.conf file:
[general]
allowguest=no
udpbindaddr=0.0.0.0:5061
disallowed_methods=UPDATE
srvlookup=yes
dtmfmode=rfc2833
session-timers=refuse
register=1777MYCCID:[email protected]
- Underneath that, add the following section to define the Callcentric trunk/peer:
[callcentric]
type=peer
context=from-callcentric
host=sip.callcentric.net
fromdomain=sip.callcentric.net
defaultuser=1777MYCCID
fromuser=1777MYCCID
secret=SUPERSECRET
insecure=port,invite
disallowed_methods=UPDATE
directmedia=no
videosupport=no
disallow=all
allow=ulaw
[callcentric1](callcentric);
host=alpha1.callcentric.com
[callcentric2](callcentric);
host=alpha2.callcentric.com
[callcentric3](callcentric);
host=alpha3.callcentric.com
[callcentric4](callcentric);
host=alpha4.callcentric.com
[callcentric5](callcentric);
host=alpha5.callcentric.com
[callcentric6](callcentric);
host=alpha6.callcentric.com
[callcentric7](callcentric);
host=alpha7.callcentric.com
[callcentric8](callcentric);
host=alpha8.callcentric.com
[callcentric9](callcentric);
host=alpha9.callcentric.com
[callcentric10](callcentric);
host=alpha10.callcentric.com
[callcentric11](callcentric);
host=alpha11.callcentric.com
[callcentric12](callcentric);
host=alpha12.callcentric.com
[callcentric13](callcentric);
host=alpha13.callcentric.com
[callcentric14](callcentric);
host=alpha14.callcentric.com
[callcentric15](callcentric);
host=alpha15.callcentric.com
[callcentric16](callcentric);
host=alpha16.callcentric.com
[callcentric17](callcentric);
host=alpha17.callcentric.com
[callcentric18](callcentric);
host=alpha18.callcentric.com
[callcentric19](callcentric);
host=alpha19.callcentric.com
[callcentric20](callcentric);
host=alpha20.callcentric.com
[callcentricB1](callcentric);
host=bravo01.callcentric.net
[callcentricB2](callcentric);
host=bravo02.callcentric.net
[callcentricB3](callcentric);
host=bravo03.callcentric.net
[callcentricB4](callcentric);
host=bravo04.callcentric.net
[callcentricB5](callcentric);
host=bravo05.callcentric.net
[callcentricB6](callcentric);
host=bravo06.callcentric.net
[callcentricB7](callcentric);
host=bravo07.callcentric.net
[callcentricB8](callcentric);
host=bravo08.callcentric.net
[callcentricB9](callcentric);
host=bravo09.callcentric.net
[callcentricB10](callcentric);
host=bravo10.callcentric.net
[callcentricB11](callcentric);
host=bravo11.callcentric.net
[callcentricB12](callcentric);
host=bravo12.callcentric.net
[callcentricB13](callcentric);
host=bravo13.callcentric.net
[callcentricB14](callcentric);
host=bravo14.callcentric.net
[callcentricB15](callcentric);
host=bravo15.callcentric.net
[callcentricB16](callcentric);
host=bravo16.callcentric.net
[callcentricB17](callcentric);
host=bravo17.callcentric.net
[callcentricB18](callcentric);
host=bravo18.callcentric.net
[callcentricB19](callcentric);
host=bravo19.callcentric.net
[callcentricB20](callcentric);
host=bravo20.callcentric.net
NOTE: Any instance of 1777MYCCID should be replaced with the 1777 number assigned to you by Callcentric. EXT is the three digit extension you are trying to register this UA to.
For example: 17770001234101 would register to "extension 101" on account "17770001234". However, if you are registering towards the main/default extension of your Callcentric Account (extension 100), you can simply use your 1777 number without the 3 digit extension suffix (example: 17770001234). You CANNOT register to your Callcentric Account by only using the extension number; the full 1777 number ALWAYS needs to be included.
Also be sure to replace SUPERSECRET with your Extension's SIP Password. Your Extension's SIP Password is the password you created for the extension you are trying to use. You can edit your Extension's SIP Password by logging into your Callcentric Account and clicking on the Extension menu link and then selecting the extension you would like to update.
- Add an extension to handle calls to/from your SIP phone. We've detailed a sample below (100 and 101 are extensions of your phones); for further information please refer to the documentation for both Asterisk and your SIP Phone.
[100]
context=to-callcentric
type=friend
defaultuser=100
secret=PASSWORD
host=dynamic
[101]
context=to-callcentric
type=friend
defaultuser=101
secret=PASSWORD
host=dynamic
NOTE: Replace any instances of PASSWORD with the desired password for each individual extension.
- Once completed, please make sure to save your changes.
|
STEP 2 |
Configuring call handling |
|
Edit the extensions.conf file with your favorite text editor and make the following changes:
- Add the following section to route calls FROM Callcentric TO your SIP Phone with extension 100:
[from-callcentric]
exten => s,1,Dial(SIP/100)
- Alternatively, if you've acquired DIDs from us and would like to perform a DID Based Routing Solution (route inbound calls towards a specific destination based on the number that was dialed) you can use the following:
[from-callcentric]
exten => s,1,Set(Var_TO=${CUT(CUT(SIP_HEADER(To),@,1),:,2)})
exten => s,2,GotoIf($["${Var_TO}" = "1777MYCCID"]?to-100,s,1:3)
exten => s,3,GotoIf($["${Var_TO}" = "DID1"]?to-100,s,1:4)
exten => s,4,GotoIf($["${Var_TO}" = "DID2"]?to-101,s,1:5)
exten => s,5,Hangup
[to-100]
exten => s,1,Dial(SIP/100,20)
exten => s,n,Hangup
[to-101]
exten => s,1,Dial(SIP/101,20)
exten => s,n,Hangup
NOTE: Any instance of 1777MYCCID should be replaced with the 1777 number assigned to you by Callcentric. EXT is the three digit extension you are trying to register this UA to.
For example: 17770001234101 would register to extension 101 on account 17770001234. However, if you are registering towards the main/default extension of your Callcentric Account (extension 100), you can simply use your 1777 number without the 3 digit extension suffix (example: 17770001234). You CANNOT register to your Callcentric Account by only using the extension number; the full 1777 number ALWAYS needs to be included.
Where DID1, and DID2 are located, please replace it with the number(s) you've acquired from our service. For example, if you've acquired the number 12125551000, the following line:
exten => s,3,GotoIf($["${Var_TO}" = "DID1"]?to-100,s,1:4)
Would look something like:
exten => s,3,GotoIf($["${Var_TO}" = "12125551000"]?to-100,s,1:4)
NOTE: To explain the context above, as we will always send the phone number that is being dialed in the TO header of the SIP INVITE packet; the context will extract the DID from the TO header of the SIP INVITE packet and then perform a comparison. From the example above, if DID1 was extracted, it will send the call to the context labeled to-100, which then sends the call to extension 100.
- Add the following section to route calls FROM your SIP phone TO Callcentric:
[to-callcentric]
exten => _X.,1,Dial(SIP/${EXTEN}@callcentric)
- Once completed, please make sure to save your changes. If necessary restart (or start) the asterisk server using the proper command: /etc/init.d/asterisk restart, restart asterisk, service asterisk restart... etc.
|
STEP 3 |
Connect to your Asterisk PBX and verify connections |
|
To connect to your PBX System, use the IP Address (or hostname) for your Asterisk Server in conjunction with "100" (the extension created earlier which is the username) and the password for the "100 extension".
NOTE: Per step 1 of our guide, we've set the chan_sip driver to listen on Port 5061. If you've created extensions that are using the chan_sip driver, you will have to specify <IP ADDRESS/DOMAIN of PBX>:5061 as the registration server. For example, if your PBX has the IP address 192.168.1.12, you will need to use 192.168.1.12:5061 as the SIP Registration Server for your UA.
- Connect to the asterisk console by running the following from the command line:
asterisk -r
- Verify that Asterisk is registered to Callcentric with the console command sip show registry
Host dnsmgr Username Refresh State Reg.Time
sip.callcentric.net:5060 Y 1777MYCCID 60 Registered Mon, 23 Jan 2017 10:51:05
1 SIP registrations.
- Verify that your SIP phone is registered to Asterisk with the console command sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
100/100 10.0.0.3 D Yes Yes 1027 Unmonitored
101/101 10.0.0.4 D Yes Yes 5062 Unmonitored
If your output is not similar to that which is detailed above, then your SIP phone is not configured correctly.
- Disconnect from Asterisk by typing exit. Asterisk will remain running in this case.
|
STEP 4 |
That's it! You can now make a phone call |
|
You can make a test call to 17771234567, or if you are signed up for one of Callcentric's rate plans you
can place a call to a traditional landline or mobile phone by dialing either:
1 + the area code and number for calls to the US
Or
011 + the country code, area code, and number for calls worldwide
(you may also use 00 instead of 011).
|
|
|