Zaptel timers for Asterisk
There are at least two Asterisk applications that need support of a timer to work properly:
- Asterisk cmd MeetMe: The conferencing application
- Asterisk iax channels: IAX trunking
It may also be required with Music on Hold, i.e. to improve sound quality.
For Linux, several solutions exist to provide a timer, for other operating systems there is nothing, yet.
How to get a working timer
- A Digium ZAPTEL INTERFACE has working timers.
- If you don't have Digium hardware, there are three replacements:
- ztdummy (in the standard zaptel distribution on the Asterisk CVS) on 2.4 Linux kernel uses USB-UHCI timers in USB drivers on platforms with UHCI USB support. On kernel version 2.6 it uses internal high-resolution kernel timer and do not require any additional hardware. Ztdummy is a kernel module that you load with the Linux command modprobe. Read your Linux documentation on how to load and unload kernel modules. If you are using 2.4 kernel please note that usb-uhci must be loaded as a module and may not be compiled into the kernel for ztdummy to work.
- zaprtc found on http://www.junghanns.net/downloads/ uses the real time clock in the PC instead. Look for Zaprtc on the lower left hand of the web page. The version 0.0.1 is for kernel 2.4. For 2.6 use zaprtc from bristuff package. Zaprtc will not work on SMP systems (Multiprocessor), where the RTC clock is used for SMP support. Is it still true? See http://lists.digium.com/pipermail/asterisk-dev/2004-September/006022.html.
Note: Zaprtc is actually a replacement for the standard RTC module. It provides the same facilities, but includes extra parts for Zaptel use. You will need to unload standard RTC module (rmmod rtc) or re-compile the kernel without RTC support (in your kernel source dir: "make menuconfig" --> Character Devices --> uncheck Enhanced Real Time Clock; now re-compile the kernel) in order to be able to use zaprtc.
- realzap: This trivial zap driver can generate zaptel timing out of anything. However you need to have RTAI running, which is far from trivial! realzap comes with bristuff http://www.junghanns.net/downloads/
Note
- If you are on a 2.6 kernel, be sure to read /usr/src/zaptel/README.udev
For FreeBSD
- See Asterisk FreeBSD: Zaptel driver development for FreeBSD
For OpenWRT
- See the OpenWRT forum on the dummy zaptel driver for Asterisk on OpenWRT running the Linux 2.4 kernels in the stable (WhiteRussian) releases.
- Asterisk: Start page | Introduction | FAQ | Tips & Tricks
Page Changes
Why can't we use /dev/rtc ?
For imformation mplayer use /dev/rtc @1024 if it can from years.
PS : I am not sure POSIX timer could provide a such resolution.
Re: Clarification usage on ztdummy
Linux provides many types of real-time timers. You don't need to maintain a crappy little non-standard and non-portable driver. The asterisk server should be using POSIX timers.
This is just oh-my-god bad. What a hack!
Error message - is this caused by a timing problem?
— Accepting AUTHENTICATED call from 217.160.244.186, requested format = 4, actual format = 4
— Executing Answer("IAX2/livevoip@217.160.244.186:4569/3", "") in new stack
— Executing Wait("IAX2/livevoip@217.160.244.186:4569/3", "2") in new stack
— Executing AGI("IAX2/livevoip@217.160.244.186:4569/3", "areskicc.php") in new stack
— Launched AGI Script /var/lib/asterisk/agi-bin/areskicc.php
areskicc.php: 'agi_request' => 'areskicc.php'
areskicc.php: 'agi_channel' => 'IAX2/livevoip@217.160.244.186:4569/3'
areskicc.php: 'agi_language' => 'en'
areskicc.php: 'agi_type' => 'IAX2'
areskicc.php: 'agi_uniqueid' => '1110514027.0'
areskicc.php: 'agi_callerid' => '"8005550000" '
areskicc.php: 'agi_dnid' => 'unknown'
areskicc.php: 'agi_rdnis' => 'unknown'
areskicc.php: 'agi_context' => 'livevoipinbound'
areskicc.php: 'agi_extension' => '8005550001'
areskicc.php: 'agi_priority' => '3'
areskicc.php: 'agi_enhanced' => '0.0'
areskicc.php: 'agi_accountcode' => ''
areskicc.php: 'dig' => '/usr/bin/dig'
areskicc.php: 'debug' => 'true'
areskicc.php: >> ANSWER
areskicc.php: string(82) ""8005550000" ; IAX2/livevoip@217.160.244.186:4569/3 ; 1110514027.0 ; "n
areskicc.php: string(26) "Requesting DTMF ::> Len-10"n
areskicc.php: >> GET DATA prepaid-enter-pin-number 10000 10
— Playing 'prepaid-enter-pin-number' (language 'en')
Mar 10 23:07:09 NOTICE954: res_musiconhold.c:309 monmp3thread: Request to schedule in the past?!?!
Mar 10 23:07:09 WARNING962: file.c:1058 ast_waitstream_full: Wait failed (No such file or directory)
== Spawn extension (livevoipinbound, 8005550001, 3) exited non-zero on 'IAX2/livevoip@217.160.244.186:4569/3'
— Hungup 'IAX2/livevoip@217.160.244.186:4569/3'
AutoStart Kernel 2.6
Re: Clarification usage on ztdummy
Clarification usage on ztdummy
more about ztdummy
after successfully modprobing ztdummy, you should now have /proc/zaptel
upon asterisk startup in the logs you might see:
Mar 23 11:27:36 WARNING16384: Unable to open IAX timing interface: Permission denied
this refers to /dev/zap/pseudo. make it read/writable by the process running asterisk.
The "Unable to load config iax1.conf" message in the log file is unrelated, as are the "ignoring port for now", and "ignoring rxwink". You can rid yourself of these warnings by copying iax.conf into iax1.conf.
ztdummy
I used this ztdummy-module and got scratched up sound from asterisk. (worked before)
With zaprtc it worked better however for all hardcore linuxers: You HAVE to execute the rtcsetup. I am not completely clear what it does but if you dont execute it asterisk will not respond. (asterisks scheduler will have no timing instead of a bad one :)
And if you get messages about missing symbols when loading one of the kernel modules you should do "lsmod" and look if the module is loaded. You find it in your sourcedirectory after compiling called "zaptel.o".