Unable to create channel of type 'DAHDI' (Cause 0 - Unknown)

Hi,
I have a fedora21 box with asterisk-11.14.1 and a basic FXO card connected and I can’t get it to work. This is a migration from an existing working system. I’m a relative asterisk novice, so hoped someone could help.

I’m pretty sure dahdi is working properly:

[code]# service dahdi status

Span 1: WCTDM/4 “Wildcard TDM400P REV I Board 5” (MASTER)

1 FXO FXSKS
2 FXO FXSKS RED
3 FXO FXSKS RED
4 FXO FXSKS RED[/code]

However, when I try to place an outbound call:

== Using SIP RTP CoS mark 5 -- Executing [12125556712@trusted:1] AGI("SIP/7003-00000001", "make-outgoing.agi,7003,12125556712") in new stack -- Launched AGI Script /usr/share/asterisk/agi-bin/make-outgoing.agi [May 21 13:18:55] ERROR[7497][C-00000001]: utils.c:1362 ast_carefulwrite: write() returned error: Broken pipe [May 21 13:18:55] ERROR[7497][C-00000001]: utils.c:1362 ast_carefulwrite: write() returned error: Broken pipe -- <SIP/7003-00000001>AGI Script make-outgoing.agi completed, returning 0 -- Executing [12125556712@trusted:2] Set("SIP/7003-00000001", "CALLERID(all)=12123217300") in new stack -- Executing [12125556712@trusted:3] NoOp("SIP/7003-00000001", "[outgoing] STARTING -- 05/21/2015 - 13:18:55") in new stack -- Executing [12125556712@trusted:4] Dial("SIP/7003-00000001", "DAHDI/1/12125556712") in new stack [May 21 13:18:55] WARNING[7497][C-00000001]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'DAHDI' (cause 0 - Unknown) == Everyone is busy/congested at this time (1:0/0/1) -- Auto fallthrough, channel 'SIP/7003-00000001' status is 'CHANUNAVAIL' -- Executing [h@trusted:1] NoOp("SIP/7003-00000001", "[trusted] CALL ENDING -- 05/21/2015 - 13:18:55") in new stack

It seems every time I start dahdi, it’s necessary to fix the ownership of the files in /dev/dahdi from root to ‘asterisk’. Why are they not set correctly automatically?

I see many references to this question online, but after hours and hours of working with this, nothing has worked. I’m not even sure what information I should provide to make troubleshooting easier.

Here is /etc/asterisk/dahdi-channels.conf

; Span 1: WCTDM/4 "Wildcard TDM400P REV I Board 5" (MASTER) 
;;; line="1 WCTDM/4/0"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 1
callerid=
group=
context=default

;;; line="2 WCTDM/4/1"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 2
callerid=
group=
context=default

;;; line="3 WCTDM/4/2"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 3
callerid=
group=
context=default

;;; line="4 WCTDM/4/3"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 4
callerid=
group=
context=default

And sip.conf:

[general] port = 5060 bindaddr = 192.168.1.1 context = incoming limitonpeers = yes deny = 0.0.0.0/0.0.0.0 permit = 192.168.1.0/255.255.255.0 ; INSIDE permit = 64.11.22.0/255.255.255.224 disallow = all allow = ulaw [7003] type = friend accountcode = dave host = dynamic defaultuser = Bob secret = Bob-7003 mailbox = 7003@local dtmfmode = rfc2833 callerid = Bob <7003> context = trusted qualify = yes canreinvite = no call-limit = 5

And the dahdi modules:

# lsmod|grep dahdi dahdi 225985 1 wctdm crc_ccitt 12613 1 dahdi

Any ideas greatly appreciated.
Thanks,
Alex

Seems like in asterisk the dahdi module is not loaded, try with: module load chan_dahdi.so in the asterisk console.

Ownership depends on how you install your system if you built all to use asterisk user as owner then start everything as that user.

Device files are typically in a dev filesytem so will start with the same ownership every time you boot. It is normal for devices to be owned by root.

It said that it was already loaded.

It was necessary to add a chown in the init script provided in the fedora asterisk-dahdi package.

Unless you know of another way? I don’t understand how such a big error could be made in packaging, but I’m unable to find another (the proper?) way to do this.

It turns out the issue appeared to be the result of incorrect permission on the chan_dahdi.conf file in /etc/asterisk. Somehow it was owned by root instead of asterisk.

I’d still really like to know why the permissions on /dev/dahdi are incorrect.

The normal build process for Asterisk sets things up for running as root. If you run have a package that intentionally runs as something other than root, it is up to the packages to make the necessary changes. As far as I know, the only packages created by the main developers are for CentOS.

I compiled and installed the modules from source on this fedora21 system, but asterisk-dahdi package, shipped with fedora21, contains the init script that actually loads the modules.