Sunday, September 28, 2008

The VoIP Experience #64 - Interview with Philippe Lindheimer of FreePBX


The VoIP Experience #64 - Interview with Philippe Lindheimer of FreePBX

The topics in this interview include the recently released FreePBX 2.5 and some of the enhancements that this release has brought to the utilization of Asterisk, including the announced AsteriskNow 1.5 with FreePBX. This combined with the FreePBX Open Telephony Training Seminar at Digium Headquarters next week promises to keep this fall interesting.

The VoIP Experience #63 - Summer is over and I am back.


The VoIP Experience #63 - Summer is over and I am back.

Time to get back to work.

Sunday, September 7, 2008

DAHDI, no jokes version with FreePBX

It has been a while since I have blogged and I guess it is about time to get down and funky...Or better yet, how about down and DAHDI ? So much for the no jokes rule. At the very least, that one is original ;)

DAHDI or Digium Asterisk Hardware Device Interface is (or at least should be) a name change away from Zaptel. The reasons are found here.

All that aside, I am simply going to explain how I am testing DAHDI.

I started with a PC w/TDM400 and one FXS module and loaded PBX in a Flash 1.3 brought FreePBX up to 2.5.0rc2.4 and then hand compiled Zaptel 1.4.12, DAHDI-2.0.0-rc3+rc2 and Asterisk 1.4.22.rc3.
The interesting part is that FreePBX 2.5 ( when released ) will have the ability to use Zaptel or DAHDI. No joke. On the left is a snippet from my test box. Zaptel gone... DAHDI in.

OK, "DAHDI in" if you follow my basic tenant of IT goodness, which is "Surround yourself with really smart people." So, ahem... DAHDI in thanks to some help from Philippe Lindheimer.

Basically, the DAHDI installation introduces a few new configuration files. I am going to list the directories and the contents and then the contents of my files.

/etc/dahdi/ "init.conf , system.conf , modules"

and

/etc/asterisk/"chan_dahdi_additional.conf , chan_dahdi.conf , dahdi-channels.conf , chan_dahdi.conf.template"

So, first the /etc/dahdi/

init.conf:
#
# Shell settings for Dahdi initialization scripts.
# This replaces the old/per-platform files (/etc/sysconfig/zaptel,
# /etc/defaults/zaptel)
#

# The maximal timeout (seconds) to wait for udevd to finish generating
# device nodes after the modules have loaded and before running dahdi_cfg.
#DAHDI_DEV_TIMEOUT=40

# Override settings for xpp_fxloader
#XPP_FIRMWARE_DIR=/usr/share/dahdi
#XPP_HOTPLUG_DISABLED=yes

system.conf:
# Autogenerated by /usr/sbin/dahdi_genconf on Sun Sep 7 12:00:22 2008 -- do not hand edit
# Dahdi Configuration File
#
# This file is parsed by the Dahdi Configurator, dahdi_cfg
#
# Span 1: WCTDM/4 "Wildcard TDM400P REV I Board 5" (MASTER)
# channel 1, WCTDM/4/0, no module.
# channel 2, WCTDM/4/1, no module.
# channel 3, WCTDM/4/2, no module.
# channel 4, WCTDM/4/3, no module.

# Global data

fxoks=1 # internal phones

loadzone = us
defaultzone = us

echocanceller=mg2,1,2,4

modules:
# Contains the list of modules to be loaded / unloaded by /etc/init.d/dahdi.
#
# NOTE: Please add/edit /etc/modprobe.d/dahdi or /etc/modprobe.conf if you
# would like to add any module parameters.
#
# Format of this file: list of modules, each in its own line.
# Anything after a '#' is ignore, likewise trailing and leading
# whitespaces and empty lines.

# TE405P - Quad Span T1/E1 Card (5v version)
# TE410P - Quad Span T1/E1 Card (3.3v version)
# wct4xxp

# * TE120P - Single Span T1/E1 Card
# wcte12xp

# T100P - Single Span T1 Card
# E100P - Single Span E1 Card
# wct1xxp

# TE110P - Single Span T1/E1 Card
# wcte11xp

