I ran across a problem with a Dahdi-based FreeTDM system a few weeks ago. Because the timer for mod_conference was not synchronized to the T1 clock source, there was significant periodic on-conference noise. The problem was not that the "soft" timer was inaccurate; on the contrary, it was a very accurate 1 mS timer in a system that had a pretty inaccurate T1 clock coming in.
My solution was to create a new "mod_dahdi_timer", which derives the ~1 mS timer from 8 ticks of the 8 kHz /dev/dahdi/timer device. Then a one-line change to mod_conference.c to change "soft" to "dahdi", and the conference sounds perfectly clean.
Installation guidelines:
- Untar the tarball under the freeswitch source directory
- Before ./configure build step, edit modules.conf, adding a line for "timers/mod_dahdi_timer"
- Build as usual
- Add a line to modules.conf.xml enabling mod_dahdi_timer
Testing the timer:
- Only do this if you have a Dahdi T1 board installed and configured with dahdi_cfg.
- "show timers" - verify that the new dahdi timer shows up.
- timer_test 10 10 dahdi
- timer_test 20 10 dahdi
- timer_test 40 10 dahdi
- timer_test 60 10 dahdi
- timer_test 120 10 dahdi
Using the timer:
- Into any config that allows for specifying a timer name, use "dahdi". This is especially useful for mod_conference.
Todo:
- See TODO comments in mod_dahdi_timer.c . Exception handling may not be robust, and may fail spectacularly in systems with no configured Dahdi T1 board.
- Comments at the top of mod_dahdi_timer.c may need to be expanded to include the normal FreeSWITCH copyright notices, etc.