SOLVED ... dahdi kernel modules loaded, but no channels

Hi,

I upgraded a Debian box to jessie. That upgraded asterisk to 11.13 from 1.8. Post-upgrade, my pstn hardware is not being configured. There are two FXS modules and an FXO module on the digium card, but since the upgrade “CLI> dahdi show channels” returns an empty list save for a pseudo device.

I’ve been to the #asterisk IRC channel with this. They were not able to resolve the issue, but helped dig up some useful information. Here’s what I know about this:

[code]~# dahdi_cfg -s
Timeout waiting for all spans to be assigned.
~# dahdi_cfg -v
DAHDI Tools Version - 2.10.0.1
Timeout waiting for all spans to be assigned.

DAHDI Version: 2.10.0.1
Echo Canceller(s):
Configuration

3 channels to configure.

DAHDI_CHANCONFIG failed on channel 1: Invalid argument (22)
Selected signaling not supported
Possible causes:
FXO signaling is being used on a FXO interface (use a FXS signaling variant)
RBS signaling is being used on a E1 CCS span
Signaling is being assigned to channel 16 of an E1 CAS span
~# [/code]

Restarting dahdi sends nothing to the logs, but subsequently restarting asterisk the following is sent to /var/log/asterisk/messages (I think probably only lines 29 - 40 are the interesting ones) :

