freeswitch
freeswitch copied to clipboard
RTP Media Timeout is broken for calls on hold
If both 'media_hold_timeout_audio' and 'media_timeout_audio' are set, and 'media_timeout_audio' has a value less than 'media_hold_timeout_audio', then 'media_timeout_audio' is used instead of 'media_hold_timeout_audio' while the call is on hold.
This is a bug that's been introduced in 1.10.8 (and master), as a result of the following changes. src/switch_core_media.c
if (engine->type == SWITCH_MEDIA_TYPE_AUDIO) {
/* the values are in milliseconds, not in seconds as the deprecated rtp_timeout_sec */
engine->max_missed_packets = (engine->read_impl.samples_per_second * engine->media_timeout / 1000) / engine->read_impl.samples_per_packet;
switch_rtp_set_max_missed_packets(engine->rtp_session, engine->max_missed_packets);
if (!engine->media_hold_timeout) {
engine->media_hold_timeout = engine->media_timeout * 10;
}
engine->max_missed_hold_packets = (engine->read_impl.samples_per_second * engine->media_hold_timeout / 1000) / engine->read_impl.samples_per_packet;
}
In this commit: https://github.com/signalwire/freeswitch/commit/beffab1d680104f2c469d0947a2a8b0e09d9c343
Reversing the above changes resolves the issue.
@dragos-oancea @andywolk can you please comment on the above, would you like me to create a pull request to roll this back?