How to get Asterisk working under a XenU

Asterisk works in basic SIP mode, but you can’t use any of the conference facilities, and or any of the announcements without a source of 1khz interrupts.

Normally, this comes from the zaptel driver in the kernel, if you have a stock FXO card. You can also use ztdummy on 2.4 kernels using the USB interface for timing, and on 2.6 kernels you can get 1khz timing from the RTC driver.

But, there is no RTC on Xen.

The solution is to use the ztdummy driver, but to REBUILD your XenU kernel with HZ=1000, so that it can use the stock timer interrupts.

In theory, the in-kernel HPET interface should be used instead, and I hope to adapt the code. I also expect to reduce the number of .h files, and most of the dependancies.

(Note, you need the CCITT CRC routines available in your kernel as well)

I have placed my tgz file of drivers/char/zaptel at: http://www.sandelman.ca/software/zaptel-2.6-xenU.tgz

note that it overwrites drivers/char/Makefile and drivers/char/Kconfig. I will produce patch-o-matic and git trees soon.

I put a kernel that I’m using at: http://www.sandelman.ca/software/vmlinuz-2.6.16.29-3.0.3b

If you use this, and it works, I’ll clean it up a bit more.

The config items you need to get HZ=1000 are:

gimli-[xen/xen/xen-3.0.3_0-src/linux-2.6.16.29-xen] mcr 1062 %grep HZ .config CONFIG_HZ_1000=y CONFIG_HZ=1000 CONFIG_MACHZ_WDT=m CONFIG_NO_IDLE_HZ=y

This is under the “Processor Type and Features” item in menuconfig, if you are looking that way. Near the bottom: “Timer frequency (100 HZ)” is the default.

1000HZ settings make the kernel a bit more intensive, and it might be that you have to also adjust the Xen scheduler at bit. I haven’t done this yet, but seem to have good results.

With these changes, I can now deploy Asterisk into XenUs at a colo.