-------------- begin /var/log/asterisk/messages -------------- 01 [Jul 1 17:06:28] Asterisk 11.13.1~dfsg-2+b1 built by buildd @ x86-csail-01 on a i686 running Linux on 2015-01-06 03:30:17 UTC 02 [Jul 1 17:06:28] NOTICE[1118] cdr.c: CDR simple logging enabled. 03 [Jul 1 17:06:28] NOTICE[1118] loader.c: 227 modules will be loaded. 04 [Jul 1 17:06:28] WARNING[1118] loader.c: Error loading module 'app_stack.so': /usr/lib/asterisk/modules/app_stack.so: undefined symbol: ast_agi_unregister 05 [Jul 1 17:06:28] WARNING[1118] loader.c: Error loading module 'chan_dahdi.so': /usr/lib/asterisk/modules/chan_dahdi.so: undefined symbol: ast_smdi_interface_unref 06 [Jul 1 17:06:28] WARNING[1118] loader.c: Error loading module 'res_agi.so': /usr/lib/asterisk/modules/res_agi.so: undefined symbol: ast_speech_change 07 [Jul 1 17:06:28] WARNING[1118] loader.c: Error loading module 'func_aes.so': /usr/lib/asterisk/modules/func_aes.so: undefined symbol: ast_aes_set_decrypt_key 08 [Jul 1 17:06:28] WARNING[1118] loader.c: Error loading module 'cel_odbc.so': /usr/lib/asterisk/modules/cel_odbc.so: undefined symbol: SQLColumns 09 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'res_calendar_ews.so': /usr/lib/asterisk/modules/res_calendar_ews.so: undefined symbol: ast_calendar_register 10 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'app_queue.so': /usr/lib/asterisk/modules/app_queue.so: undefined symbol: ast_monitor_start 11 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'res_calendar_caldav.so': /usr/lib/asterisk/modules/res_calendar_caldav.so: undefined symbol: ast_calendar_event_container_alloc 12 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'cdr_odbc.so': /usr/lib/asterisk/modules/cdr_odbc.so: undefined symbol: SQLRowCount 13 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'pbx_ael.so': /usr/lib/asterisk/modules/pbx_ael.so: undefined symbol: ael2_parse 14 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'func_odbc.so': /usr/lib/asterisk/modules/func_odbc.so: undefined symbol: SQLRowCount 15 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'res_calendar_icalendar.so': /usr/lib/asterisk/modules/res_calendar_icalendar.so: undefined symbol: ast_calendar_register 16 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'chan_sip.so': /usr/lib/asterisk/modules/chan_sip.so: undefined symbol: ast_websocket_write 17 [Jul 1 17:06:29] NOTICE[1118] res_odbc.c: res_odbc loaded. 18 [Jul 1 17:06:29] NOTICE[1118] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener. 19 [Jul 1 17:06:29] ERROR[1118] pbx_lua.c: Error loading extensions.lua: cannot open '/etc/asterisk/extensions.lua' for reading: No such file or directory 20 [Jul 1 17:06:29] WARNING[1118] loader.c: Error loading module 'app_stack.so': /usr/lib/asterisk/modules/app_stack.so: undefined symbol: ast_agi_unregister 21 [Jul 1 17:06:29] WARNING[1118] loader.c: Module 'app_stack.so' could not be loaded. 22 [Jul 1 17:06:30] NOTICE[1118] config.c: Registered Config Engine curl 23 [Jul 1 17:06:30] NOTICE[1118] config.c: Registered Config Engine sqlite3 24 [Jul 1 17:06:30] NOTICE[1118] config.c: Registered Config Engine sqlite 25 [Jul 1 17:06:30] ERROR[1118] chan_motif.c: Connection 'local-jabber-account' configured on endpoint 'jingle-endpoint' could not be found 26 [Jul 1 17:06:30] ERROR[1118] config_options.c: Error parsing connection=local-jabber-account at line 81 of 27 [Jul 1 17:06:30] ERROR[1118] config_options.c: In motif.conf: Processing options for jingle-endpoint failed 28 [Jul 1 17:06:30] ERROR[1118] chan_motif.c: Unable to read config file motif.conf. Not loading module. 29 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Unable to specify channel 1: Invalid argument 30 [Jul 1 17:06:30] ERROR[1118] chan_dahdi.c: Unable to open channel 1: Invalid argument 31 [Jul 1 17:06:30] ERROR[1118] chan_dahdi.c: Unable to register channel '1' 32 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Dahdichan '1' failure ignored: ignore_failed_channels. 33 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Unable to specify channel 2: Invalid argument 34 [Jul 1 17:06:30] ERROR[1118] chan_dahdi.c: Unable to open channel 2: Invalid argument 35 [Jul 1 17:06:30] ERROR[1118] chan_dahdi.c: Unable to register channel '2' 36 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Dahdichan '2' failure ignored: ignore_failed_channels. 37 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Unable to specify channel 4: Invalid argument 38 [Jul 1 17:06:30] ERROR[1118] chan_dahdi.c: Unable to open channel 4: Invalid argument 39 [Jul 1 17:06:30] ERROR[1118] chan_dahdi.c: Unable to register channel '4' 40 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Dahdichan '4' failure ignored: ignore_failed_channels. 41 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Ignoring any changes to 'userbase' (on reload) at line 23. 42 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Ignoring any changes to 'vmsecret' (on reload) at line 31. 43 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Ignoring any changes to 'hassip' (on reload) at line 35. 44 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Ignoring any changes to 'hasiax' (on reload) at line 39. 45 [Jul 1 17:06:30] WARNING[1118] chan_dahdi.c: Ignoring any changes to 'hasmanager' (on reload) at line 47. 46 [Jul 1 17:06:30] NOTICE[1118] chan_skinny.c: Configuring skinny from skinny.conf 47 [Jul 1 17:06:33] NOTICE[1118] cel_tds.c: cel_tds has no global category, nothing to configure. 48 [Jul 1 17:06:33] WARNING[1118] cel_tds.c: cel_tds module had config problems; declining load 49 [Jul 1 17:06:33] NOTICE[1118] cdr_pgsql.c: cdr_pgsql configuration contains no global section, skipping module load. 50 [Jul 1 17:06:33] WARNING[1118] cel_pgsql.c: CEL pgsql config file missing global section. 51 [Jul 1 17:06:33] NOTICE[1118] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs. 52 [Jul 1 17:06:34] ERROR[1118] codec_dahdi.c: Failed to open /dev/dahdi/transcode: No such file or directory 53 [Jul 1 17:06:34] ERROR[1118] res_corosync.c: Failed to initialize cfg (6) 54 [Jul 1 17:06:34] NOTICE[1118] pbx_ael.c: Starting AEL load process. 55 [Jul 1 17:06:34] NOTICE[1118] pbx_ael.c: File /etc/asterisk/extensions.ael not found; AEL declining load -------------- end /var/log/asterisk/messages --------------

