With DAHDI, this turns out not to be so bad. Once you add the physical hardware, There is just a few DAHDI related commands to run, and a small section of extensions.conf to change.
Note: Throughout I use the parameter -vvvvv to indicate as much as verboseness as possible. I use all 5 v’s from habit because of Asterisk’s console command (more of a make sure it’s as verbose as possible by adding many v’s).
First (after installing the hardware), run dahdi_scan as root to make sure it’s detected. Your output should look similar to mine:
mikerm@asterisk:~$ sudo dahdi_scan -vvvvv [1] active=yes alarms=OK description=Wildcard TDM410P name=WCTDM/0 manufacturer=Digium devicetype=Wildcard TDM410P location=PCI Bus 00 Slot 12 basechan=1 totchans=4 irq=0 type=analog port=1,FXS port=2,FXS port=3,none port=4,FXO mikerm@asterisk:~$
Then, run dahdi_cfg as to configure DAHDI to accept the current hardware setup:
mikerm@asterisk:~$ sudo dahdi_cfg -vvvvv DAHDI Tools Version - 2.10.0.1 DAHDI Version: 2.10.0.1 Echo Canceller(s): MG2 Configuration ====================== Channel map: Channel 01: FXO Kewlstart (Default) (Echo Canceler: mg2) (Slaves: 01) Channel 02: FXO Kewlstart (Default) (Echo Canceler: mg2) (Slaves: 02) Channel 04: FXS Kewlstart (Default) (Echo Canceler: mg2) (Slaves: 04) 3 channels to configure. Setting echocan for channel 1 to mg2 Setting echocan for channel 2 to mg2 Setting echocan for channel 4 to mg2 mikerm@asterisk:~$
Now, run dahdi_genconf as root to re-generate the other configuration files to set up signalling:
mikerm@asterisk:~$ sudo dahdi_genconf -vvvvv Default parameters from /etc/dahdi/genconf_parameters Generating /etc/dahdi/assigned-spans.conf Generating /etc/dahdi/system.conf Generating /etc/asterisk/dahdi-channels.conf mikerm@asterisk:~$
If you have a Digium TDM400P/800P/2400P card, also see: fxotune
If this is the first time configuring DAHDI, make sure “#include /etc/asterisk/dahdi-channels.conf” is under the “channels” context in chan_dahdi.conf:
[channels] #include /etc/asterisk/dahdi-channels.conf ----- snip -----
Now we get to play in extensions.conf. If you check out /etc/asterisk/dahdi-channels.conf, you should see an entry similar to this:
;;; line="4 WCTDM/0/3 FXSKS (EC: MG2 - INACTIVE)" signalling=fxs_ks callerid=asreceived group=0 context=from-pstn channel => 4 callerid= group= context=default
By default, we now have a context “from-pstn” that we need to either add, or modify in extensions.conf. Here is a part of mine as an example.
[from-pstn] exten => s,1,NoOp(Incomming call from PSTN: ${CALLERID(all)}) exten => s,n,JabberSend(asterisk,${mikerm},Incomming call from: ${CALLERID(all)}
Note: Don’t assume that only having NoOp in a context will at least spit out a message if it’s called. It actually doesn’t do anything unless there is something else below it that works correctly.