For Asterisk 17 CHAN_SIP (Vanilla) click here
For Asterisk 17 PJSIP (Vanilla) 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 which allows you to run a full-featured software based PBX on your computer.
Asterisk is extremely powerful and versatile, but requires dedication to get up and running. Asterisk is NOT plug and play software and because of its extremely versatile nature is typically difficult for first-time users to setup.
Below we have listed several resources, as well as a basic setup guide, that you can use to help you configure your Asterisk system. Please note that due to the complexity of the Asterisk Platform, unfortunately we cannot assist in customizing your install; however you can use the resource list below to guide you in your efforts.
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
Voxilla Asterisk Forum
Broadband Reports VoIP Forum
Digium Community
|
|
Configuring the Asterisk 14 CHAN_SIP (Vanilla) |
|
|
The instructions below are meant to assist you with the basic configuration of Asterisk (chan_sip). We recommend that you read each step through in its entirety before performing the action(s) indicated in the step.
We also recommend that you check which version of Asterisk your PBX is based on; as there are many significant changes between each revision of Asterisk. 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 14.2.1 built by root @ server on a i686 running Linux on 2016-12-16 14:28:25 UTC
STEP 1 |
Setup trunk and global options |
|
Edit the sip.conf file with your favorite text editor and make the following changes:
- If you haven't done so, 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, replace it with the 1777 number assigned to you by Callcentric and 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.You cannot register to your account using only the extension number. If you are registering towards your main/ default extension of your account (extension 100), you can simply use your 1777 number (example: 17770001234).
Also be sure to replace SUPERSECRET with your extension SIP Password here. Your extension SIP Password is the password you created for the extension you are trying to use. You may edit the SIP Password you wish to use in by logging into your My Callcentric account and clicking on the Extension menu link and then modifying the appropriate extension.
- Add an extension to handle calls to/from your SIP phone. This is just a sample. Refer to Asterisk documentation and your SIP Phone documentation for details. 100 and 101 are extensions of your phones.
[100]
context=to-callcentric
type=friend
defaultuser=100
secret=PASSWORD
host=dynamic
[101]
context=to-callcentric
type=friend
defaultuser=101
secret=PASSWORD
host=dynamic
For any instance of PASSWORD, please replace it with the desired password for that specific 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)
- Or 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: For any instance of 1777MYCCID, replace it with the 1777 number assigned to you by Callcentric and EXT is the three digit extension you are trying to register your UA to.
For example "17770001234101" would register to Extension 101 on account 17770001234. Please note that you cannot use the above mentioned by only the extension number. If you are utilizing your main/default extension of your account (extension 100), you can simply use your 1777 number (example: 17770001234).
Where DID1, and DID2 are located, replace it with the number that you've acquired from our service; as an 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 |
|
Use the IP address or hostname for your PBX system along with 100 (the extension created earlier which is the username) and the password for the 100 extension to connect to your PBX system.
NOTE: As 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; as an 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 you don't see an output similar to the above mentioned, 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).
To test inbound calls from Callcentric to your Asterisk installation, follow the directions
listed in this FAQ. |
|
|