[asterisk-commits] mmichelson: branch group/CCSS r217525 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 9 16:57:09 CDT 2009


Author: mmichelson
Date: Wed Sep  9 16:57:07 2009
New Revision: 217525

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=217525
Log:
Part one of many of writing the generic agent callback function.


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

Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=217525&r1=217524&r2=217525
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Sep  9 16:57:07 2009
@@ -761,6 +761,13 @@
 
 	generic_pvt->sub = ast_event_unsubscribe(generic_pvt->sub);
 	return 0;
+}
+
+static void *generic_recall(void *data)
+{
+	struct ast_cc_agent *agent = data;
+	ast_log(LOG_NOTICE, "Now we should callback %s\n", agent->interface);
+	return NULL;
 }
 
 static int cc_generic_agent_recall(struct ast_cc_agent *agent)
@@ -817,6 +824,12 @@
 	 *
 	 * Phew!
 	 */
+
+	/* Background thread is sufficient since all this thread is going to do is
+	 * place a call to the calling channel and then start a PBX thread.
+	 */
+	pthread_t clotho;
+	ast_pthread_create_detached_background(&clotho, NULL, generic_recall, agent);
 	return 0;
 }
 
@@ -1220,6 +1233,8 @@
 		if (core_instance->current_state != CC_CALLEE_READY) {
 			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n", core_instance->current_state, args->state);
 		}
+		core_instance->current_state = args->state;
+		core_instance->agent->callbacks->recall(core_instance->agent);
 		break;
 	case CC_COMPLETE:
 		/* Recall has made progress, call agent and monitor destructor functions




More information about the asterisk-commits mailing list