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

Friendly Automation asteriskteam at digium.com
Wed Jan 27 10:14:45 CST 2021


Friendly Automation has submitted this change. ( 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(-)

Approvals:
  Joshua Colp: 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 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: 2
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-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210127/c08a3493/attachment-0001.html>


More information about the asterisk-code-review mailing list