[Asterisk-code-review] app confbridge: Add talking indicator for ConfBridgeList AMI... (asterisk[15])

William McCall asteriskteam at digium.com
Mon May 28 22:13:19 CDT 2018


William McCall has uploaded this change for review. ( https://gerrit.asterisk.org/9061


Change subject: app_confbridge: Add talking indicator for ConfBridgeList AMI response
......................................................................

app_confbridge: Add talking indicator for ConfBridgeList AMI response

When an AMI client connects, it cannot determine if a user was talking
prior to a transition in the user speaking state (which would generate
a ConfbridgeTalking event). This patch causes app_confbridge to track the
talking state and make this state available via ConfBridgeList.

ASTERISK-27877 #close

Change-Id: I19b5284f34966c3fda94f5b99a7e40e6b89767c6
---
M apps/app_confbridge.c
M apps/confbridge/include/confbridge.h
2 files changed, 15 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/61/9061/1

diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index f3f0fdf..177429b 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -276,6 +276,13 @@
 						<enum name="No"/>
 					</enumlist>
 				</parameter>
+				<parameter name="Talking">
+					<para>Is this user talking?</para>
+					<enumlist>
+						<enum name="Yes"/>
+						<enum name="No"/>
+					</enumlist>
+				</parameter>
 				<parameter name="AnsweredTime">
 					<para>The number of seconds the channel has been up.</para>
 				</parameter>
@@ -2102,7 +2109,7 @@
 
 static int conf_handle_talker_cb(struct ast_bridge_channel *bridge_channel, void *hook_pvt, int talking)
 {
-	const struct confbridge_user *user = hook_pvt;
+	struct confbridge_user *user = hook_pvt;
 	RAII_VAR(struct confbridge_conference *, conference, NULL, ao2_cleanup);
 	struct ast_json *talking_extras;
 
@@ -2111,6 +2118,10 @@
 		/* Remove the hook since the conference does not exist. */
 		return -1;
 	}
+
+	ao2_lock(conference);
+	user->talking = talking;
+	ao2_unlock(conference);
 
 	talking_extras = ast_json_pack("{s: s, s: b}",
 		"talking_status", talking ? "on" : "off",
@@ -3562,6 +3573,7 @@
 		"EndMarked: %s\r\n"
 		"Waiting: %s\r\n"
 		"Muted: %s\r\n"
+		"Talking: %s\r\n"
 		"AnsweredTime: %d\r\n"
 		"%s"
 		"\r\n",
@@ -3573,6 +3585,7 @@
 		AST_YESNO(ast_test_flag(&user->u_profile, USER_OPT_ENDMARKED)),
 		AST_YESNO(waiting),
 		AST_YESNO(user->muted),
+		AST_YESNO(user->talking),
 		ast_channel_get_up_time(user->chan),
 		ast_str_buffer(snap_str));
 
diff --git a/apps/confbridge/include/confbridge.h b/apps/confbridge/include/confbridge.h
index 0a0a571..f9187e0 100644
--- a/apps/confbridge/include/confbridge.h
+++ b/apps/confbridge/include/confbridge.h
@@ -269,6 +269,7 @@
 	unsigned int muted:1;                        /*!< Has the user requested to be muted? */
 	unsigned int kicked:1;                       /*!< User has been kicked from the conference */
 	unsigned int playing_moh:1;                  /*!< MOH is currently being played to the user */
+	unsigned int talking:1;                      /*!< User is currently talking */
 	AST_LIST_HEAD_NOLOCK(, post_join_action) post_join_list; /*!< List of sounds to play after joining */;
 	AST_LIST_ENTRY(confbridge_user) list;        /*!< Linked list information */
 };

-- 
To view, visit https://gerrit.asterisk.org/9061
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I19b5284f34966c3fda94f5b99a7e40e6b89767c6
Gerrit-Change-Number: 9061
Gerrit-PatchSet: 1
Gerrit-Owner: William McCall <william.mccall at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180528/fde646c3/attachment.html>


More information about the asterisk-code-review mailing list