[Asterisk-code-review] res rtp asterisk: Always update SRTP on local SSRC change. (asterisk[master])

Jenkins2 asteriskteam at digium.com
Thu May 3 10:29:38 CDT 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8886 )

Change subject: res_rtp_asterisk: Always update SRTP on local SSRC change.
......................................................................

res_rtp_asterisk: Always update SRTP on local SSRC change.

When the local SSRC changes we need to update the SRTP information
so that the proper key is used. This is commonly done as a result
of bridging two channels together. Previously we only updated
the SRTP information if media had already flowed, but in practice
the channel driver may have already performed SRTP negotiation and
set up the previous SSRC. We now always do it on a local SSRC
change.

ASTERISK-27795
ASTERISK-27800

Change-Id: Ia7c8e74c28841388b5244ac0b8fd6c1dc6ee4c10
---
M res/res_rtp_asterisk.c
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 4ac20d5..5579914 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3947,15 +3947,15 @@
 	if (rtp->lastts) {
 		/* We simply set this bit so that the next packet sent will have the marker bit turned on */
 		ast_set_flag(rtp, FLAG_NEED_MARKER_BIT);
+	}
 
-		ast_debug(3, "Changing ssrc from %u to %u due to a source change\n", rtp->ssrc, ssrc);
+	ast_debug(3, "Changing ssrc from %u to %u due to a source change\n", rtp->ssrc, ssrc);
 
-		if (srtp) {
-			ast_debug(3, "Changing ssrc for SRTP from %u to %u\n", rtp->ssrc, ssrc);
-			res_srtp->change_source(srtp, rtp->ssrc, ssrc);
-			if (rtcp_srtp != srtp) {
-				res_srtp->change_source(rtcp_srtp, rtp->ssrc, ssrc);
-			}
+	if (srtp) {
+		ast_debug(3, "Changing ssrc for SRTP from %u to %u\n", rtp->ssrc, ssrc);
+		res_srtp->change_source(srtp, rtp->ssrc, ssrc);
+		if (rtcp_srtp != srtp) {
+			res_srtp->change_source(rtcp_srtp, rtp->ssrc, ssrc);
 		}
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/8886
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7c8e74c28841388b5244ac0b8fd6c1dc6ee4c10
Gerrit-Change-Number: 8886
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180503/272170b2/attachment-0001.html>


More information about the asterisk-code-review mailing list