The following is meant to be step by step guide to aid in configuring an asterisk system for use with the OpenR2 library and Sangoma PRI cards. If you have not already installed the OpenR2 library then please do that now.
Wanpipe Configuration
After wanpipe is installed you can configure asterisk to use the card using our configuration script. Once in this configuration script and after having selected an E1 configuration make sure to select the E&M Wink signalling type.
wancfg_dahdi |
... Select signalling type for AFT-A108 on port 1 [slot:4 bus:5 span:1] 1. Zaptel/Dahdi - PRI CPE 2. Zaptel/Dahdi - PRI NET 3. Zaptel/Dahdi - E & M 4. Zaptel/Dahdi - E & M Wink 5. Zaptel/Dahdi - FXS - Loop Start 6. Zaptel/Dahdi - FXS - Ground Start 7. Zaptel/Dahdi - FXS - Kewl Start 8. Zaptel/Dahdi - FX0 - Loop Start 9. Zaptel/Dahdi - FX0 - Ground Start 10. Zaptel/Dahdi - FX0 - Kewl Start 11. Sangoma SMG/sangoma_prid- PRI CPE 12. Sangoma SMG/sangoma_prid- PRI NET [1-12]:4 .... |
This will create a wanpipe.conf file such as this: wanpipe1.conf
Asterisk Configuration
The chan_dahdi module config file will need to be manually re-written. Below is an example template for a Sangoma A101 card.
Please copy and paste this into your /etc/asterisk/chan_dahdi.conf file and remove the portion generated by the E&M wink configuration.
#Sangoma A108 port 1 [slot:4 bus:5 span:1] <wanpipe1> |
NOTE*: this example is for the Mexico variant
Here is a copy of chan_dahdi.conf but with an additional entry for use with an A102 Sangoma card: chan_dahdi.conf
Also copy and paste the following into your /etc/dahdi/system.conf and remove the part from the E&M wink configuration.
#Sangoma A101 port 1 [slot:4 bus:2 span:1] <wanpipe1> span=1,1,0,cas,hdb3 cas=1-15,17-31:1101 dchan=16 echocanceller=mg2,1-15,17-31 |
Here is a copy of /etc/dahdi/system.conf but with an additional entry for use with an A102 Sangoma card: system.conf
Note: if you experience alarms on the link comment out the dchan=16 line
Testing your config files
Now you can start wanrouter and dahdi:
wanrouter start dahdi_cfg -vvv |
Starting WAN Router... DAHDI Tools Version - 2.6.1 DAHDI Version: 2.6.1 SPAN 1: CAS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1) Channel map: Channel 01: CAS / User (Default) (Echo Canceler: mg2) (Slaves: 01) ... Changing idle bits of channel 20 from 0 to 13 |
NOTE*: If you see any errors in the above output it means you have incorrectly composed your Dahdi configuration files.
Double check that your files look similar to the examples above and then try restarting Dahdi again.
Enter the Asterisk CLI and run some commands to double check that the library is properly initialized via the chan_dahdi.so module.
The following command will list all the OpenR2 configured channels on your system.
*CLI> mfcr2 show channels |
Chan Variant Max ANI Max DNIS ANI First Immediate Accept Tx CAS Rx CAS 1 MX 10 4 No No IDLE BLOCK 2 MX 10 4 No No IDLE BLOCK 3 MX 10 4 No No IDLE BLOCK 4 MX 10 4 No No IDLE BLOCK 5 MX 10 4 No No IDLE BLOCK 6 MX 10 4 No No IDLE BLOCK 7 MX 10 4 No No IDLE BLOCK 8 MX 10 4 No No IDLE BLOCK 9 MX 10 4 No No IDLE BLOCK 10 MX 10 4 No No IDLE BLOCK |
You can also check your OpenR2 library version from within the Asterisk CLI.
*CLI> mfcr2 show version |
OpenR2 version: 1.3.2, revision: exported |
One final check might be to list the library signalling variants.
*CLI> mfcr2 show variants |
Variant Code Country AR Argentina BR Brazil CN China CZ Czech Republic CO Colombia EC Ecuador ID Indonesia ITU International Telecommunication Union MX Mexico PH Philippines VE Venezuela |
If you see the outputs shown above then you can be very confident that the OpenR2 library has been properly installed and linked into Asterisk.
You can now move on to more advanced configuration options such as choosing your R2 signalling variant and log settings.