~# dahdi_scan ~# dahdi_hardware pci:0000:00:09.0 wctdm+ e159:0001 Wildcard TDM400P REV I ~#

~# lsmod | grep "dahdi\|wct" wctdm 37826 0 dahdi 206790 1 wctdm crc_ccitt 12331 1 dahdi ~#

[code]~# cat /etc/dahdi/system.conf

Autogenerated by /usr/sbin/dahdi_genconf on Mon Dec 22 20:01:24 2014

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/4 “Wildcard TDM400P REV I Board 5” (MASTER)

fxoks=1
echocanceller=oslec,1
fxoks=2
echocanceller=oslec,2

channel 3, WCTDM/4/2, no module.

fxsks=4
echocanceller=oslec,4

Global data

loadzone = us
defaultzone = us
~# [/code]

[code]~# cat /etc/asterisk/chan_dahdi.conf
; DAHDI Telephony Configuration file
;

[trunkgroups]
;
; Trunk groups are used for NFAS connections.
;

[channels]
;
; Default language
;
;language=en
;
;context=incoming
;
;
;echocancel=yes
;

POTSSet
usecallerid = yes
hidecallerid = no
callwaiting = no
threewaycalling = yes
transfer = yes
echocancel = yes
echotraining = yes
immediate = no
context = PostesInternes
signalling = fxo_ks ; fxo signalling for an fxs end-point

POTSline
context = EntrantsPSTN
signalling = fxs_ks

POTSphone_001
callerid = “XXXXXXXXXXX” <800 555 1212>
dahdichan = 1

POTSphone_002
callerid = “XXXXXXXXXXX” <800 555 1212>
dahdichan = 2

POTSline_001
dahdichan = 4
~# [/code]

And yet:

*CLI> dahdi show channels Chan Extension Context Language MOH Interpret Blocked State Description pseudo default default In Service *CLI>

Can anyone suggest what next steps I might take to recover from this?

Thanks,

Hi! Stupid question: is dahdi service running?
And 1 more thing: i cant see span configuration in your /etc/dahdi/system.conf

znoteer, I’m guessing you installed from a package and did not compile from source?

What is the output of “cat /sys/module/dahdi/parameters/auto_assign_spans”? If it is ‘0’, perhaps you can edit /etc/modprobe.d/dahdi and add an “options dahdi auto_assign_spans=1” and reload dahdi to see if you can eliminate the “Timeout waiting for all spans to be assigned” message when you run dahdi_cfg.

Nomad71: I have no processes running with dahdi in the name. Should I have? I’m a noob and amateur at asterisk. I don’t understand what a span is and couldn’t see it in the Oreilly book. I have the same /etc/dahdi/system.conf file as before the upgrade to 11.13. Is this something new to 11.13 as compared to * 1.8?

sruffell: I am indeed running the packages that come with debian stable.

“cat /sys/module/dahdi/parameters/auto_assign_spans” did in fact return “0”.

I created the file /etc/modprobe.d/dahdi and added “options dahdi auto_assign_spans=1” to it.

After /etc/init.d/dahdi restart and /etc/init.d/asterisk restart, the situation is the same : Times out waiting for spans, and nothing appears at the console when I run “dahdi show channels”.

Thanks,

After you restarted dahdi, does /sys/module/dahdi/parameters/auto_assign_spans read 0 or 1?

I’m scratching my head if that is 1 and dahdi_cfg is timing out waiting for spans, since just loading the wctdm driver should then have the spans assigned.

[quote=“nomad71”]Hi! Stupid question: is dahdi service running?
And 1 more thing: i cant see span configuration in your /etc/dahdi/system.conf[/quote]

