[svn-commits] mmichelson: branch group/CCSS r225390 - /team/group/CCSS/main/ccss.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 22 12:26:35 CDT 2009


Author: mmichelson
Date: Thu Oct 22 12:26:31 2009
New Revision: 225390

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225390
Log:
Manager event for when a callee proclaims that he can handle
CC requests, yo.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=225390&r1=225389&r2=225390
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Oct 22 12:26:31 2009
@@ -124,6 +124,41 @@
  */
 static int cc_request_state_change(enum cc_state, int core_id, const char * debug);
 
+static struct {
+	enum ast_cc_service_type service;
+	const char *service_string;
+} cc_service_to_string_map[] = {
+	{AST_CC_NONE, "NONE"},
+	{AST_CC_CCBS, "CCBS"},
+	{AST_CC_CCNR, "CCNR"},
+	{AST_CC_CCNL, "CCNL"},
+};
+
+static struct {
+	enum cc_state state;
+	const char *state_string;
+} cc_state_to_string_map[] = {
+	{CC_AVAILABLE,          "CC is available"},
+	{CC_CALLER_OFFERED,     "CC offered to caller"},
+	{CC_CALLER_REQUESTED,   "CC requested by caller"},
+	{CC_ACTIVE,             "CC accepted by callee"},
+	{CC_CALLEE_READY,       "Callee has become available"},
+	{CC_CALLER_BUSY,        "Callee was ready, but caller is now unavailable"},
+	{CC_RECALLING,          "Caller is attempting to recall"},
+	{CC_COMPLETE,           "Recall complete"},
+	{CC_FAILED,             "CC has failed"},
+};
+
+static const char *cc_state_to_string(enum cc_state state)
+{
+	return cc_state_to_string_map[state].state_string;
+}
+
+static const char *cc_service_to_string(enum ast_cc_service_type service)
+{
+	return cc_service_to_string_map[service].service_string;
+}
+
 static struct ao2_container *cc_core_instances;
 
 struct cc_core_instance {
@@ -1552,6 +1587,13 @@
 	AST_LIST_LOCK(cc_interfaces->interface_tree);
 	AST_LIST_INSERT_TAIL(cc_interfaces->interface_tree, tree_item, next);
 	AST_LIST_UNLOCK(cc_interfaces->interface_tree);
+
+	manager_event(EVENT_FLAG_CC, "CCAvailable",
+		"CoreID: %d\r\n"
+		"Callee: %s\r\n"
+		"Service: %s\r\n",
+		cc_interfaces->core_id, device_name, cc_service_to_string(cc_data->service)
+	);
 }
 
 int ast_cc_create_new_core(struct ast_channel *inbound)
@@ -2255,26 +2297,6 @@
 	pass_availability_up(link->parent, link->core_id);
 	cc_unref(monitor, "Kill reference from ast_cc_monitor_announce_availabilty");
 	return 0;
-}
-
-static struct {
-	enum cc_state state;
-	const char *state_string;
-} cc_state_to_string_map[] = {
-	{CC_AVAILABLE,          "CC is available"},
-	{CC_CALLER_OFFERED,     "CC offered to caller"},
-	{CC_CALLER_REQUESTED,   "CC requested by caller"},
-	{CC_ACTIVE,             "CC accepted by callee"},
-	{CC_CALLEE_READY,       "Callee has become available"},
-	{CC_CALLER_BUSY,        "Callee was ready, but caller is now unavailable"},
-	{CC_RECALLING,          "Caller is attempting to recall"},
-	{CC_COMPLETE,           "Recall complete"},
-	{CC_FAILED,             "CC has failed"},
-};
-
-static const char *cc_state_to_string(enum cc_state state)
-{
-	return cc_state_to_string_map[state].state_string;
 }
 
 struct cc_state_change_args {
@@ -2741,21 +2763,6 @@
 	return;
 }
 
-static struct {
-	enum ast_cc_service_type service;
-	const char *service_string;
-} cc_service_to_string_map[] = {
-	{AST_CC_NONE, "NONE"},
-	{AST_CC_CCBS, "CCBS"},
-	{AST_CC_CCNR, "CCNR"},
-	{AST_CC_CCNL, "CCNL"},
-};
-
-static const char *cc_service_to_string(enum ast_cc_service_type service)
-{
-	return cc_service_to_string_map[service].service_string;
-}
-
 static void cc_cli_print_monitor_stats(struct ast_cc_monitor *monitor, int fd, enum ast_cc_service_type service)
 {
 	struct ast_cc_monitor_link *link_iter;




More information about the svn-commits mailing list