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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 3 09:56:23 CDT 2009


Author: mmichelson
Date: Thu Sep  3 09:56:20 2009
New Revision: 215933

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=215933
Log:
Fill in CallCompletionCancel stub.


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=215933&r1=215932&r2=215933
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Sep  3 09:56:20 2009
@@ -1126,7 +1126,27 @@
 
 static int cccancel_exec(struct ast_channel *chan, const char *data)
 {
-	/* STUB */
+	struct cc_core_instance *core_instance;
+	char interface[AST_CHANNEL_NAME];
+	char *dash;
+
+	ast_copy_string(interface, chan->name, sizeof(interface));
+	if ((dash = strrchr(interface, '-'))) {
+		*dash = '\0';
+	}
+
+	if (!(core_instance = ao2_callback(cc_core_instances, 0, match_caller_core_instance, interface))) {
+		ast_log(LOG_WARNING, "Cannot fid CC transaction to cancel for caller %s\n", interface);
+		return -1;
+	}
+
+	if (strcmp(core_instance->agent->callbacks->type, "generic")) {
+		ast_log(LOG_WARNING, "CallCompletionCancel may only be used for calles with a generic agent\n");
+		ao2_ref(core_instance, -1);
+		return -1;
+	}
+	ast_cc_request_state_change(CC_FAILED, core_instance->core_id, "Call completion request Cancelled");
+	ao2_ref(core_instance, -1);
 	return 0;
 }
 




More information about the asterisk-commits mailing list