dahdi is a kernel device driver, not a daemon.

The original problem description confirms it has been loaded.

[code]~# cd /etc/modprobe.d/

/etc/modprobe.d# echo “options dahdi auto_assign_spans=1” > dahdi

/etc/modprobe.d# …/init.d/dahdi restart
Unloading DAHDI hardware modules: done
Loading DAHDI hardware modules:
wctdm: done
Running dahdi_cfg: .
Missing ‘/sys/bus/astribanks/drivers/xppdrv/sync’

/etc/modprobe.d# …/init.d/asterisk restart
Restarting asterisk (via systemctl): asterisk.service.

/etc/modprobe.d# dahdi_cfg -s
Timeout waiting for all spans to be assigned.

/etc/modprobe.d# cat /sys/module/dahdi/parameters/auto_assign_spans
0
/etc/modprobe.d# [/code]

Does this mean that the file /etc/modprobe.d/dahdi is not being read?

Thanks

Ughh…I had a typo, it should be /etc/modprobe.d/dahdi.conf instead of /etc/modprobe.d/dahdi.

If you delete the “dahdi” file and edit the “dahdi.conf” file can you get it to change?

Sorry about that…

No worries. Honest mistake. Anyway, give me your address and I’ll mail you a beer|coffee :smile: because

[code]~# rm /etc/modprobe.d/dahdi
~# cd /etc/modprobe.d

/etc/modprobe.d# ls -lF dahdi*
ls: cannot access dahdi*: No such file or directory

/etc/modprobe.d# echo “options dahdi auto_assign_spans=1” > dahdi.conf

/etc/modprobe.d# ls -lF dahdi*
-rw-r–r-- 1 root root 34 Jul 2 17:52 dahdi.conf

/etc/modprobe.d# cat dahdi.conf
options dahdi auto_assign_spans=1

/etc/modprobe.d# cd …/init.d

/etc/init.d# ./dahdi restart
Unloading DAHDI hardware modules: done
Loading DAHDI hardware modules:
wctdm: done
Running dahdi_cfg: done.
Missing ‘/sys/bus/astribanks/drivers/xppdrv/sync’

/etc/init.d# ./asterisk restart
Restarting asterisk (via systemctl): asterisk.service.

/etc/init.d# cat /sys/module/dahdi/parameters/auto_assign_spans
1

/etc/init.d# dahdi_cfg -s
/etc/init.d# [/code]

So things are back to normal. Thanks a bunch!

But this leads me to further questions. Did the file /etc/modprobe.d/dahdi.conf exist before the upgrade from 1.8 to 11.13? If not, why didn’t the upgrade create it if necessary? And, also if not, why did this work under asterisk 1.8? If the file did exist before the upgrade, why was it removed?

I be happy to hear any proposed answers to these further questions from anyone.

Thanks,

Since I do not use the debian packages, I’m not sure, but I’m betting that the debian packager patched dahdi to change the default mode from auto_assign_spans=1 to auto_assign_spans=0. When auto_assign_spans=0, then dahdi-tools must also be updated to handle the udev events and assign the spans as necessary. Perhaps you updated dahdi-linux but not dahdi-tools? Or perhaps there should be a dependency on dahdi-tools that isn’t in the .deb package?

dahdi compiled from source, at least as of dahdi-linux 2.10.2, will by default assign spans in the kernel as the drivers are loaded.

On a side note:
I personally hope that one day the default is for span assignment to happen in user space, there just needs to be more education and coordination between all the packagers and heavy users of dahdi.

The packages are indeed patched this way.

If a device was registered but spans were not assigned for whatever reason, the following should be able to show the status:

dahdi_span_assignment list

In case there are spans that were not assigned, they could be manually assigned using:

dahdi_span_assignment auto

Another thing to look at:

grep -v '^#' /etc/dahdi/assigned-spans.conf

Another note: I’d like to understand what happened, so feel free to ping me about this on IRC.