Trouble compiling wanpipe on Debian 10

I have wanpipe-7.0.34 on fully updated Debian 10 with kernel 4.19.0-20-amd64. When I run

./Setup builddeb --silent --with-zaptel=/usr/src/dahdi-linux-complete-3.1.0+3.1.0 --protocols=TDM

I get this: “fatal error: wanpipe_includes.h: No such file or directory”

===================================== 

WANPIPE DRIVER COMPILE LOG
Mon 11 Apr 2022 09:16:34 AM EDT
-----------------------------------
make -C /lib/modules/4.19.0-20-amd64/build SUBDIRS=/usr/src/wanpipe-7.0.34/kdrvtmp CC=gcc KBUILD_VERBOSE=1 modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.0-20-amd64'
make -C /usr/src/linux-headers-4.19.0-20-amd64 KBUILD_SRC=/usr/src/linux-headers-4.19.0-20-common \
-f /usr/src/linux-headers-4.19.0-20-common/Makefile modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
mkdir -p /usr/src/wanpipe-7.0.34/kdrvtmp/.tmp_versions ; rm -f /usr/src/wanpipe-7.0.34/kdrvtmp/.tmp_versions/*
make -f /usr/src/linux-headers-4.19.0-20-common/scripts/Makefile.build obj=/usr/src/wanpipe-7.0.34/kdrvtmp
(cat /dev/null;   echo kernel//usr/src/wanpipe-7.0.34/kdrvtmp/sdladrv.ko;) > /usr/src/wanpipe-7.0.34/kdrvtmp/modules.order
  gcc -Wp,-MD,/usr/src/wanpipe-7.0.34/kdrvtmp/.sdladrv_src.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/8/include -I/usr/src/linux-headers-4.19.0-20-common/arch/x86/include -I./arch/x86/include/generated  -I/usr/src/linux-headers-4.19.0-20-common/include -I./include -I/usr/src/linux-headers-4.19.0-20-common/arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I/usr/src/linux-headers-4.19.0-20-common/include/uapi -I./include/generated/uapi -include /usr/src/linux-headers-4.19.0-20-common/include/linux/kconfig.h -include /usr/src/linux-headers-4.19.0-20-common/include/linux/compiler_types.h  -I/usr/src/wanpipe-7.0.34/kdrvtmp -I/usr/src/wanpipe-7.0.34/kdrvtmp -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Werror=return-type -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-var-tracking-assignments -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=/usr/src/linux-headers-4.19.0-20-common/= -Wno-packed-not-aligned -D__LINUX__ -DCONFIG_PRODUCT_WANPIPE_BASE -DCONFIG_PRODUCT_WANPIPE_AFT -DCONFIG_PRODUCT_WANPIPE_AFT_CORE -DCONFIG_PRODUCT_WANPIPE_AFT_TE1 -DCONFIG_PRODUCT_WANPIPE_AFT_56K -DCONFIG_PRODUCT_WANPIPE_AFT_RM -DCONFIG_PRODUCT_WANPIPE_CODEC_SLINEAR_LAW -DCONFIG_PRODUCT_WANPIPE_AFT_BRI -DCONFIG_PRODUCT_WANPIPE_AFT_SERIAL -DCONFIG_PRODUCT_WANPIPE_AFT_A600 -DCONFIG_PRODUCT_WANPIPE_AFT_B601 -DCONFIG_PRODUCT_WANPIPE_AFT_B800 -DCONFIG_PRODUCT_WANPIPE_AFT_A700 -DCONFIG_PRODUCT_WANPIPE_USB -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN -DDAHDI_31 -DCONFIG_PRODUCT_WANPIPE_TDM_VOICE_DCHAN_ZAPTEL -DDAHDI_ISSUES -DKERN_PROC_CREATE=0 -DKERN_DEV_CHG_FLAG_UPDATE=0 -DKERN_NDO_TIMEOUT_UPDATE=0 -DKERN_CLASS_DEV_GROUPS=0 -DKERN_DO_GET_TIME=0 -DKERN_GET_KENEL_DS=0 -DKERN_MODPOST_STATIC_ERR=0 -DCONFIG_WANPIPE_HWEC  -I//usr/src/wanpipe-7.0.34/debbuild/usr/include/wanpipe  -I/usr/src/wanpipe-7.0.34/debbuild/usr/include/wanpipe/oct6100_api  -I/usr/src/wanpipe-7.0.34/debbuild/usr/include/wanpipe/oct6100_api/include  -I/usr/src/wanpipe-7.0.34/debbuild/usr/include/wanpipe/oct6100_api/include/oct6100api  -DMODULE  -DKBUILD_BASENAME='"sdladrv_src"' -DKBUILD_MODNAME='"sdladrv"' -c -o /usr/src/wanpipe-7.0.34/kdrvtmp/.tmp_sdladrv_src.o /usr/src/wanpipe-7.0.34/kdrvtmp/sdladrv_src.c
/usr/src/wanpipe-7.0.34/kdrvtmp/sdladrv_src.c:125:10: fatal error: wanpipe_includes.h: No such file or directory
 #include "wanpipe_includes.h"
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [/usr/src/linux-headers-4.19.0-20-common/scripts/Makefile.build:309: /usr/src/wanpipe-7.0.34/kdrvtmp/sdladrv_src.o] Error 1
make[3]: *** [/usr/src/linux-headers-4.19.0-20-common/Makefile:1561: _module_/usr/src/wanpipe-7.0.34/kdrvtmp] Error 2
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:8: all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.19.0-20-amd64'
make: *** [Makefile:33: all] Error 2

Found the problem. Debian 10 splits up the kernel headers into two packages, linux-headers-4.19.0-20-amd64 and linux-headers-4.19.0-20-common. Solution is to create /usr/src/linux-headers and copy both directories to one

The Makefile in linux-headers-4.19.0-20-amd64 tries to accommodate the two directories with:

MAKEARGS := -C /usr/src/linux-headers-4.19.0-20-common O=/usr/src/linux-headers-4.19.0-20-amd64

but Setup script does not work with that. Once the files are copied, wanpipe compiles fine with the command:

./Setup builddeb --silent --with-zaptel=/usr/src/dahdi-linux-complete-3.1.0+3.1.0 --with-linux=/usr/src/linux-headers --protocols=TDM

Though the deb package compiles, once installed, it can not find the kernel modules.

modprobe: FATAL: Module wanrouter not found in directory /lib/modules/4.19.0-20-amd64

dpkg -L wanpipe | grep ko
/lib/modules/4.19.235/kernel/drivers/net/wan/sdladrv.ko
/lib/modules/4.19.235/kernel/drivers/net/wan/wanpipe.ko
/lib/modules/4.19.235/kernel/net/wanrouter/af_wanpipe.ko
/lib/modules/4.19.235/kernel/net/wanrouter/wan_aften.ko
/lib/modules/4.19.235/kernel/net/wanrouter/wanec.ko
/lib/modules/4.19.235/kernel/net/wanrouter/wanrouter.ko

copying the modules to /lib/modules/4.19.0-20-amd64/ does not help

Could use some help fixing this

Debian 10 with kernel 4.19.235-1. compiling the full driver with the following command has errors.

./Setup builddeb --silent --with-zaptel=/usr/src/dahdi-linux --with-linux=/usr/src/linux-headers --protocols=FR-CHDLC-PPP-MFR-MPROT-X25-AFT_TE1-AFT_TE3-ADSL-ATM-TDM

Note that the --with-linux directory /usr/src/linux-headers is the combination of the two debian headers packages, linux-headers-4.19.0-20-amd64 and linux-headers-4.19.0-20-common. This was required to compile the TDM driver.

see attached for full details

setup_drv_compile.tgz (3.8 KB)

Having overcome the compiler issues, we find that although “dahdi show channels” looks good with 48 digital and 4 analog lines, calls do not go through. When calling in, fast busy. When calling out, a DAHDI channel attempts the call then falls back to our SIP trunk. I’ve verified permissions on all /dev/dahdi nodes are asterisk.asterisk and match our old installation which uses kernel 4.x

I’ve been doing custom compiles and installation of Sangoma hardware since the mid 2000’s and never seen a condition where “wanrouter status” shows connected and no alarms are set when checked with “wanpipemon -i w1g1 -c Ta”.

Everything looks good otherwise. could the dial error be simply an incompatibility with the kernel?

Is this the wrong place to look for support?

It shouldn’t be, but until you get a Sangoma flavored answer, logs of a failed call is always a good thing .

Good point dicko… there not much to see. Just PRI status code 27 when trying to call out.

It’s been hard to find time but today I referred to this link → PRI- PRI Down - Telephony Cards - Documentation and going through the steps, found the interface RX/TX are not incrementing so I’m guessing there is a hardware incompatibility. The machine is an HP DL360 gen9…

If anyone with Sangoma has some insight, I’d appreciate it.

iSDN returning 27 means ‘busy’, are they ?

I would suggest opening a Support ticket with Sangoma as your issue isn’t FreePBX related and normally Sangoma staff here are just FreePBX team members.

Hi Tony, I’ll try but since Sangoma got so big I find tech support through the forum is much easier. I am – was – a reseller but don’t have my records in order when it comes to proving it. We didn’t register them and it’s been over 10 years… I NEVER thought I’d have a problem as a reseller or I would have registered them. My last query to support was not received well and was kicked around for over a year, back and forth with a lot of time wasted and no results. Then, out of the blue, someone posted here about the same issue and it was happily fixed in a couple days. That really left a bad taste in my mouth for contacting support! Times have changed since David Mandelstam answered the tech requests!

dicko, I read that 27 means out of order. The funny thing the line is not busy. It’s in production on an oooold server and when I switch to the new, wanrouter status shows connected, wanpipemon shows no alarms and dahdi show channels show all the channels configured. “pri show spans” shows “PRI span 1/0. Down, Active”. The only indicator that it’s not working is the RX/TX counters on w1g1 are stuck at 0. I’ve tried wanrouter on the host os (both proxmox 6x and 7x) and within the VM - same result on a HP DL360 Gen9.

I’ve verified the configuration works on a supermicro chassis - same host os and using the same VM so I figure it’s a problem in the HP. Maybe a BIOS update is needed or other special configuration. I can’t find anything so far. Monday we’ll try with Sangoma and HP

Note, this page in the wiki that specifically says no issue with Linux and HP … Cards on HP Gen9 DL380 Server Issues - Telephony Cards - Documentation

set pri set debug on . . . for the DAHDI side, you have a problem with your d -channel apparently being ‘down’ in DAHD,I it is very unlike;y to be a hardware problem, more a wanrouter/wanpipe to DAHDI thing , contact Sangoma

I will report back here if there is anything to say. thank you

1 Like