First of all I would like to thank Jerson Júnior for his help sharing his config and making himself available via Skype.
As promised I am documenting here some lessons learned and I will also try to consolidate information from various places.
My setup:
- Country: Brazil
- Telco: Embratel
- Link type: E1 R2
Implementation scenario:
Embratel E1 <-> Freepbx (Digium TE235 -2 span E1) <-> Legacy PBX (Siemens Hipath 1150)
IMPORTANT: First lesson learned and that made me waste about a week banging my head against the wall is that Digium cards do not work with VMware ESX 5.5 using the PCI pass-through feature (hopefully in the future they will).
Things became much clearer and easier to debug when setting up in a bare metal environment. So if you’re planning on installing a digital telephony card in ESX I suggest you previously do all the lab tests on bare metal and only then try to replicate in a VM.
Links to relevant information used in the setup.
-
-
-
-
- README with various MFCR2 sample configurations for countries AR, BR, EC, MX, VE - download TAR.GZ from https://libopenr2.org/ and open the path “/openr2-1.3.3/doc/asterisk/”. Configs here are pretty accurate and should work with minimum tweaks.
-
-
- Youtube Crosstalk - Freepbx 101 (very nice kickstart)
!!!Before anything!!! MFCR2 is not available as a configuration option within FreePBX GUI. So you will have to manually edit the config files. With that said, you should not use CONNECTIVITY -> DAHDI CONFIGURATION in FreePBX. If you inadvertently do It will even prompt you to enable the DAHDI WRITE TO CONFIG and if you accidentally enable this you will have to later disable it under SEETINGS -> ADVANCED SETTINGS because otherwise your config files will be overwritten on every service restart.
0) Config your files
Hardware setup -> /etc/dahdi/system.conf
Channels setup -> /etc/dahdi/chan_dahdi.conf (and all chan_dahdi_*.conf)
You may also disable modules not used by your card in /etc/dahdi/modules.
1) Check if HARDWARE came up OK.
Ensure your DAHDI interface is coming up OK. To see errors try restarting the service from SSH console (service dahdi restart).
cat /proc/dahdi/1
(should show SPAN 1 channels)
For eg.:
Span 1: WCTE2/0/1 “WCTE23X (PCI) Card 0 Span 1” HDB3 ClockSource
1 WCTE2/0/1/1 CAS (In use) (EC: VPMOCT064 - INACTIVE)
2 WCTE2/0/1/2 CAS (In use) (EC: VPMOCT064 - INACTIVE)
3 WCTE2/0/1/3 CAS (In use) (EC: VPMOCT064 - INACTIVE)
4 WCTE2/0/1/4 CAS (In use) (EC: VPMOCT064 - INACTIVE)
5 WCTE2/0/1/5 CAS (In use) (EC: VPMOCT064 - INACTIVE)
6 WCTE2/0/1/6 CAS (In use) (EC: VPMOCT064 - INACTIVE)
...
dahdi_cfg -vvv will give even more info.
[[email protected] asterisk]# dahdi_cfg -vvv
DAHDI Tools Version - 2.11.1
DAHDI Version: 2.11.1
Echo Canceller(s): HWEC
Configuration
======================
SPAN 1: CAS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
SPAN 2: CAS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1)
Channel map:
Channel 01: CAS / User (Default) (Echo Canceler: none) (Slaves: 01)
Channel 02: CAS / User (Default) (Echo Canceler: none) (Slaves: 02)
Channel 03: CAS / User (Default) (Echo Canceler: none) (Slaves: 03)
Channel 04: CAS / User (Default) (Echo Canceler: none) (Slaves: 04)
Channel 05: CAS / User (Default) (Echo Canceler: none) (Slaves: 05)
Channel 06: CAS / User (Default) (Echo Canceler: none) (Slaves: 06)
...
Check for ALARMS running “dahdi_tool”, spans should state OK
2) Check DAHDI channels state.
Connect to ASTERISK CLI by "asterisk -r"
View channels “dadhi show channels”
If everything is looking good then basically you just need to setup call routing within FreePBX. Otherwise you will need more tweaking with the config files.
3) Setup Trunks in FreePBX
4) Setup an OUTBOUND ROUTE in FreePBX
5) Setup an INBOUND ROUTE in FreePBX
Debugging
- use ASTERISK CLI enable debugging “core set debug 1” (1 or more)
- /var/log/asterisk/mfcr2 (enable logging in chan_dahdi.conf)
Good luck!!!