TUTORIAL CallCentric Trunk Setup

James L

New Member
Joined
Nov 20, 2015
Messages
14
Reaction score
1
I hate to open this discussion backup and I know I'm a new PIAF user so feel free to point me to someplace where this is already addressed. I have been reading this forum and others trying to get Callcentric's trunks to work inbound & outbound on my system. At this point I have tried all the configurations suggested and still nothing worked. I was especially excieted with Ward's "working solution", but I seem to have messed that up too! I'm afraid I've just created conflicting "repairs" and that may be what is preventing Callcentric+PIAF from working properly. I currently have Google Voice, VOIPo, Anveo.com (not Anveo Direct), and IPKall all working on my system so it seems my Callcentric configuration (or lack thereof) is the issue.

I'm going to recompile a clean Raspberry Pi2 system to just do Callcentric configuration tests. Could someone who has this working point me in the correct direction? I don't mind reworking some code, but with so many posts and issues I can't figure out which is the method to try. My system is the latest Incredible PBX 11-12.2 for RPi2/Asterisk 11.20.0/Incredible GUI 12.0.39 on a RPi2 running the latest version of Rasbarian Wheezy. All the Callcentric documents and threads I could find are below. Thanks!

Callcentric's own help (not very useful): www.callcentric.com/support/device/trixbox
PIAF Forum posts:
1. http://pbxinaflash.com/community/index.php?threads/using-callcentric-with-piaf.14121/
2. http://pbxinaflash.com/community/index.php?threads/callcentric-incoming-did-routing-solved.5265/
3. http://pbxinaflash.com/community/in...t-get-callcentric-calls-to-be-accepted.13537/
4. http://pbxinaflash.com/community/in...ittent-issues-cannot-receive-calls-100.13656/

5. http://pbxinaflash.com/community/index.php?threads/yet-another-callcentric-incoming-thread.16082/
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
If you restrict incoming SIP traffic to the provider IPs, then the docs on the callcentric site should work without horrific security concerns. I would start there, make sure that works first. If incoming SIP is properly firewall restricted you can probably stop there and be OK.

Then proceed to the 14121 (single DID) or 5265(multiple DIDs) thread if desired. My personal method is something in between the CC provided DID routing instructions and the 5265 thread.
 

James L

New Member
Joined
Nov 20, 2015
Messages
14
Reaction score
1
Attempt #1: I started with a clean configuration of PIAF/Incredible PBX on a Raspberry Pi 2 running Raspbian Wheezy, Incredible PBX 11-12.2, Asterisk 11.20.0, Incredible GUI 12.0.39. I have 3 DIDs on my Callcentric account: 1646######1, 1646######2, and 8835100######## (iNUM). Each DID is forwarded to a different Callcentric Extension 1777####### (default extension or x100), 1777#######102, and 1777#######103.

First tried Ward's solution from: http://pbxinaflash.com/community/index.php?threads/using-callcentric-with-piaf.14121/#post-90355. The solution worked great, but it did not allow incoming DID routing. In order to get it working:

