FreePBX upgrade from 2.6 to 2.7 breaks DAHDI

With FreePBX 2.6, everything works great, but when i upgraded to 2.7, i am getting this error when i attempt to dial out from my dahdi interface, – Executing [s@macro-user-callerid:19] NoOp(“DAHDI/2-1”, “Using CallerID “dudee” <551>”) in new stack – Auto fallthrough, channel ‘DAHDI/2-1’ status is ‘UNKNOWN’. any number dial, leds to an engage tone. Please advice.

Detailed logging and configuration available at
http://pastebin.com/7pi4V6bH

It seems that you have /etc/asterisk/dahdi_channels.conf configured by dahdi_genconf. It arbitrarily configures your dahdi channels for extensions 4001-400x. It’s great if you want to have an out of the box setup using those extensions but can cause grief if you also configure your extensions through FreePBX.

I noticed that some of your channels are listed as loop start (ls) devices but are configured as kewlstart (ks). I don’t know if this is just a comment issue or not. Post your /etc/dahdi/system.conf file to see what is matching up.

Normally, I delete the line in /etc/asterisk/chan_dahdi.conf that links to /etc/asterisk/dahdi_channels.conf. Here’s my plan of attack when configuring dahdi:

  1. /etc/dahdi/system.conf - this is the Linux hardware driver interface. dahdi_genconf does a pretty good job of finding the hardware. The main thing is that each channel must have the proper signaling configured and an echo cancellor (usually mg2)

  2. /etc/asterisk/chan_dahdi.conf <= This is the asterisk software interface to the hardware, it points to chan_dahdi_additional.conf and chan_dahdi_custom.conf (I remove any references to dahdi_channels.conf)

  3. /etc/asterisk/chan_dahdi_additional.conf <= FreePBX creates FXS extensions here, don’t touch. Look to verify that the signaling matches /etc/dahdi/system.conf. If it doesn’t, change it in FreePBX to match.

  4. /etc/asterisk/chan_dahdi_custom.conf <= may not exist but create it and put your FXO trunks and T1 trunk info in here. FreePBX won’t touch this file.

Once you clean up those files, from the Linux command prompt, stop asterisk: “amportal stop”, restart dahdi: “service dahdi restart”, start asterisk: “amportal start”. Check asterisk’s log file (extremely large) at /var/log/asterisk/full to see if dahdi has loaded properly. There’s a lot of good dahdi error messages that are extremely useful for troubleshooting that pop up in there. For example, if your hardware uses kewlstart and you’ve configured it as loopstart, an error message will complain about it. You will have to do a bit of searching as its a HUGE file. Don’t be intimidated as the more familiar you become with it the better. Search for “dahdi”.

From the Asterisk CLI>, you can type:

“help dahdi” <= if configured properly, help menus will appear, if no help menus, look at the asterisk log file for clues.
“dahdi show channels” <= this will show all the configured channels that asterisk is aware of. You may have more channels but haven’t used them yet.

Unfortunately, if there is one error in the dahdi config, then dahdi chokes and fails.

Hi Eugene,

I have made changes and verified all are as according to system.conf using ks instead of ls.

Same issue.

I will paste the requested config files.

[root@pbx ~]# cat /etc/dahdi/system.conf

Autogenerated by /usr/sbin/dahdi_genconf on Tue Mar 9 20:46:57 2010

If you edit this file and execute /usr/sbin/dahdi_genconf again,

your manual changes will be LOST.

Dahdi Configuration File

This file is parsed by the Dahdi Configurator, dahdi_cfg

Span 1: WCTDM/0 “Wildcard TDM2400P Board 1” (MASTER)

fxoks=1
echocanceller=mg2,1
fxoks=2
echocanceller=mg2,2
fxoks=3
echocanceller=mg2,3
fxoks=4
echocanceller=mg2,4
fxoks=5
echocanceller=mg2,5
fxoks=6
echocanceller=mg2,6
fxoks=7
echocanceller=mg2,7
fxoks=8
echocanceller=mg2,8
fxoks=9
echocanceller=mg2,9
fxoks=10
echocanceller=mg2,10
fxoks=11
echocanceller=mg2,11
fxoks=12
echocanceller=mg2,12
fxoks=13
echocanceller=mg2,13
fxoks=14
echocanceller=mg2,14
fxoks=15
echocanceller=mg2,15
fxoks=16
echocanceller=mg2,16
fxoks=17
echocanceller=mg2,17
fxoks=18
echocanceller=mg2,18
fxoks=19
echocanceller=mg2,19
fxoks=20
echocanceller=mg2,20
fxsks=21
echocanceller=mg2,21
fxsks=22
echocanceller=mg2,22
fxsks=23
echocanceller=mg2,23
fxsks=24
echocanceller=mg2,24

Global data

loadzone = us
defaultzone = us


[root@pbx ~]# cat /etc/asterisk/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
;toneduration=100
#include dahdi-channels.conf
#include chan_dahdi_additional.conf
;tonezone=sg

; XTDM20B Port #1,2 plugged into PSTN
;AMPLABEL:Channel %c - Button %n
;context=from-pstn
;signalling=fxs_ks
;faxdetect=incoming

busydetect=yes
hanguponpolarityswitch=yes

echocancel=1024
echocancelwhenbridged=no
echotraining=800
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
;usecallerid=no

usecallerid = yes
cidsignalling = bell
cidstart = ring
sendcalleridafter=2
relaxdtmf=yes


[root@pbx ~]# cat /etc/asterisk/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 ;
;--------------------------------------------------------------------------------;
;

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

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

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

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

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

[root@pbx ~]#


Anyone available to diagnose the error from the logs and confs provided?

Remove “#include dahdi-channels.conf” from /etc/asterisk/chan_dahdi.conf and don’t run dahdi_genconf again unless you want to start over again.

What happeneded to channel 1? Not using it? Channel 1 should correspond to port 1.

Looks like you have it set up as:

Extensions 551-555 mapped to channel 2-6 in no particular order.

After removing the above include, stop asterisk, restart dahdi and then start asterisk again. From the asterisk CLI> type the following command “dahdi show channels” Do channels 2 to 6 show up? If not go back to /var/log/asterisk/full and examine the log file looking for the section where the dahdi channels are being loaded. That will give you clues as to what is going wrong. Here’s a website that will take you step by step through testing and troubleshooting dahdi

Hi Eugene,

I will remove the #include dadhi-channels.conf and see how that works.

Channel one was actually to my extension, but it was abit ‘noisy’ , so I left one and move all upwards.

Wierdly enough, if i stay with FreePBX 2.6, i dont face any issues, but attempts to go to 2.7 sees issues?

Do you have any online means of contacting you for assistance? e.g. IM?

Hi Eugene,

Same thing.
Auto fallthrough, channel ‘DAHDI/2-1’ status is 'UNKNOWN’
Removed from the conf file, restarted.

pbxCLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
2 from-internal en default In Service
3 from-internal en default In Service
4 from-internal en default In Service
5 from-internal en default In Service
6 from-internal en default In Service
pbx
CLI>

6 Channels available which is the freepbx conf file.

Please advice.

In /etc/amportal.conf do you have the following line?

ZAP2DAHDICOMPAT=true

Hi Eugene,

Yes, i have the following

ZAP2DAHDICOMPAT=true

in /etc/amportal.conf