[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r242519 - in /team/group/CC...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 23 15:07:52 CST 2010


Author: mmichelson
Date: Sat Jan 23 15:07:44 2010
New Revision: 242519

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242519
Log:
Write a quick function necessary for native CC monitors on recalls.

The doxygen says it all.


Modified:
    team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h
    team/group/CCSS_Monitor_Restructure/main/ccss.c

Modified: team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h?view=diff&rev=242519&r1=242518&r2=242519
==============================================================================
--- team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h (original)
+++ team/group/CCSS_Monitor_Restructure/include/asterisk/ccss.h Sat Jan 23 15:07:44 2010
@@ -1328,6 +1328,26 @@
  * \retval non-zero This is a recall and the channel in question is directly involved.
  */
 int ast_cc_is_recall(struct ast_channel *chan, int *core_id, const char * const monitor_type);
+
+/*!
+ * \since 1.8
+ * \brief Get the associated monitor given the device name and core_id
+ *
+ * \details
+ * The function ast_cc_is_recall is helpful for determining if a call to
+ * a specific channel is a recall. However, once you have determined that
+ * this is a recall, you will most likely need access to the private data
+ * within the associated monitor. This functio is what one uses to get
+ * that monitor.
+ *
+ * \param core_id The core ID to which this recall corresponds. This likely will
+ * have been obtained using the ast_cc_is_recall function
+ * \param device_name Which device to find the monitor for.
+ *
+ * \retval NULL Appropriate monitor does not exist
+ * \retval non-NULL The monitor to use for this recall
+ */
+struct ast_cc_monitor *ast_cc_get_monitor_by_recall_core_id(const int core_id, const char * const device_name);
 
 /*!
  * \since 1.8

Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=242519&r1=242518&r2=242519
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Sat Jan 23 15:07:44 2010
@@ -2692,6 +2692,25 @@
 	return 0;
 }
 
+struct ast_cc_monitor *ast_cc_get_monitor_by_recall_core_id(const int core_id, const char * const device_name)
+{
+	struct cc_core_instance *core_instance = find_cc_core_instance(core_id);
+	struct ast_cc_monitor *monitor_iter;
+
+	if (!core_instance) {
+		return NULL;
+	}
+
+	AST_DLLIST_LOCK(core_instance->monitors);
+	AST_DLLIST_TRAVERSE(core_instance->monitors, monitor_iter, next) {
+		if (!strcmp(monitor_iter->interface->name, device_name)) {
+			break;
+		}
+	}
+	AST_DLLIST_UNLOCK(core_instance->monitors);
+	return monitor_iter;
+}
+
 int ast_cc_agent_set_interfaces_chanvar(struct ast_channel *chan, struct ast_cc_agent *agent)
 {
 	struct ast_datastore *recall_datastore;




More information about the asterisk-commits mailing list