1. added lines to end of the IPtables file /etc/iptables/rules.v4
Code:
#Callcentric IP addresses
-A INPUT -s 204.11.192.0/24 -p udp -m udp --dport 5060:5080 -j ACCEPT
-A INPUT -s 204.11.192.0/24 -p tcp -m tcp --dport 5060:5080 -j ACCEPT
-A INPUT -s 66.193.176.0/24 -p udp -m udp --dport 5060:5080 -j ACCEPT
-A INPUT -s 66.193.176.0/24 -p tcp -m tcp --dport 5060:5080 -j ACCEPT
# your own additions go above here
2. added the recommended code to /etc/asterisk/extensions_override_freepbx.conf from post 90355.
3. added a trunk for each Callcentric extension using the Asterisk 1.8 settings from Callcentric (http://www.callcentric.com/support/device/trixbox). Only differnace in each account was the "fromuser=" had the extension number added to the end of the account number (1777#######)
4. added an inbound route with the FreePBX web interface for each Callcentric DID
5. With FreePBX web interface Settings/Asterisk SIP Settings/Chan SIP (A) set "Allow SIP Guests = YES" and "SVR Lookup = Enabled"
6. restarted iptables with iptables-restart
7. restarted asterisk with amportal restart

Calls to all 3 DIDs went through and were connected to whatever inbound route had the "DID Number" blank.
 

James L

New Member
Joined
Nov 20, 2015
Messages
14
Reaction score
1
Attempt #2: After trying the solution posted above I wanted to get the DID routing working with Callcentric. So I again started with a clean configuration of PIAF/Incredible PBX on a Raspberry Pi 2 running Raspbian Wheezy, Incredible PBX 11-12.2, Asterisk 11.20.0, Incredible GUI 12.0.39. Using the same Callcentric account with 3 DIDs: 1646######1, 1646######2, and 8835100######## (iNUM). Each DID is forwarded to a different Callcentric Extension 1777####### (default extension or x100), 1777#######102, and 1777#######103.

This time I tried all the solutions presented in the 5665 thread (http://pbxinaflash.com/community/in...-incoming-did-routing-solved.5265/#post-46136). I was only able to get the very fist solution by hivemind to work on my system. It is able to route the 1646######1 and 1646######2 DIDs properly. However, the iNUM is routed to whatever Inbound Route has the "DID Number" blank. I even tried making 3 separate Inbound Routes for each of the callcentric extensions (1777#######102), still didn't work. But at least the 2 646 DIDs are working correctly! I performed the following.

1. added lines to end of the IPtables file /etc/iptables/rules.v4 (I did not use add-fqdn/add-ip maybe I should?)
Code:
#Callcentric IP addresses
-A INPUT -s 204.11.192.0/24 -p udp -m udp --dport 5060:5080 -j ACCEPT
-A INPUT -s 204.11.192.0/24 -p tcp -m tcp --dport 5060:5080 -j ACCEPT
-A INPUT -s 66.193.176.0/24 -p udp -m udp --dport 5060:5080 -j ACCEPT
-A INPUT -s 66.193.176.0/24 -p tcp -m tcp --dport 5060:5080 -j ACCEPT
# your own additions go above here

2. added the [custom-get-did] code from the post to /etc/asterisk/extensions_override_freepbx.conf. I did not add it to the recommended /etc/asterisk/extensions_custom.conf file.
3. added a trunk for each Callcentric extension using the Asterisk 1.8 settings from Callcentric (http://www.callcentric.com/support/device/trixbox). Each account had the "fromuser=" with extension number added to the end of the account number (1777#######). And the context=custom-get-did not the Callcentric recommended "from-pstn"
4. added an inbound route with the FreePBX web interface for each Callcentric DID
5. With FreePBX web interface Settings/Asterisk SIP Settings/Chan SIP (A) set "Allow SIP Guests = YES" and "SVR Lookup = Enabled"
6. restarted iptables with iptables-restart
7. restarted asterisk with amportal restart

Results: The 646 DIDs are routed properly. The 1646######1 routes to IVR#1 and 1646######2 routes to IVR#2. However the iNUM is supposed to route to IVR#3 and it instead goes to the default route which currently has the "DID Number" blank. Not sure why the caller ID isn't being grabbed on the iNUM. I tried calling in from 2 differant access numbers. The SIP header looks like it is passing info, it's below.

Code:
RPi1*CLI>

<--- SIP read from UDP:204.11.192.169:5060 --->
INVITE sip:1777#######[email protected].###.###:5060 SIP/2.0
v: SIP/2.0/UDP 204.11.192.169:5060;branch=z9hG4bK-6aee66c58b02251496aa2d7727de5744
f: <sip:1404#######@66.193.176.35:5060>;tag=as77a45927
t: <sip:8835100########@ss.callcentric.com>
i: [email protected]
CSeq: 1 INVITE
Max-Forwards: 12
m: <sip:[email protected]:5060;transport=udp>
c: application/sdp
l: 340

So it's working pretty well so far. Any ideas on getting the iNUM to route properly? I'd like to use it for some international phone access. Thanks!
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
For attempt#2 method with DID routing you do not need separate CC extensions, everything can (and probably should) go to the default extension and let asterisk handle the routing.

Again, start with the Callcentric provided instructions for asterisk/PIAF DID routing and get that working first before diving into the various forum methods. With the restricted firewall settings Callcentric's instructions reasonably safe, relatively simple, and concise.

Do not use CC extensions. Do EXACTLY AND ONLY what the CC provided instructions say. Note in the instructions that "/1777..." should NOT be at the end of the register string.

Make sure everything works and routes correctly, then move on to the 5625 post if desired- it is essentially the same method with a slightly expanded dialplan script.

I just added an iNum to one of my callcentric accounts and setup an incoming DID route for it. All works/routes as expected, just enter the 88351... number as the DID in the route.
 
Last edited:

James L

New Member
Joined
Nov 20, 2015
Messages
14
Reaction score
1
Attempt 3, Part 1: Followed jerrm's advice and have Callcentric incoming and outgoing calls working. The two 646 DIDs and the iNUM all route to IVR#1. And incoming Google voice is routing to IVR#2. So Callcentric is passing the 1777 account number as the incoming DID.

This was all done on a RPi2 system with a fresh/clean install of PIAF/Incredible PBX; the same configuration used above. I performed the following.

1. After clean installation changed passwords and added google voice.
2. added lines to end of the IPtables file /etc/iptables/rules.v4 (I did not use add-fqdn/add-ip maybe I should?)
Code:
#Callcentric IP addresses
-A INPUT -s 204.11.192.0/24 -p udp -m udp --dport 5060:5080 -j ACCEPT
-A INPUT -s 204.11.192.0/24 -p tcp -m tcp --dport 5060:5080 -j ACCEPT
-A INPUT -s 66.193.176.0/24 -p udp -m udp --dport 5060:5080 -j ACCEPT
-A INPUT -s 66.193.176.0/24 -p tcp -m tcp --dport 5060:5080 -j ACCEPT
# your own additions go above here
3. Followed Callcentric support article exactly (http://www.callcentric.com/support/device/freepbx)
4. Made sure that all DIDs in my Callcentric account were routing to the default/x100 using the Callcentric dashboard -->DID forwarding
5. In web GUI Settings--> Asterisk SIP Settings--> Chan sip set "Allow SIP Guests=Yes"

Next up getting the Callcentric DIDs to route to different places.
 
Last edited:

James L

New Member
Joined
Nov 20, 2015
Messages
14
Reaction score
1
Attempt 3, Part 2: I now have Callcentric incoming DIDs routed separately and outgoing calls working as well.

1. Get "Attempt 3, Part 1" post above working properly.
2. Follow the instructions from Callcentric posted at: https://www.callcentric.com/support/device/did_trixbox
3. For the "Required edit to Callcentric Trunk..." step, change "context=from-pstn" to "context=incoming" in the /etc/asterisk/sip_general_custom.conf file edited in part 1, leave the other lines alone. Save the file!
4. Then in the web interface edit the callcentric trunk's registration string, removing the "/1777#######" at the end. Save configuration by pressing "submit" and then "Apply" buttons.
5. For "Creating or editing the inbound context" step add the [incoming] code to the end of the /etc/asterisk/extensions_custom.conf file. Save file and restart with "amportal restart"
7. For "Configure your inbound routing to route" add an incoming route for each DID in web interface.
For US numbers:
Description=callcentricDID1
DID Number=1NNNNNNNNNN {make sure to include the 1}​
For iNUM numbers:
Description=callcentricDID2
DID Number=883510######### {no leading 1}​
8. Click "Apply" button to save/apply routes
9. "amportal restart" from command line for good measure.

This has all my Callcentric DIDs working properly and outgoing calls as well. Hopefully this saves someone a bit of the headaches I had getting it all set up. Thanks for all the help!
 

James L

New Member
Joined
Nov 20, 2015
Messages
14
Reaction score
1
So now that I have Callcentric routing DIDs based on their instructions (outlined in Attempt 3, Part 1&2 above). Is there an advantage to trying to get the method outlined in post 5265 working? It seems that the thread's method is a bit more secure as it is tied to a specific Callcentric 1777 account number. But before I try to get that all working, could someone help me understand the security risk/advantages of the two methods?

Thanks!
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
So now that I have Callcentric routing DIDs based on their instructions (outlined in Attempt 3, Part 1&2 above). Is there an advantage to trying to get the method outlined in post 5265 working? It seems that the thread's method is a bit more secure as it is tied to a specific Callcentric 1777 account number. But before I try to get that all working, could someone help me understand the security risk/advantages of the two methods?

The 5265 post more closely follows the standard context for anonymous calls. What I use is something in between. If incoming connections are restricted to the callcentric IPs there shouldn't be much of an issue.
 

James L

New Member
Joined
Nov 20, 2015
Messages
14
Reaction score
1
Attempt 4: (Callcentric & SIP2SIP) Using the previously working Callcentric settings from Attempt 3, parts 1-2 I tried to add a SIP2SIP URI using the Nerd Vittles tutorial (http://nerdvittles.com/?p=6914). The result was callcentric worked as expected but SIP2SIP had intermittent connectivity.

I searched the forums and tried implementing the "SIP2SIP congestion" workaround to see if that solved the problem (http://pbxinaflash.com/community/index.php?threads/sip2sip-settings-for-piaf.10555/#post-83847). First I edited the "extensions_override_freepbx.conf" file as suggested, adding a [from-sip-external] section with the following inserted.
Code:
exten => 223XXXXXXX,1,Dial(local/53669@from-internal)
This just didn't work.

After some troubleshooting Asterisk was saying "extension 223XXXXXXX rejected because not found in INCOMING". Since [INCOMING] was the name of the callcentric context I removed the "extensions_override_freepbx.conf" code and tried adding the [from-sip-external] section with custom code from above to the "/etc/asterisk/extensions_custom.conf" file. This didn't work either.

Next, I deleted the [from-sip-external] section with custom code from the "/etc/asterisk/extensions_custom.conf" and just added the "exten => 223XXXXXXX,1,Dial(local/53669@from-internal)" into the [incoming] context for callcentric. This allowed SIP2SIP URIs to work but broke the callcentric trunks.

Lastly, I went back to the working Callcentric configuration from Attempt 3, parts 1-2. Then added the SIP2SIP URI as instructed in the tutiorial. I did not add the "SIP2SIP congestion" workaround. Next, I added the code for [from-sip-external-custom] from David's post in the 5265 thread (http://pbxinaflash.com/community/in...-incoming-did-routing-solved.5265/#post-46136) to "extensions_custom.conf" file. I then deleted the [incoming] code added into extensions_custom.conf as part of Attempt 3. In the "sip_general_custom.conf" file I changed the "context=incoming" to "context=from-sip-eternal-custom". Using the web interface I edited the Callcentric Trunk PEER details to now say "context=from-sip-eternal-custom" as well. Last step was through the web interface Settings-->Asterisk SIP settings-->Chan SIP to make "Defualt Context = from-pstn".

This last step allowed my callcentric DIDs to route properly as configured through the web interface and for incoming SIP2SIP URI calls to be routed with an incoming destination through the web interface as well.

If anyone sees anything glaringly wrong please let me know, but I think this is a working configuration I will use for awhile. Thanks!
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,170
Reaction score
5,199
Mango's CallCentric setup that "just works"...

1) Edit sip_custom.conf in /etc/asterisk.
2) Add the following and restart Asterisk:

Code:
[callcentric_freepbx](!)
type=peer
context=MATCH_THE_CONTEXT_FOR_YOUR_CALLCENTRIC_PEER_IN_SIP.CONF
host=callcentric.com
fromdomain=callcentric.com
defaultuser=1777_YOUR_CCID
fromuser=1777_YOUR_CCID
secret=YOUR_SECRET_HERE
insecure=port,invite
disallowed_methods=UPDATE
directmedia=no
videosupport=no
disallow=all
allow=ulaw
 
[callcentric1](callcentric_freepbx);
host=alpha1.callcentric.com
 
[callcentric2](callcentric_freepbx);
host=alpha2.callcentric.com
 
[callcentric3](callcentric_freepbx);
host=alpha3.callcentric.com
 
[callcentric4](callcentric_freepbx);
host=alpha4.callcentric.com
 
[callcentric5](callcentric_freepbx);
host=alpha5.callcentric.com
 
[callcentric6](callcentric_freepbx);
host=alpha6.callcentric.com
 
[callcentric7](callcentric_freepbx);
host=alpha7.callcentric.com
 
[callcentric8](callcentric_freepbx);
host=alpha8.callcentric.com
 
[callcentric9](callcentric_freepbx);
host=alpha9.callcentric.com
 
[callcentric10](callcentric_freepbx);
host=alpha10.callcentric.com
 
[callcentric11](callcentric_freepbx);
host=alpha11.callcentric.com
 
[callcentric12](callcentric_freepbx);
host=alpha12.callcentric.com
 
[callcentric13](callcentric_freepbx);
host=alpha13.callcentric.com
 
[callcentric14](callcentric_freepbx);
host=alpha14.callcentric.com
 
[callcentric15](callcentric_freepbx);
host=alpha15.callcentric.com
 
[callcentric16](callcentric_freepbx);
host=alpha16.callcentric.com
 
[callcentric17](callcentric_freepbx);
host=alpha17.callcentric.com
 
[callcentric18](callcentric_freepbx);
host=alpha18.callcentric.com
 
[callcentric19](callcentric_freepbx);
host=alpha19.callcentric.com
 
[callcentric20](callcentric_freepbx);
host=alpha20.callcentric.com
 
[callcentricA](callcentric_freepbx);
host=doll3.callcentric.com
 
[callcentricB](callcentric_freepbx);
host=doll4.callcentric.com
 
[callcentricC](callcentric_freepbx);
host=doll5.callcentric.com
 

Members online

Forum statistics

Threads
25,782
Messages
167,512
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top