Page tree
Skip to end of metadata
Go to start of metadata

About

Mod_timerfd uses the Linux kernel timerfd API to create and use a kernel timer that delivers timer expire notifications via a file descriptor.

Requires kernel >= 2.6.25, libc >= 2.8, and FreeSWITCH commit 48b1193552983e37f1724bd9a87d48ade5de74e5 or later.

You must enable it in switch.conf.xml with the param enable-softtimer-timerfd=true Or, enable it per channel with:

 Click here to expand Table of Contents

Testing TIMERFD feature in FreeSWITCH git

The TIMERFD feature is a linux specific feature to support timing in applications without using signals. I have no clue what specific advantages you get from this, but it's a new and modern way to do timing. So it must be very great :-)

Note that TIMERFD support is experimental and thus you should always use latest git when trying to use it.

To use the TIMERFD feature, you have to have a kernel with support for it. Check wether your kernel has such support with:

If you kernel does not support TIMERFD feature, you will need to rebuild it or use a different build/kernel.

Secondly, you will need the FreeSWITCH support. There are two ways to get this, as native core support or as mod_timerfd module.

TIMERFD support as mod_timerfd

To check wether the module is available, do:

To build the mod_timerfd in case it's not already there, add this line to your FreeSWITCH sources' modules.conf:

Then build the module with this command:

Finally install the module with this command:

Then you need to configure FreeSWITCH to actually load the mod_timerfd on startup. In /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml put a line like this:

Then restart FreeSWITCH:

Alternatively load the module from the CLI:


Verify wether timerfd timer is available when using mod_timerfd:

TIMERFD support natively in FreeSWITCH core

In the file /usr/local/freeswitch/conf/autoload_configs/switch.conf.xml you have to put this:

FreeSWITCH should then use TIMERFD to implement normal soft timer.

WARNING! Don't use both TIMERFD support methods. I accidentally tried and got huge performance loss on incoming calls while RINGING. I got a severe lag in Xorg. As soon as call was hungup, the lag was gone. I think to use both methods at the same time is not meant to be done.

See Also