[Asterisk-code-review] res rtp asterisk: Allow remote SSRC to change on an RTP inst... (asterisk[15])
Joshua Colp
asteriskteam at digium.com
Wed Aug 30 07:30:15 CDT 2017
Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/6328
Change subject: res_rtp_asterisk: Allow remote SSRC to change on an RTP instance.
......................................................................
res_rtp_asterisk: Allow remote SSRC to change on an RTP instance.
When SDP renegotiation occurs it is possible for an RTP
instance to be reused for a new stream, resulting in the remote
SSRC changing if it is part of a bundle group. This change
allows this and updates its mapping in the current bundle
group.
ASTERISK-2731
Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490
---
M res/res_rtp_asterisk.c
1 file changed, 26 insertions(+), 1 deletion(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/6328/1
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 0f4f6ab..ab80384 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -6173,10 +6173,35 @@
{
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
- if (rtp->themssrc) {
+ if (rtp->themssrc == ssrc) {
return;
}
+ /* If this is bundled we need to update the SSRC mapping */
+ if (rtp->bundled) {
+ struct ast_rtp *bundled_rtp;
+ int index;
+
+ ao2_unlock(instance);
+
+ /* The child lock can't be held while accessing the parent */
+ ao2_lock(rtp->bundled);
+ bundled_rtp = ast_rtp_instance_get_data(rtp->bundled);
+
+ for (index = 0; index < AST_VECTOR_SIZE(&bundled_rtp->ssrc_mapping); ++index) {
+ struct rtp_ssrc_mapping *mapping = AST_VECTOR_GET_ADDR(&bundled_rtp->ssrc_mapping, index);
+
+ if (mapping->ssrc == rtp->themssrc) {
+ mapping->ssrc = ssrc;
+ break;
+ }
+ }
+
+ ao2_unlock(rtp->bundled);
+
+ ao2_lock(instance);
+ }
+
rtp->themssrc = ssrc;
}
--
To view, visit https://gerrit.asterisk.org/6328
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e3703974f236bc024c5dbe9bd43adae0c6fb490
Gerrit-Change-Number: 6328
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170830/572a1c91/attachment.html>
More information about the asterisk-code-review
mailing list