[Asterisk-code-review] chan_sip: SDP: Reject audio streams correctly. (asterisk[16])

Alexander Traud asteriskteam at digium.com
Thu Jan 21 13:40:58 CST 2021


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15365 )


Change subject: chan_sip: SDP: Reject audio streams correctly.
......................................................................

chan_sip: SDP: Reject audio streams correctly.

This completes the fix for ASTERISK_24543. Only when the call is an
outgoing call, consult and append the configured format capabilities
(p->caps). When all audio formats got rejected the negotiated format
capabilities (p->jointcaps) contain no audio formats for incoming
calls. This is required when there are other accepted media streams.

ASTERISK-29258

Change-Id: I8bab31c7f3f3700dce204b429ad238a524efebb9
---
M channels/chan_sip.c
1 file changed, 5 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/15365/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ca0f7bf..1c9c729 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13607,10 +13607,11 @@
 			ast_format_cap_append_from_cap(tmpcap, p->jointcaps, AST_MEDIA_TYPE_UNKNOWN);
 		}
 
-		/* Check if we need audio */
-		if (ast_format_cap_has_type(tmpcap, AST_MEDIA_TYPE_AUDIO)
-			|| ast_format_cap_has_type(p->caps, AST_MEDIA_TYPE_AUDIO)) {
-			needaudio = TRUE;
+		/* Check if we need audio in this call */
+		needaudio = ast_format_cap_has_type(tmpcap, AST_MEDIA_TYPE_AUDIO);
+		if (!needaudio && p->outgoing_call) {
+			/* p->caps are added conditionally, see below "Finally our remain..." */
+			needaudio = ast_format_cap_has_type(p->caps, AST_MEDIA_TYPE_AUDIO);
 		}
 
 		/* Check if we need video in this call */

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I8bab31c7f3f3700dce204b429ad238a524efebb9
Gerrit-Change-Number: 15365
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210121/b4e8ac9d/attachment.html>


More information about the asterisk-code-review mailing list