[Asterisk-code-review] chan_sip: SDP: Sidestep stream parsing when its media is disabled. (asterisk[18])
Friendly Automation
asteriskteam at digium.com
Wed Jan 13 07:42:22 CST 2021
Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15271 )
Change subject: chan_sip: SDP: Sidestep stream parsing when its media is disabled.
......................................................................
chan_sip: SDP: Sidestep stream parsing when its media is disabled.
Previously, chan_sip parsed all known media streams in an SDP offer
like video (and text) even when videosupport=no (and textsupport=no).
This wasted processor power. Furthermore, chan_sip accepted SDP offers,
including no audio but just video (or text) streams although
videosupport=no (or textsupport=no). Finally, chan_sip denied the whole
offer instead of individual streams when they had encryption (SDES-sRTP)
unexpectedly enabled.
ASTERISK-29238
ASTERISK-29237
ASTERISK-29222
Change-Id: Ie49e4e2a11f0265f914b684738348ba8c0f89755
---
M channels/chan_sip.c
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Sean Bright: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 7218889..32959b0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10441,7 +10441,7 @@
rtcp_mux_offered = has_media_level_attribute(iterator, req, "rtcp-mux");
/* Check for 'audio' media offer */
- if (strncmp(m, "audio ", 6) == 0) {
+ if (p->rtp && strncmp(m, "audio ", 6) == 0) {
if ((sscanf(m, "audio %30u/%30u %17s %n", &x, &numberofports, protocol, &len) == 3 && len > 0) ||
(sscanf(m, "audio %30u %17s %n", &x, protocol, &len) == 2 && len > 0)) {
codecs = m + len;
@@ -10551,7 +10551,7 @@
}
}
/* Check for 'video' media offer */
- else if (strncmp(m, "video ", 6) == 0) {
+ else if (p->vrtp && strncmp(m, "video ", 6) == 0) {
if ((sscanf(m, "video %30u/%30u %17s %n", &x, &numberofports, protocol, &len) == 3 && len > 0) ||
(sscanf(m, "video %30u %17s %n", &x, protocol, &len) == 2 && len > 0)) {
codecs = m + len;
@@ -10630,7 +10630,7 @@
}
}
/* Check for 'text' media offer */
- else if (strncmp(m, "text ", 5) == 0) {
+ else if (p->trtp && strncmp(m, "text ", 5) == 0) {
if ((sscanf(m, "text %30u/%30u %17s %n", &x, &numberofports, protocol, &len) == 3 && len > 0) ||
(sscanf(m, "text %30u %17s %n", &x, protocol, &len) == 2 && len > 0)) {
codecs = m + len;
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15271
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ie49e4e2a11f0265f914b684738348ba8c0f89755
Gerrit-Change-Number: 15271
Gerrit-PatchSet: 3
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210113/38292a88/attachment-0001.html>
More information about the asterisk-code-review
mailing list