[asterisk-commits] mmichelson: branch group/CCSS r226807 - in /team/group/CCSS: include/asterisk...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Nov 2 10:33:53 CST 2009
Author: mmichelson
Date: Mon Nov 2 10:33:50 2009
New Revision: 226807
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=226807
Log:
Remove the stop_monitoring agent callback.
Agents should stop monitoring on their own when
they receive notice that the caller has become available.
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=226807&r1=226806&r2=226807
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Mon Nov 2 10:33:50 2009
@@ -828,15 +828,6 @@
*/
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
*
* The core will call this callback when the
Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=226807&r1=226806&r2=226807
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Mon Nov 2 10:33:50 2009
@@ -1779,7 +1779,6 @@
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->callee_available != NULL);
ast_assert(callbacks->destructor != NULL);
}
@@ -1832,7 +1831,6 @@
static void cc_generic_agent_ack(struct ast_cc_agent *agent);
static int 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);
@@ -1845,7 +1843,6 @@
.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,
.callee_available = cc_generic_agent_recall,
.destructor = cc_generic_agent_destructor,
};
@@ -1945,8 +1942,11 @@
static void generic_agent_devstate_cb(const struct ast_event *event, void *userdata)
{
struct ast_cc_agent *agent = userdata;
+ struct cc_generic_agent_pvt *generic_pvt = agent->private_data;
struct ast_str *str = ast_str_alloca(128);
ast_str_set(&str, 0, "%s is no longer busy\n", agent->interface);
+ ast_assert(generic_pvt->sub != NULL);
+ generic_pvt->sub = ast_event_unsubscribe(generic_pvt->sub);
ast_cc_caller_available(agent->core_id, ast_str_buffer(str));
}
@@ -1965,16 +1965,6 @@
AST_EVENT_IE_END))) {
return -1;
}
- return 0;
-}
-
-static int cc_generic_agent_stop_monitoring(struct ast_cc_agent *agent)
-{
- struct cc_generic_agent_pvt *generic_pvt = agent->private_data;
-
- ast_assert(generic_pvt->sub != NULL);
-
- generic_pvt->sub = ast_event_unsubscribe(generic_pvt->sub);
return 0;
}
@@ -2472,7 +2462,6 @@
manager_event(EVENT_FLAG_CC, "CCRequestAcknowledged",
"CoreID: %d\r\n", core_instance->core_id);
} else if (previous_state == CC_CALLER_BUSY) {
- core_instance->agent->callbacks->stop_monitoring(core_instance->agent);
manager_event(EVENT_FLAG_CC, "CCCallerStopMonitoring",
"CoreID: %d\r\n"
"Caller: %s\r\n",
More information about the asterisk-commits
mailing list