[asterisk-commits] mmichelson: branch group/CCSS r214269 - in /team/group/CCSS: include/asterisk...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Aug 26 15:00:38 CDT 2009
Author: mmichelson
Date: Wed Aug 26 15:00:34 2009
New Revision: 214269
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214269
Log:
Add type field to ast_cc_agent and declare the various 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=214269&r1=214268&r2=214269
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Wed Aug 26 15:00:34 2009
@@ -548,6 +548,10 @@
};
struct ast_cc_agent {
+ /*! The type of the agent being used. Will be a string
+ * such as "SIP" "ISDN" or "generic"
+ */
+ const char *type;
/*! Which instance of the core state machine does this
* agent pertain to?
*/
@@ -561,11 +565,54 @@
};
struct ast_cc_agent_callbacks {
- /* Allocate callback */
- /* Acknowledge CCSS request callback */
- /* Status request callback */
- /* Initiate recall callback */
- /* Destroy_callback */
+ /*!
+ * \brief Initialization callback.
+ *
+ * This callback is called when the CC core
+ * is initialized. Agents should allocate
+ * any private data necessary for the
+ * call.
+ */
+ void *(*init)(struct ast_cc_agent *agent, struct ast_channel *chan);
+ /*!
+ * \brief Acknowledge CC request callback.
+ *
+ * The core will call this callback when
+ * the CC_ACTIVE state is entered. Agents
+ * should send whatever message is necessary
+ * to acknowledge a pending CC request.
+ */
+ void (*ack)(struct ast_cc_agent *agent);
+ /*!
+ * \brief Request the status of the agent's device
+ *
+ * The core will call this callback when the
+ * CC_CALLEE_READY state is entered. In addition,
+ * this callback is called through the public
+ * ast_cc_agent_status_request function.
+ */
+ enum ast_device_state (*status_request)(void *data);
+ /*!
+ * \brief Initiate the recall to the agent's device
+ *
+ * The core will call this callback when the
+ * CC_RECALLING state is reached. The agent should
+ * take whatever action is necessary in order to
+ * make his device initiate a CC recall.
+ */
+ int (*recall)(struct ast_cc_agent *agent);
+ /*!
+ * \brief Destroy private data on the agent
+ *
+ * The core will call this callback when the
+ * CC_COMPLETE or CC_FAILED state is reached.
+ *
+ * XXX A SIP agent will not actually fully destroy
+ * its private data when this is called. It actually
+ * will wait for the upstream element to cancel
+ * its CCSS subscription.
+ */
+ void (*destructor)(struct ast_cc_agent *agent);
};
/*!
Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=214269&r1=214268&r2=214269
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Aug 26 15:00:34 2009
@@ -457,6 +457,7 @@
* This is why we pass CMP_STOP in addition to CMP_MATCH.
*/
if (!strcmp(pending_offer->caller, caller)) {
+ /* XXX Remember to remove this notice if I use this callback for other purposes */
ast_log(LOG_NOTICE, "Killing duplicate pending offer for caller '%s'\n", caller);
return CMP_MATCH | CMP_STOP;
}
More information about the asterisk-commits
mailing list