login | register
Fri 29 of Aug, 2008 [20:58 UTC]

voip-info.org

Discuss [9] History

Asterisk timer

Created by: oej,Last modification on Thu 06 of Sep, 2007 [19:14 UTC] by perepo

Zaptel timers for Asterisk


There are at least two Asterisk applications that need support of a timer to work properly:

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

  • Zaptel hardware device will provide timing to Asterisk.
  • ztdummy is a dummy Zaptel device that provides no channels and only timing. It can use various sources for the timing
    • Linux kernels with HZ set to 1000. This was the default of kernel 2.6.0 - 2.6.12, and normally requires a kernel rebuild on newer kernels.
    • RTC support - works in i386 and amd64 as of 2.6.15.
    • HPET timers - for even newer kernels (right now requires an external patch, see http://bugs.digium.com/view.php?id=10314 ).
    • UHCI USB controller - abuses a timer in those USB controllers (controllers made by Intel or Via). Should work on any kernel.

The above should work with minimal tweaking in a default installation of Zaptel.

Some alternatives that have been suggested to ztdummy over the years:

  • If you don't have Digium hardware, there are three replacements:

Zaprtc works fine on SMP wth kernel 2.6.

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.


For FreeBSD


For OpenWRT




Comments

Comments Filter
222

333unable to open IAX timing interface

by lingolep, Tuesday 13 of May, 2008 [09:11:33 UTC]
I'm getting an unable to open IAX timing interface from the chan_iax2 module when starting asterisk.

crw-rw---- 1 root audio 10, 135 2008-04-29 17:25 /dev/rtc

I do have a /dev/rtc file in place. I was hoping to run this without the ztdummy module, however I will continue to investigate.
222

333

by Mat, Friday 09 of December, 2005 [19:50:35 UTC]
Why a kernel module is needed ?
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.
222

333Re: Clarification usage on ztdummy

by Username, Monday 17 of October, 2005 [03:25:45 UTC]
Woah guys... this is a very bad joke. Besides being barely documented...

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!

222

333Error message - is this caused by a timing problem?

by alakon, Friday 11 of March, 2005 [23:23:18 UTC]
I get the following error - is this caused by a timing problem (some diigts change to protect the innocent)?

   — 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'

222

333AutoStart Kernel 2.6

by , Thursday 06 of January, 2005 [01:43:13 UTC]
What I need to do in order to start the ztdummy with kernel 2.6?

222

333Re: Clarification usage on ztdummy

by PoWeRKILL, Thursday 07 of October, 2004 [18:54:08 UTC]
The following is not true, if Conference is not used you don't have to use any ZaptelRTC or ZTDUMMY.
222

333Clarification usage on ztdummy

by , Saturday 10 of July, 2004 [03:07:42 UTC]
It really really needs to be noted here that if you're using a pure VoIP setup (e.g. No digium hardware at all) you MUST have either ztdummy or zaprtc loaded for ANYTHING that requires asterisk to stream audio and not just for MeetME and IAX. If you do not load it then anything that asterisk streams over the internet, VoiceMail especially, will sound like CRAP...
222

333more about ztdummy

by , Tuesday 23 of March, 2004 [17:55:37 UTC]
it doesn't require/use /etc/zapata.conf
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.

222

333ztdummy

by dg1nsw, Monday 02 of February, 2004 [15:07:21 UTC]
I had UHCI on my USB so i gave it a quick try.
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".