Linux – How to turn off RTP buffering for SIP calls in FreeSWITCH pbx software

freepbxlinuxsiptelephony

I want to turn off buffering of SIP calls in freeswitch pbx software.

Freeswitch holds RTP data from clients in buffer and sends it every 20ms.

I want to freeswitch pass throught packets without holding.

How to configure it?

—– EDIT (additional info) —–

I have two SIP clients and FreeSwitch PBX.

Voice 8 kHz sample rate, A-Law coding (8 bytes per sample, no compression)

When I call directly from one client to another the tcpdump output on one client is:

00:00:00.000475 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.031599 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.032012 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.000315 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.031775 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.000384 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.031499 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.031986 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.000475 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.031578 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.031936 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.000419 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172
00:00:00.031573 IP 10.64.177.34.5440 > 10.64.0.42.5082: UDP, length 172

But when I connect from one client to another using pbx as middle point I got:

00:00:00.020013 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.019969 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.020017 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.019984 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.020078 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.020016 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.019850 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.020045 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.020012 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.019974 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.020054 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.019996 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172
00:00:00.019972 IP 10.64.72.24.30230 > 10.64.0.42.5078: UDP, length 172

The average time in both cases is aproximate 20ms (slighter less in direct case), but non regular data portions seems better for client because there is no gaps in heard voice (in speaker or headphones). I suppose that regular period portions of data cause problems due to clock drift problem.

So I want to turn off this feature in FreeSwitch, so the data will come in original timestamps.

Best Answer

I found a solution to my question.

You need to add line

<X-PRE-PROCESS cmd="set" data="rtp_notimer_during_bridge=true"/>

in file

/etc/freeswitch/vars.xml

This causes FreeSwitch in bridged mode to preserve original packet intervals.

Related Question