From: Ben Ford Date: Mon, 12 Dec 2022 18:42:17 +0000 (-0600) Subject: res_pjsip_sdp_rtp.c: Use correct timeout when put on hold. X-Git-Tag: 18.17.0-rc1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cec98b5f0cfce209b496d35c6433e9a33bada137;p=thirdparty%2Fasterisk.git res_pjsip_sdp_rtp.c: Use correct timeout when put on hold. When a call is put on hold and it has moh_passthrough and rtp_timeout set on the endpoint, the wrong timeout will be used. rtp_timeout_hold is expected to be used, but rtp_timeout is used instead. This change adds a couple of checks for locally_held to determine if rtp_timeout_hold needs to be used instead of rtp_timeout. ASTERISK-30350 Change-Id: I7b106fc244332014216d12bba851cefe884cc25f --- diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 75f1d540d2..8d1c5c3635 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -2240,9 +2240,9 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session, * instance itself. */ ast_rtp_instance_set_timeout(session_media->rtp, 0); - if (session->endpoint->media.rtp.timeout && !session_media->remotely_held) { + if (session->endpoint->media.rtp.timeout && !session_media->remotely_held && !session_media->locally_held) { ast_rtp_instance_set_timeout(session_media->rtp, session->endpoint->media.rtp.timeout); - } else if (session->endpoint->media.rtp.timeout_hold && session_media->remotely_held) { + } else if (session->endpoint->media.rtp.timeout_hold && (session_media->remotely_held || session_media->locally_held)) { ast_rtp_instance_set_timeout(session_media->rtp, session->endpoint->media.rtp.timeout_hold); }