[Asterisk-code-review] res_pjsip_sdp_rtp.c: Use correct timeout when put on hold. (asterisk[20])

Benjamin Keith Ford asteriskteam at digium.com
Mon Dec 12 12:48:45 CST 2022


Benjamin Keith Ford has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19709 )


Change subject: res_pjsip_sdp_rtp.c: Use correct timeout when put on hold.
......................................................................

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.

ASTDEV-29

Change-Id: I7b106fc244332014216d12bba851cefe884cc25f
---
M res/res_pjsip_sdp_rtp.c
1 file changed, 20 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/09/19709/1

diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 75f1d54..33e1c58 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -2240,10 +2240,12 @@
 	 * 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) {
 		ast_rtp_instance_set_timeout(session_media->rtp, session->endpoint->media.rtp.timeout_hold);
+	} 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);
 	}
 
 	if (ast_rtp_instance_get_timeout(session_media->rtp)) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19709
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 20
Gerrit-Change-Id: I7b106fc244332014216d12bba851cefe884cc25f
Gerrit-Change-Number: 19709
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221212/e6f10a7c/attachment.html>


More information about the asterisk-code-review mailing list