Zaptel patch
I've spent some time to get Zaptel running with 'Bristuff' Asterisk provided by Junghanns (http://www.junghanns.net/downloads/bristuff-0.4.0-RC3e.tar.gz). Here is a path to compile zaptel.
During asterisk installation (install.sh) you can face such an error:
zaptel-1.4.12.1/kernel/ztdummy.c: In function 'ztdummy_hr_int': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/ztdummy.c:202: error: 'struct hrtimer' has no member named 'expires' make[3]: *** [/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/ztdummy.o] Error 1 make[2]: *** [_module_/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel] Error 2 make[2]: Leaving directory `/usr/src/linux-2.6.29.5' make[1]: *** [modules] Error 2 make[1]: Leaving directory `/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1' make: *** [all] Error 2
Proceed with this instruction:
1. cd /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/
2. Created the file ztdummy.patch with:
--- a/kernel/ztdummy.c +++ b/kernel/ztdummy.c @@ -91,6 +91,18 @@ #endif #include "ztdummy.h" +#if defined(USE_HIGHRESTIMER) && ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) ) +/* compatibility with new hrtimer interface */ +static inline ktime_t hrtimer_get_expires(const struct hrtimer *timer) +{ + return timer->expires; +} + +static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) +{ + timer->expires = time; +} +#endif static struct ztdummy *ztd; @@ -200,7 +212,7 @@ static enum hrtimer_restart ztdummy_hr_i * expired. * We should worry if overrun is 2 or more; then we really missed * a tick */ - overrun = hrtimer_forward(&zaptimer, htmr->expires, + overrun = hrtimer_forward(&zaptimer, hrtimer_get_expires(htmr), ktime_set(0, ZAPTEL_TIME_NS)); if(overrun > 1) { if(printk_ratelimit()) @@ -223,7 +235,7 @@ static enum hrtimer_restart ztdummy_hr_i /* use kernel system tick timer if PC architecture RTC is not available */ static void ztdummy_timer(unsigned long param) { - timer.expires = jiffies + 1; + hrtimer_set_expires(timer, jiffies + 1); add_timer(&timer); ztd->counter += ZAPTEL_TIME;
3. Patch it:
patch -p0 ztdummy.c ztdummy.patch
4. In /usr/src/bristuff-0.4.0-RC3e/ execute ./compile.sh (NOTE: ./install.sh will remove this patch). Now the error looks different:
/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:63:1: warning: "WARN" redefined In file included from /usr/src/linux-2.6.29.5/arch/x86/include/asm/bug.h:38, from include/linux/kernel.h:21, from /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:23: include/asm-generic/bug.h:81:1: warning: this is the location of the previous definition /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_set_multi': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:611: error: 'struct net_device' has no member named 'priv' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_up': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:619: error: 'struct net_device' has no member named 'priv' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_down': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:634: error: 'struct net_device' has no member named 'priv' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_hard_start_xmit': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:651: error: 'struct net_device' has no member named 'priv' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_poll': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:712: warning: passing argument 1 of 'netif_rx_complete' from incompatible pointer type /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:712: error: too many arguments to function 'netif_rx_complete' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_get_stats': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:721: error: 'struct net_device' has no member named 'priv' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_ioctl': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:758: error: 'struct net_device' has no member named 'priv' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_register': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:794: error: 'struct net_device' has no member named 'priv' /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c: In function 'wctc4xxp_net_capture_cmd': /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:886: warning: passing argument 1 of 'netif_rx_schedule' from incompatible pointer type /usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.c:886: error: too many arguments to function 'netif_rx_schedule' make[4]: *** [/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp/base.o] Error 1 make[3]: *** [/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel/wctc4xxp] Error 2 make[2]: *** [_module_/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1/kernel] Error 2 make[2]: Leaving directory `/usr/src/linux-2.6.29.5' make[1]: *** [modules] Error 2 make[1]: Leaving directory `/usr/src/bristuff-0.4.0-RC3e/zaptel-1.4.12.1' make: *** [all] Error 2
Remove everything that refers to *wctc4xpp* and *xpp* in Mafefile. It should fix the problem and allow to finish installation.












