]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix ptime from known broken endpoints on re-invite
authorHristo Trendev <htrendev@gmail.com>
Tue, 30 Sep 2014 09:11:27 +0000 (11:11 +0200)
committerHristo Trendev <htrendev@gmail.com>
Tue, 30 Sep 2014 09:19:35 +0000 (11:19 +0200)
Freeswitch tries to fix timing issues (wrong ptime) on re-invite the same way
it does for the initial invite. This results in small audio glitches, while it
sends a couple of packets with different ptime, before the timing detection
logic figures out the remote (broken) endpoint true ptime.

In order to avoid unnecessary timing changes, this patch overwrites the
advertised ptime from known broken endpoints with the ptime, which was detected
by freeswitch. It does this by checking if the sip_h_X-Broken-PTIME (1.2.x) or
rtp_h_X-Broken-PTIME (master) variables are set.

FS-6644 #resolve

src/switch_core_media.c

index 844497cc803803a57ee0cc6c2dd0801422bda06c..18735a957cbfff77da7f2941750aaa5368d9dc6f 100644 (file)
@@ -3419,6 +3419,11 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
 
                                codec_ms = ptime;
 
+                               if (switch_channel_get_variable(session->channel, "rtp_h_X-Broken-PTIME") && a_engine->read_impl.microseconds_per_packet) {
+                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Overwriting ptime from a known broken endpoint with the currently used value of %d ms\n", a_engine->read_impl.microseconds_per_packet / 1000);
+                                       codec_ms = a_engine->read_impl.microseconds_per_packet / 1000;
+                               }
+
                                if (maxptime && (!codec_ms || codec_ms > maxptime)) {
                                        codec_ms = maxptime;
                                }