sippy / rtpproxy

The RTPproxy is a high-performance software proxy for RTP streams that can work together with Sippy B2BUA, Kamailio, OpenSIPS and SER.
http://rtpproxy.org
BSD 2-Clause "Simplified" License
418 stars 115 forks source link

Rework silence interpolation to work around duplicated silence problem. #61

Open synety-jdebp opened 7 years ago

synety-jdebp commented 7 years ago

The duplicated silence problem is an artefact of some soft 'phones that exist in the wild.

The scenario is a soft 'phone being put on hold and taken off hold by the other end. These particular soft 'phones sometimes end up sending two RTP packets as follows when they come off hold.

An actual receiving UA drops the first, delayed-arrival, audio; and the silence is implicit. extractaudio tries to do silence interpolation to sort-of match this (to the extent that it can, given that it doesn't discard audio). But it has two triggers for interpolated silence which are both triggered in this scenario. One trigger is the delayed arrival of old-timestamped audio. Another trigger is the gap in the timestamps. This ends up effectively doubling the silence period in the output audio file. (Heartbeats have some slight effect on this, and also result in timestamps decreasing if the hold period is longer than 800 seconds.)

This rework adjusts the silence interpolation as follows: