[Asterisk-code-review] res/res_pjsip_session.c: Check that media type matches in function as... (asterisk[16])

Robert Cripps asteriskteam at digium.com
Tue Dec 22 04:56:48 CST 2020


Robert Cripps has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15230 )


Change subject: res/res_pjsip_session.c: Check that media type matches in function ast_sip_session_media_state_add.
......................................................................

res/res_pjsip_session.c: Check that media type matches in
function ast_sip_session_media_state_add.

Check ast_media_type matches when a ast_sip_session_media is found
otherwise when transitioning from say image to audio, the wrong
session is returned in the first if statement.

ASTERISK-29220 #close

Change-Id: I6f6efa9b821ebe8881bb4c8c957f8802ddcb4b5d
---
M res/res_pjsip_session.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/30/15230/1

diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 34bd597..eb1233b 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -497,7 +497,7 @@
 	 */
 	if (position < AST_VECTOR_SIZE(&media_state->sessions)) {
 		session_media = AST_VECTOR_GET(&media_state->sessions, position);
-		if (session_media) {
+		if (session_media && session_media->type == type) {
 			SCOPE_EXIT_RTN_VALUE(session_media, "Using existing media_session\n");
 		}
 	}

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I6f6efa9b821ebe8881bb4c8c957f8802ddcb4b5d
Gerrit-Change-Number: 15230
Gerrit-PatchSet: 1
Gerrit-Owner: Robert Cripps <rcripps at voxbone.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20201222/1ec90503/attachment.html>


More information about the asterisk-code-review mailing list