[Asterisk-code-review] app confbridge: Add the Muted header to ConfbridgeJoin AMI e... (asterisk[certified/13.18])
Jenkins2
asteriskteam at digium.com
Wed Feb 7 06:02:11 CST 2018
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8142 )
Change subject: app_confbridge: Add the Muted header to ConfbridgeJoin AMI event.
......................................................................
app_confbridge: Add the Muted header to ConfbridgeJoin AMI event.
ASTERISK-27651
Change-Id: Idef2ca54d242d1b894efd3fc7b360bc6fd5bdc34
---
M CHANGES
M apps/app_confbridge.c
M apps/confbridge/confbridge_manager.c
3 files changed, 43 insertions(+), 13 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/CHANGES b/CHANGES
index e582152..1fc2a7f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -9,6 +9,15 @@
==============================================================================
------------------------------------------------------------------------------
+--- Functionality changes from Asterisk 13.18-cert2 to Asterisk 13.18-cert3 --
+------------------------------------------------------------------------------
+
+app_confbridge
+------------------
+ * Added the Muted header to the ConfbridgeJoin AMI event to indicate the
+ participant's starting mute status.
+
+------------------------------------------------------------------------------
--- Functionality changes from Asterisk 13.17.0 to Asterisk 13.18.0 ----------
------------------------------------------------------------------------------
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 3ea336a..afeac48 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -528,9 +528,9 @@
{
struct ast_json *json_object;
- json_object = ast_json_pack("{s: b}",
- "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN)
- );
+ json_object = ast_json_pack("{s: b, s: b}",
+ "admin", ast_test_flag(&user->u_profile, USER_OPT_ADMIN),
+ "muted", user->muted);
if (!json_object) {
return;
}
diff --git a/apps/confbridge/confbridge_manager.c b/apps/confbridge/confbridge_manager.c
index bca854e..9ac0d55 100644
--- a/apps/confbridge/confbridge_manager.c
+++ b/apps/confbridge/confbridge_manager.c
@@ -83,6 +83,13 @@
<enum name="No"/>
</enumlist>
</parameter>
+ <parameter name="Muted">
+ <para>The joining mute status.</para>
+ <enumlist>
+ <enum name="Yes"/>
+ <enum name="No"/>
+ </enumlist>
+ </parameter>
</syntax>
<see-also>
<ref type="managerEvent">ConfbridgeLeave</ref>
@@ -254,20 +261,33 @@
"%s",
conference_name,
ast_str_buffer(bridge_text),
- S_COR(channel_text, ast_str_buffer(channel_text), ""),
- S_COR(extra_text, ast_str_buffer(extra_text), ""));
+ channel_text ? ast_str_buffer(channel_text) : "",
+ extra_text ? ast_str_buffer(extra_text) : "");
+}
+
+static int get_bool_header(struct ast_str **extra_text, struct stasis_message *message,
+ const char *json_key, const char *ami_header)
+{
+ const struct ast_bridge_blob *blob = stasis_message_data(message);
+ const struct ast_json *obj;
+
+ obj = ast_json_object_get(blob->blob, json_key);
+ if (!obj) {
+ return -1;
+ }
+
+ return ast_str_append_event_header(extra_text, ami_header,
+ AST_YESNO(ast_json_is_true(obj)));
}
static int get_admin_header(struct ast_str **extra_text, struct stasis_message *message)
{
- const struct ast_bridge_blob *blob = stasis_message_data(message);
- const struct ast_json *admin = ast_json_object_get(blob->blob, "admin");
- if (!admin) {
- return -1;
- }
+ return get_bool_header(extra_text, message, "admin", "Admin");
+}
- return ast_str_append_event_header(extra_text, "Admin",
- S_COR(ast_json_is_true(admin), "Yes", "No"));
+static int get_muted_header(struct ast_str **extra_text, struct stasis_message *message)
+{
+ return get_bool_header(extra_text, message, "muted", "Muted");
}
static void confbridge_start_cb(void *data, struct stasis_subscription *sub,
@@ -298,7 +318,8 @@
{
struct ast_str *extra_text = NULL;
- if (!get_admin_header(&extra_text, message)) {
+ if (!get_admin_header(&extra_text, message)
+ && !get_muted_header(&extra_text, message)) {
confbridge_publish_manager_event(message, "ConfbridgeJoin", extra_text);
}
ast_free(extra_text);
--
To view, visit https://gerrit.asterisk.org/8142
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.18
Gerrit-MessageType: merged
Gerrit-Change-Id: Idef2ca54d242d1b894efd3fc7b360bc6fd5bdc34
Gerrit-Change-Number: 8142
Gerrit-PatchSet: 2
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180207/b9d6a47c/attachment.html>
More information about the asterisk-code-review
mailing list