# TDM2400P - Modular FXS/FXO interface (1-24 ports)
# TDM410P - Modular FXS/FXO interface (4 ports)
# TDM800P - Modular FXS/FXO interface (8 ports)
# wctdm24xxp

# X100P - Single port FXO interface
# X101P - Single port FXO interface
# wcfxo

# TDM400P - Modular FXS/FXO interface (1-4 ports)
wctdm

# DAHDI timing only interface. Disabled by default, as it will be loaded
# by the init.d script in case no hardware is found.
#
# If you have no hardware, enable it and disable others.
#dahdi_dummy

# Xorcom Astribank Device
# xpp_usb

And now the /etc/asterisk/

chan_dahdi.conf.template:

;# Flash Operator Panel will parse this file for dahdi trunk buttons
;# AMPLABEL will be used for the display labels on the buttons

;# %c Dahdi Channel number
;# %n Line number
;# %N Line number, but restart counter
;# Example:
;# ;AMPLABEL:Channel %c - Button %n

;# For Dahdi/* buttons use the following
;# (where x=number of buttons to dislpay)
;# ;AMPWILDCARDLABEL(x):MyLabel


[channels]
language=en

; include dahdi extensions defined in FreePBX
#include chan_dahdi_additional.conf

; XTDM20B Port #1,2 plugged into PSTN
;AMPLABEL:Channel %c - Button %n
context=from-pstn
signalling=fxs_ks
faxdetect=incoming
usecallerid=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=800
group=0
channel=1-2
dahdi-channels.conf:
; Autogenerated by /usr/sbin/dahdi_genconf on Sun Sep 7 13:02:22 2008 -- do not hand edit
; Dahdi Channels Configurations (chan_dahdi.conf)
;
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/asterisk/chan_dahdi.conf that will include the global settings
;

; Span 1: WCTDM/4 "Wildcard TDM400P REV I Board 5" (MASTER)

chan_dahdi.conf:
;# Flash Operator Panel will parse this file for dahdi trunk buttons
;# AMPLABEL will be used for the display labels on the buttons

;# %c Dahdi Channel number
;# %n Line number
;# %N Line number, but restart counter
;# Example:
;# ;AMPLABEL:Channel %c - Button %n

;# For Dahdi/* buttons use the following
;# (where x=number of buttons to dislpay)
;# ;AMPWILDCARDLABEL(x):MyLabel


[channels]
language=en

; include dahdi extensions defined in FreePBX
#include chan_dahdi_additional.conf

chan_dahdi_additional.conf:
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

;;;;;;[7000]
signalling=fxo_ks
pickupgroup=
mailbox=7000@device
immediate=no
echotraining=800
echocancelwhenbridged=no
echocancel=yes
context=from-internal
callprogress=no
callgroup=
callerid=device <7000>
busydetect=no
busycount=7
accountcode=
channel=>1

Something that should be noted is that as DAHDI is really only being introduced to us, so is it just being introduced to FreePBX. So to speak. For now, we will still be speaking ZAP while we may be using DAHDI. The next picture is a GUI representation of the code in chan_dahdi_additional.conf.

But, all ( I think) I really had to do was stay out of chan_dahdi_additional.conf and let FreePBX do its job. That and instead of issue genzaptelconf... issue dahdi_genconf to get the auto configuration action going.

There are a few other commands to note:
ztcfg -> dahdi_cfg
ztmonitor -> dahdi_monitor

ztscan -> dahdi_scan

ztspeed -> dahdi_speed

zttest -> dahdi_test

zttool -> dahdi_tool


A couple of other things to note are this may not work yet with third party cards. I have only tested a Digium card and only one at that.

The FreePBX / DAHDI Integration that will come with 2.5 will of'course help speed along the adoption of DAHDI. When I first started to reseach where I was going wrong , I found only three posts on the Digium forums about DAHDI. I guess every one is smarter than me and didn't need any help...

There are quite a few more new features in FreePBX 2.5 that are of interest. This one is a good first step for DAHDI adoption rates. As always, I have more to report, but it must wait just a bit longer to break...