Troubles with Zaptel, CentOS 5.2, Xen

I've been doing a lot of work with Asterisk lately and have been having and issues A)getting the zaptel 1.4 module to compile and B) Zaptel module causing a CentOS 5.2 Xen server to crash on load.  After much searching and deciphering, here's what I had to do to get things working...

I've been doing a lot of work with Asterisk lately and have been having and issues A)getting the zaptel 1.4 module to compile and B) Zaptel module causing a CentOS 5.2 Xen server to crash on load. After much searching and deciphering, here's what I had to do to get things working...

My first troubles were even getting the Zaptel 1.4 module source code to compile. I kept getting an 'You do not have sources for 2.6....' errors. The error is self explanatory meaning I'm not compiling against the correct kernel sources. But I had already did a 'yum install kernel-devel' and created a symbolic link for '/usr/src/linux/' to '/usr/src/kernels/2.6.18-92.1.6.el5xen-i686/' (yum doesn't install the sources in the standard directory). So what gives?

Since this box is a virtualized xen install, I learned I had to actually install 'yum install kernel-xen-devel' to get the modified xen sources for my kernel. Awesome, I'm past my first compile error.

Then I started getting a 'conflicting types for bool' error. Great. After much googling I stumbled across this page @ https://bugs.digium.com/view.php?id=12889. It sounds like a bug. So I download the attached .diff file asd 'patch < centos52_fix.diff' inside the source directory of zaptel (/usr/src/zaptel). It didn't recognize the file path and asked me to enter one so I typed the path to the file to be changed 'kernel/xpp/xdefs.h' and it picked up and applied. Whew...what's next?

The zaptel module now completes the './compile' and I finish up with a 'make' and 'make install' and 'make config'. So far so good. I tried to start the module with '/etc/init.d/zaptel start' and immediately the server panics and crashes. Not good.

After toiling with google again I found url @ http://pbxinaflash.com/forum/archive/index.php?t-595.html "it will crash your domU when it tries to load the ztdummy module so if you can comment that out of the install first that would be good. Otherwise you have to boot the domU in single user mode and fix it. To fix it, just edit /usr/src/zaptel/kernel/ztdummy.c and comment out #define USE_RTC, then cd /usr/src/zaptel and "make install"."

So I ended up having to edit the source file for ztdummy.c (above) around lines 57-67. Here's my changed section:
[code] #if defined(__i386__) || defined(__x86_64__) #if LINUX_VERSION_CODE >= VERSION_CODE(2,6,13) /* The symbol hrtimer_forward is only exported as of 2.6.22: */ #if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22) #define USE_HIGHRESTIMER #else /* #define USE_RTC */ #endif #else #if 0 /* #define USE_RTC */ #endif #endif #endif [/code]

After commenting out the two USE_RTC lines, I reconfigured, make, make install. No complaints on the compile so I started the module with '/etc/init.d/zaptel start' and...

[OK]

The module loaded. Doing a 'zttest' detected ztdummy on my system returned a 99.99%.

What a day...

No votes yet