[asterisk-commits] kmoore: branch kmoore/hidden_channels r392395 - in /team/kmoore/hidden_channe...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 20 23:12:44 CDT 2013


Author: kmoore
Date: Thu Jun 20 23:12:42 2013
New Revision: 392395

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392395
Log:
Change the hidden flag to a description

Modified:
    team/kmoore/hidden_channels/apps/confbridge/conf_chan_announce.c
    team/kmoore/hidden_channels/apps/confbridge/conf_chan_record.c
    team/kmoore/hidden_channels/include/asterisk/channel.h
    team/kmoore/hidden_channels/include/asterisk/stasis_channels.h
    team/kmoore/hidden_channels/main/cdr.c
    team/kmoore/hidden_channels/main/cel.c
    team/kmoore/hidden_channels/main/manager_bridging.c
    team/kmoore/hidden_channels/main/manager_channels.c
    team/kmoore/hidden_channels/main/stasis_channels.c

Modified: team/kmoore/hidden_channels/apps/confbridge/conf_chan_announce.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/apps/confbridge/conf_chan_announce.c?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/apps/confbridge/conf_chan_announce.c (original)
+++ team/kmoore/hidden_channels/apps/confbridge/conf_chan_announce.c Thu Jun 20 23:12:42 2013
@@ -115,9 +115,9 @@
 	return chan;
 }
 
-static int announce_hidden(struct ast_channel *chan)
-{
-	return 1;
+static const char *announce_role_description(struct ast_channel *chan)
+{
+	return "announcer";
 }
 
 static struct ast_channel_tech announce_tech = {
@@ -139,7 +139,7 @@
 	.send_text = ast_unreal_sendtext,
 	.queryoption = ast_unreal_queryoption,
 	.setoption = ast_unreal_setoption,
-	.hidden = announce_hidden,
+	.get_role_description = announce_role_description,
 };
 
 struct ast_channel_tech *conf_announce_get_tech(void)

Modified: team/kmoore/hidden_channels/apps/confbridge/conf_chan_record.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/apps/confbridge/conf_chan_record.c?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/apps/confbridge/conf_chan_record.c (original)
+++ team/kmoore/hidden_channels/apps/confbridge/conf_chan_record.c Thu Jun 20 23:12:42 2013
@@ -79,9 +79,9 @@
 	return chan;
 }
 
-static int rec_hidden(struct ast_channel *chan)
+static const char *rec_role_description(struct ast_channel *chan)
 {
-	return 1;
+	return "recorder";
 }
 
 static struct ast_channel_tech record_tech = {
@@ -91,7 +91,7 @@
 	.call = rec_call,
 	.read = rec_read,
 	.write = rec_write,
-	.hidden = rec_hidden,
+	.get_role_description = rec_role_description,
 };
 
 struct ast_channel_tech *conf_record_get_tech(void)

Modified: team/kmoore/hidden_channels/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/include/asterisk/channel.h?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/include/asterisk/channel.h (original)
+++ team/kmoore/hidden_channels/include/asterisk/channel.h Thu Jun 20 23:12:42 2013
@@ -739,15 +739,16 @@
 	int (*pre_call)(struct ast_channel *chan, const char *sub_args);
 
 	/*!
-	 * \brief Determine whether a channel should be hidden from external entities.
+	 * \brief Provide a textual description of this channel's role if and only
+	 * if it is an implementation detail of a feature, subsystem, or application.
 	 * \since 12.0
 	 *
 	 * \param chan Channel to check.
 	 *
-	 * \retval non-zero if the channel should be hidden.
-	 * \retval zero if the channel should not be hidden.
+	 * \retval A string describing the channel's role if it is an implementation detail.
+	 * \retval NULL if the channel is not an implementation detail.
 	 */
-	int (*hidden)(struct ast_channel *chan);
+	const char *(*get_role_description)(struct ast_channel *chan);
 };
 
 /*! Kill the channel channel driver technology descriptor. */

