[Asterisk-code-review] channel: Set up calls without audio (text+video), again. (asterisk[master])
George Joseph
asteriskteam at digium.com
Wed Jan 27 11:05:29 CST 2021
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15334 )
Change subject: channel: Set up calls without audio (text+video), again.
......................................................................
channel: Set up calls without audio (text+video), again.
ASTERISK-29259
Change-Id: Ib6a6550e0e08355745d66da8e60ef49e81f9c6c5
---
M main/channel.c
1 file changed, 10 insertions(+), 3 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/main/channel.c b/main/channel.c
index d75c615..9730ed0 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -6264,8 +6264,13 @@
/* find the best audio format to use */
tmp_cap = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT);
- if (tmp_cap) {
- ast_format_cap_append_from_cap(tmp_cap, request_cap, AST_MEDIA_TYPE_AUDIO);
+ if (!tmp_cap) {
+ AST_RWLIST_UNLOCK(&backends);
+ return NULL;
+ }
+
+ ast_format_cap_append_from_cap(tmp_cap, request_cap, AST_MEDIA_TYPE_AUDIO);
+ if (!ast_format_cap_empty(tmp_cap)) {
/* We have audio - is it possible to connect the various calls to each other?
(Avoid this check for calls without audio, like text+video calls)
*/
@@ -6296,7 +6301,9 @@
}
ast_format_cap_append_from_cap(joint_cap, request_cap, AST_MEDIA_TYPE_UNKNOWN);
ast_format_cap_remove_by_type(joint_cap, AST_MEDIA_TYPE_AUDIO);
- ast_format_cap_append(joint_cap, best_audio_fmt, 0);
+ if (best_audio_fmt) { /* text+video call? then, this is NULL */
+ ast_format_cap_append(joint_cap, best_audio_fmt, 0);
+ }
ao2_cleanup(tmp_converted_cap);
c = chan->tech->requester(type, joint_cap, assignedids, requestor, addr, cause);
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15334
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ib6a6550e0e08355745d66da8e60ef49e81f9c6c5
Gerrit-Change-Number: 15334
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/4534d8c6/attachment.html>
More information about the asterisk-code-review
mailing list