[asterisk-commits] mmichelson: branch group/CCSS r235222 - in /team/group/CCSS: include/asterisk...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 15 17:08:13 CST 2009


Author: mmichelson
Date: Tue Dec 15 17:08:11 2009
New Revision: 235222

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235222
Log:
Create a user of the stop_ringing agent callback.


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

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=235222&r1=235221&r2=235222
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Tue Dec 15 17:08:11 2009
@@ -1052,6 +1052,8 @@
 
 /* END STATUS REQUEST/RESPONSE API */
 
+int ast_cc_monitor_stop_ringing(int core_id);
+
 /* BEGIN API FOR USE WITH/BY MONITORS */
 
 /*!

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=235222&r1=235221&r2=235222
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Dec 15 17:08:11 2009
@@ -3118,6 +3118,33 @@
 			cc_ref(core_instance, "Ref core instance for status request callback"));
 }
 
+static int cc_stop_ringing(void *data)
+{
+	struct cc_core_instance *core_instance = data;
+	int res;
+
+	res = core_instance->agent->callbacks->stop_ringing(core_instance->agent);
+	/* If an agent is being asked to stop ringing, then he needs to be prepared if for
+	 * whatever reason he needs to be called back again. The proper state to be in to
+	 * detect such a circumstance is the CC_ACTIVE state.
+	 */
+	cc_request_state_change(CC_ACTIVE, core_id, "Agent asked to stop ringing. Be prepared to be recalled again.");
+	cc_unref(core_instance, "Stop ringing finished. Unref core_instance");
+	return res;
+}
+
+int ast_cc_monitor_stop_ringing(int core_id)
+{
+	struct cc_core_instance *core_instance = find_cc_core_instance(core_id);
+
+	if (!core_instance) {
+		return -1;
+	}
+
+	return ast_taskprocessor_push(cc_core_taskprocessor, cc_stop_ringing,
+			cc_ref(core_instance, "Ref core instance for stop ringing callback"));
+}
+
 struct cc_status_response_args {
 	enum ast_device_state devstate;
 	struct cc_core_instance *core_instance;




More information about the asterisk-commits mailing list