Modified: team/kmoore/hidden_channels/include/asterisk/stasis_channels.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/include/asterisk/stasis_channels.h?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/include/asterisk/stasis_channels.h (original)
+++ team/kmoore/hidden_channels/include/asterisk/stasis_channels.h Thu Jun 20 23:12:42 2013
@@ -60,6 +60,7 @@
 		AST_STRING_FIELD(connected_name);   /*!< Connected Line Name */
 		AST_STRING_FIELD(connected_number); /*!< Connected Line Number */
 		AST_STRING_FIELD(language);         /*!< The default spoken language for the channel */
+		AST_STRING_FIELD(role_description); /*!< A description of this channel's role if applicable */
 	);
 
 	struct timeval creationtime;            /*!< The time of channel creation */
@@ -70,7 +71,6 @@
 	int caller_pres;                        /*!< Caller ID presentation. */
 	struct ast_flags flags;                 /*!< channel flags of AST_FLAG_ type */
 	struct varshead *manager_vars;          /*!< Variables to be appended to manager events */
-	int hidden;                             /*!< Determines whether the channel should be hidden from external entities */
 };
 
 /*!

Modified: team/kmoore/hidden_channels/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/main/cdr.c?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/main/cdr.c (original)
+++ team/kmoore/hidden_channels/main/cdr.c Thu Jun 20 23:12:42 2013
@@ -1814,7 +1814,7 @@
 /*! \internal \brief Filter channel snapshots by technology */
 static int filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
 {
-	return snapshot->hidden;
+	return !ast_strlen_zero(snapshot->role_description);
 }
 
 /*! \internal \brief Filter a channel cache update */

Modified: team/kmoore/hidden_channels/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/main/cel.c?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/main/cel.c (original)
+++ team/kmoore/hidden_channels/main/cel.c Thu Jun 20 23:12:42 2013
@@ -1195,7 +1195,7 @@
 	if (!snapshot) {
 		return 0;
 	}
-	return snapshot->hidden;
+	return !ast_strlen_zero(snapshot->role_description);
 }
 
 static void cel_snapshot_update_cb(void *data, struct stasis_subscription *sub,

Modified: team/kmoore/hidden_channels/main/manager_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/main/manager_bridging.c?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/main/manager_bridging.c (original)
+++ team/kmoore/hidden_channels/main/manager_bridging.c Thu Jun 20 23:12:42 2013
@@ -373,7 +373,7 @@
 	}
 
 	snapshot = stasis_message_data(msg);
-	if (snapshot->hidden) {
+	if (!ast_strlen_zero(snapshot->role_description)) {
 		return 0;
 	}
 

Modified: team/kmoore/hidden_channels/main/manager_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/main/manager_channels.c?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/main/manager_channels.c (original)
+++ team/kmoore/hidden_channels/main/manager_channels.c Thu Jun 20 23:12:42 2013
@@ -529,7 +529,7 @@
 		return NULL;
 	}
 
-	if (snapshot->hidden) {
+	if (!ast_strlen_zero(snapshot->role_description)) {
 		ast_free(out);
 		return NULL;
 	}

Modified: team/kmoore/hidden_channels/main/stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/hidden_channels/main/stasis_channels.c?view=diff&rev=392395&r1=392394&r2=392395
==============================================================================
--- team/kmoore/hidden_channels/main/stasis_channels.c (original)
+++ team/kmoore/hidden_channels/main/stasis_channels.c Thu Jun 20 23:12:42 2013
@@ -190,8 +190,8 @@
 
 	snapshot->manager_vars = ast_channel_get_manager_vars(chan);
 
-	if (ast_channel_tech(chan)->hidden) {
-		snapshot->hidden = ast_channel_tech(chan)->hidden(chan);
+	if (ast_channel_tech(chan)->get_role_description) {
+		ast_string_field_set(snapshot, role_description, ast_channel_tech(chan)->get_role_description(chan));
 	}
 
 	ao2_ref(snapshot, +1);




More information about the asterisk-commits mailing list