asterisk / dahdi-tools

This is the official dahdi-tools repository. All issues and PR should be raised here.
GNU General Public License v2.0
16 stars 30 forks source link

dahdi_genconf: spantype: No such file or directory #9

Closed Turbid closed 3 weeks ago

Turbid commented 1 year ago
# dahdi_genconf -vvvv
Default parameters from /etc/dahdi/genconf_parameters
Generating /etc/dahdi/assigned-spans.conf
cut: '/sys/bus/dahdi_devices/devices/pci:0000:1b:08.0/spantype': No such file or directory
Generating /etc/dahdi/system.conf
Generating /etc/asterisk/dahdi-channels.conf
# ls -1 /sys/bus/dahdi_devices/devices/pci:0000:1b:08.0/
assign_span
auto_assign
dahdi_registration_time
dahdi_spantype
hardware_id
location
manufacturer
power
span-1
span-2
span-3
span-4
span-5
span-6
span-7
span-8
span_count
subsystem
type
uevent
unassign_span
#
# dahdi_hardware 
pci:0000:1b:08.0     wct4xxp+     d161:1820 Wildcard TE820 (5th Gen)

DAHDI: dahdi-linux-complete-3.2.0+3.2.0 OS: Debian 11 Bullseye Kernel: 5.10.0-19-amd64

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935582 https://salsa.debian.org/pkg-voip-team/dahdi-tools/-/blob/master/debian/patches/dahdi_spantypes.patch

https://issues.asterisk.org/jira/browse/DAHTOOL-82

navadev commented 1 year ago

I also hit this issue on dahdi tools 3.2.0 and confirmed the attached patches in the JIRA ticket above resolved this problem. Any consideration for bringing these changes in? @asteriskteam

InterLinked1 commented 1 year ago

Don't hold your breath. The DAHDI team has done hardly anything for the last 3 years, and by all current indications, isn't planning to do anything anytime soon. We've had a major issue with things breaking in the last 2-3 years and Sangoma has done diddly squat about them (they did merge a few compiler fixes over the summer, to be fair, but it was too little, 2 years too late, and there are still many other issues that should have been addressed eons ago pending).

Also, I don't think @asteriskteam is active, @asterisk is probably the right organization, and it's the one that owns this repository.

Many people have had more luck installing DAHDI these days using PhreakScript, which installs DAHDI with many compiler fixes patched in that Sangoma has not yet done: https://github.com/InterLinked1/phreakscript

wadester commented 1 year ago

Issue causes assigned-spans.conf to be built incorrectly.
Tested on RHEL 8.6.

joelsdc commented 7 months ago

Does anyone have the latest URL for https://issues.asterisk.org/jira/browse/DAHTOOL-82 ?

InterLinked1 commented 7 months ago

Does anyone have the latest URL for https://issues.asterisk.org/jira/browse/DAHTOOL-82 ?

https://issues-archive.asterisk.org/DAHTOOL/00/DAHTOOL-00082.html

cjemorton commented 7 months ago

It may be time for the community to fork this stuff or setup a complete new code base that actually works. The whole project seems to have been abandoned by those it was entrusted to. I've been fighting to get this dahdi card up and running for pretty much a week now, and it's literally one patch after another. Trying one fix after another. From what I can see, it seems I'm not the only one in this situation. From what it seems the whole source code for the dahdi-linux and dahdi-tools are one big shredded mess of spaghetti code and patches. Holding on by their fingernails. It's incredibly frustrating because I actually paid for a proper Digium card and not can't really use it because their code base is so bloated and unusable that it refuses to compile and work correctly. / end rant.

InterLinked1 commented 7 months ago

It may be time for the community to fork this stuff or setup a complete new code base that actually works. The whole project seems to have been abandoned by those it was entrusted to. I've been fighting to get this dahdi card up and running for pretty much a week now, and it's literally one patch after another. Trying one fix after another. From what I can see, it seems I'm not the only one in this situation. From what it seems the whole source code for the dahdi-linux and dahdi-tools are one big shredded mess of spaghetti code and patches. Holding on by their fingernails. It's incredibly frustrating because I actually paid for a proper Digium card and not can't really use it because their code base is so bloated and unusable that it refuses to compile and work correctly. / end rant.

