[Asterisk-code-review] chan_sip: SDP: Reject audio streams correctly. (asterisk[master])
Alexander Traud
asteriskteam at digium.com
Thu Jan 21 13:39:40 CST 2021
Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15333 )
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/33/15333/1
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 18a02bc..6c1914f 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13608,10 +13608,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/+/15333
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8bab31c7f3f3700dce204b429ad238a524efebb9
Gerrit-Change-Number: 15333
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/7ef99ff1/attachment.html>
More information about the asterisk-code-review
mailing list