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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 27 11:08:44 CDT 2009


Author: mmichelson
Date: Thu Aug 27 11:08:40 2009
New Revision: 214358

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214358
Log:
Add more agent callbacks.


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

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=214358&r1=214357&r2=214358
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Thu Aug 27 11:08:40 2009
@@ -577,6 +577,18 @@
 	 */
 	void *(*init)(struct ast_cc_agent *agent, struct ast_channel *chan);
 	/*!
+	 * \brief Start the offer timer
+	 *
+	 * The core will call this when the
+	 * CC_CALLER_OFFERED state is entered.
+	 * The agent needs to start its configured
+	 * offer timer. Preferably this will be done
+	 * in the same scheduler context as other
+	 * operations within the realm of the
+	 * particular agent.
+	 */
+	int (*start_offer_timer)(struct ast_cc_agent *agent);
+	/*!
 	 * \brief Acknowledge CC request callback.
 	 *
 	 * The core will call this callback when
@@ -594,6 +606,26 @@
 	 * ast_cc_agent_status_request function.
 	 */
 	enum ast_device_state (*status_request)(struct ast_cc_agent *agent);
+	/*!
+	 * \brief Begin monitoring a busy device
+	 *
+	 * The core will call this callback when the
+	 * CC_CALLER_BUSY state is entered. The agent
+	 * should begin monitoring the caller and report
+	 * to the core when the caller has become available
+	 * by requesting a state change to the CC_ACTIVE
+	 * state.
+	 */
+	int (*start_monitoring)(struct ast_cc_agent *agent);
+	/*!
+	 * \brief Cease monitoring a monitored device
+	 *
+	 * The core will call this callback from the 
+	 * CC_ACTIVE state if the previous state was
+	 * CC_CALLER_BUSY. The agent should stop
+	 * monitoring its device for availability.
+	 */
+	int (*stop_monitoring)(struct ast_cc_agent *agent);
 	/*!
 	 * \brief Initiate the recall to the agent's device
 	 *

Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=214358&r1=214357&r2=214358
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Aug 27 11:08:40 2009
@@ -56,15 +56,21 @@
 
 /* Generic agent callbacks */
 static void *cc_generic_agent_init(struct ast_cc_agent *agent, struct ast_channel *chan);
+static int cc_generic_agent_start_offer_timer(struct ast_cc_agent *agent);
 static void cc_generic_agent_ack(struct ast_cc_agent *agent);
 static enum ast_device_state cc_generic_agent_status_request(struct ast_cc_agent *agent);
+static int cc_generic_agent_start_monitoring(struct ast_cc_agent *agent);
+static int cc_generic_agent_stop_monitoring(struct ast_cc_agent *agent);
 static int cc_generic_agent_recall(struct ast_cc_agent *agent);
 static void cc_generic_agent_destructor(struct ast_cc_agent *agent);
 
 static struct ast_cc_agent_callbacks generic_agent_callbacks = {
 	.init = cc_generic_agent_init,
+	.start_offer_timer = cc_generic_agent_start_offer_timer,
 	.ack = cc_generic_agent_ack,
 	.status_request = cc_generic_agent_status_request,
+	.start_monitoring = cc_generic_agent_start_monitoring,
+	.stop_monitoring = cc_generic_agent_stop_monitoring,
 	.recall = cc_generic_agent_recall,
 	.destructor = cc_generic_agent_destructor,
 };
@@ -514,8 +520,11 @@
 static void check_callback_sanity(const struct ast_cc_agent_callbacks *callbacks)
 {
 	ast_assert(callbacks->init != NULL);
+	ast_assert(callbacks->start_offer_timer != NULL);
 	ast_assert(callbacks->ack != NULL);
 	ast_assert(callbacks->status_request != NULL);
+	ast_assert(callbacks->start_monitoring != NULL);
+	ast_assert(callbacks->stop_monitoring != NULL);
 	ast_assert(callbacks->recall != NULL);
 	ast_assert(callbacks->destructor != NULL);
 }
@@ -595,6 +604,12 @@
 	return NULL;
 }
 
+static int cc_generic_agent_start_offer_timer(struct ast_cc_agent *agent)
+{
+	/* STUB */
+	return 0;
+}
+
 static void cc_generic_agent_ack(struct ast_cc_agent *agent)
 {
 	/* STUB */
@@ -607,13 +622,27 @@
 	return 0;
 }
 
+static int cc_generic_agent_start_monitoring(struct ast_cc_agent *agent)
+{
+	/* STUB */
+	return 0;
+}
+
+static int cc_generic_agent_stop_monitoring(struct ast_cc_agent *agent)
+{
+	/* STUB */
+	return 0;
+}
+
 static int cc_generic_agent_recall(struct ast_cc_agent *agent)
 {
+	/* STUB */
 	return 0;
 }
 
 static void cc_generic_agent_destructor(struct ast_cc_agent *agent)
 {
+	/* STUB */
 	return;
 }
 




More information about the asterisk-commits mailing list