That happens, to an extent, but there are problems with that which that doesn't solve.

There is actually a team at Sangoma working on this again, finally, after several years of not doing so, but getting things together again is still taking longer than anyone would like.

Does it work if you install DAHDI using PhreakScript? https://github.com/InterLinked1/phreakscript

A few others and I have already done most of the hard work of getting things to work so hopefully you shouldn't need to duplicate that.

If you're having issues, please let me know what card you are using, your platform and what specific issues you are running into. Digium cards should work pretty well without issue.

lachesis commented 7 months ago

I installed DAHDI via Phreakscript, and I'm seeing this same error. My card is a Digium, Inc. Wildcard TE220 dual-span T1/E1/J1. I had to sudo modprobe wct4xxp to get it to show up in dahdi_scan. Sure enough as dahdi_genconf says, there is no spantype in the sysfs at that path. There are spantype files under the span-1 and span-2 subdirectories (which just say T1).

InterLinked1 commented 7 months ago

I installed DAHDI via Phreakscript, and I'm seeing this same error. My card is a Digium, Inc. Wildcard TE220 dual-span T1/E1/J1. I had to sudo modprobe wct4xxp to get it to show up in dahdi_scan. Sure enough as dahdi_genconf says, there is no spantype in the sysfs at that path. There are spantype files under the span-1 and span-2 subdirectories (which just say T1).

I've never used the TE220 myself, but isn't wct4xxp for the TE410P? Or am I missing something?

lachesis commented 7 months ago

I can confirm that the patches attached on that issue apply cleanly to the Phreakscript-installed tools and resolve the (initial) issue. I'm rehosting the patches here in case that issue disappears, as this is the link that Google brought me to. For some reason, Github won't let me attach them as .patch files despite claiming that is supported, so I renamed them to .txt.

To use, just drop them in /tmp on your Asterisk server, then do:

cd /usr/sbin
patch < /tmp/00-0001-handle-both-spantypes-and-dahdi_spantypes-in-sysfs.txt
patch < /tmp/01-dahdi_waitfor_span_assignments.txt

After that, the usual dahdi_genconf and dahdi_span_assignments invocations should work.

00-0001-handle-both-spantypes-and-dahdi_spantypes-in-sysfs.txt 01-dahdi_waitfor_span_assignments.txt

As for the choice of driver, I have no idea at all. I just ran dahdi_hardware and got the following output:

pci:0000:08:01.0     wct4xxp-     d161:1220 Wildcard TE220 (5th Gen)
cjemorton commented 7 months ago

--- (dahdi-tools related) I applied the patch listed: here created by Tzafrir Cohen (tzafrir) - thanks!

I opened a draft pull request: https://github.com/asterisk/dahdi-tools/pull/20

If it looks good to you guys - I will submit it ready for review, hopefully someone at Digium can get it applied unless there are other plans.

--- (dahdi-linux related below) As for the other questions from @InterLinked1 I have tried the Phreakscript - but it didn't seem to work for me. I didn't dig too deeply into the script, because it seemed like adding extra added complexity onto of something I was already trying to get working.

I ended up getting the master branch of dahdi-linux from here retronetworking/dahdi-linux to actually compile on my system.

Linux rocky 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 10 22:58:54 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

pci:0000:02:08.0 wctdm24xxp+ d161:8006 Wildcard AEX410P

I did have to modify three files to get it to compile, the fix and instructions to do so I found in this thread.

Here is a git patch for the changes I made (This is for dahdi-linux, not dahdi-tools).

It was made on this: repository using this commit (the latest commit at the time of me writing this) netif_napi_add_patch.txt

PS: Keep in mind that the change I made may not have been the correct way to handle the issue. It's just what I did to make it compile on my specific system. It may not work on other systems that have other requirements, as to what those requirements are I have no idea, so some sort of conditional logic may be the correct way to implement this.

ursfassler commented 1 month ago

The problem is in dahdi-linux for kernel >= 4.13.0. The sysfs entry is published as dahdi_spantype instead of just spantype. The PR https://github.com/asterisk/dahdi-linux/pull/56 should solve this issue.