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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 19 15:25:02 CST 2010


Author: mmichelson
Date: Fri Feb 19 15:24:58 2010
New Revision: 248100

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=248100
Log:
Add a CC_REQUEST_STATUS to the dialplan app CallCompletionRequest
so that its value can be used to determine if the request could be made.


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=248100&r1=248099&r2=248100
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Feb 19 15:24:58 2010
@@ -3874,19 +3874,22 @@
 	if (strcmp(core_instance->agent->callbacks->type, "generic")) {
 		ast_log_dynamic_level(cc_logger_level, "Core %d: CallCompletionRequest is only for generic agent types.\n",
 				core_instance->core_id);
+		pbx_builtin_setvar_helper(chan, "CC_REQUEST_RESULT", "FAIL");
 		cc_unref(core_instance, "Unref core_instance since CallCompletionRequest was called with native agent");
-		return -1;
+		return 0;
 	}
 
 	if (!ast_cc_request_is_within_limits()) {
 		ast_log_dynamic_level(cc_logger_level, "Core %d: CallCompletionRequest failed. Too many requests in the system\n",
 				core_instance->core_id);
 		ast_cc_failed(core_instance->core_id, "Too many CC requests\n");
+		pbx_builtin_setvar_helper(chan, "CC_REQUEST_RESULT", "FAIL");
 		cc_unref(core_instance, "Unref core_instance since too many CC requests");
-		return -1;
+		return 0;
 	}
 
 	res = ast_cc_agent_accept_request(core_instance->core_id, "CallCompletionRequest called by caller %s for core_id %d", device_name, core_instance->core_id);
+	pbx_builtin_setvar_helper(chan, "CC_REQUEST_RESULT", res ? "FAIL" : "SUCCESS");
 	cc_unref(core_instance, "Done with CallCompletionRequest");
 	return res;
 }




More information about the asterisk-commits mailing list