The test results are not reliable, and the source of the problem seems to be in CPU resource scarcity inside a VM, and not in clock precision.
This is a set of test scripts that verify if the FreeSWITCH host system has a precise enough clock, so that FreeSWITCH can reliably send RTP with even intervals. Some versions of KVM and VmWare are known to deliver poor clock precision.
These scripts are based on the experience gained from FS-7805 issue in FreeSWITRCH JIRA.
The following procedure installs a minimal configuration and the daily master branch build of FreeSWITCH. You can also install the stable branch if you remove the "debian-unstable" repository link. Also the stable branch can be installed on a Wheezy host.
If you prefer not to use the minimal configuration, the default (so called vanilla) configuration will also work with this test suite.
apt-get update && apt-get install -y curl git
cd /etc
git clone https://github.com/voxserv/freeswitch_conf_minimal.git freeswitch
cat >/etc/apt/sources.list.d/freeswitch.list <<EOT
deb http://files.freeswitch.org/repo/deb/debian-unstable/ jessie main
deb http://files.freeswitch.org/repo/deb/debian/ jessie main
EOT
wget -O - https://files.freeswitch.org/repo/deb/debian/key.gpg |apt-key add -
apt-get update && apt-get install -y freeswitch-all
apt-get install -y libmath-vector-real-perl libmath-vector-real-xs-perl sox
cd /opt
git clone https://github.com/voxserv/test_fs_clock.git
cp /opt/test_fs_clock/999_test_fs_clock.xml /etc/freeswitch/dialplan/public/
fs_cli -x 'reloadxml'
The package libmath-vector-real-xs-perl
is not available, but the
script runs without it too.
/opt/test_fs_clock/run_dialer
/opt/test_fs_clock/compare_spectrums /var/tmp/test_fs_clock_*.wav
The compare_spectrums
script takes the frequency histogram of the
first WAV file and compares it as a vector against histograms of all
other WAV files.
If you see all zeros in Distance output, your clock is perfectly fine. If you see varying values above zero, it means that FreeSWITCH does not get a precise clock, and some applications, such as conference, would suffer from distortions.
After the test is finished, it makes sense to remove the XML from FreeSWITCH configuration:
rm /etc/freeswitch/dialplan/public/999_test_fs_clock.xml
fs_cli -x 'reloadxml'
Stanislav Sinyagin [email protected]