[asterisk-commits] mmichelson: branch group/CCSS r213787 - /team/group/CCSS/apps/app_dial.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 23 16:38:44 CDT 2009


Author: mmichelson
Date: Sun Aug 23 16:38:40 2009
New Revision: 213787

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=213787
Log:
More progress and fix compilation errors.

Modified:
    team/group/CCSS/apps/app_dial.c

Modified: team/group/CCSS/apps/app_dial.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/apps/app_dial.c?view=diff&rev=213787&r1=213786&r2=213787
==============================================================================
--- team/group/CCSS/apps/app_dial.c (original)
+++ team/group/CCSS/apps/app_dial.c Sun Aug 23 16:38:40 2009
@@ -581,6 +581,7 @@
 };
 
 static int detect_disconnect(struct ast_channel *chan, char code, struct ast_str *featurecode);
+static void cc_set_done_flag(struct ast_channel *chan);
 
 static void hanguptree(struct chanlist *outgoing, struct ast_channel *exception, int answered_elsewhere)
 {
@@ -1672,10 +1673,10 @@
 	struct dial_cc_interfaces *old_cc_interfaces = data;
 	struct dial_cc_interfaces *new_cc_interfaces = ast_calloc(1, sizeof(*new_cc_interfaces));
 	if (!new_cc_interfaces) {
-		return NULL
+		return NULL;
 	}
 	new_cc_interfaces->done = old_cc_interfaces->done;
-	new_cc_interfaces->parent_id = old_cc_interfaces->parent_id;
+	new_cc_interfaces->dial_parent_id = old_cc_interfaces->dial_parent_id;
 	ao2_ref(old_cc_interfaces->interface_tree, +1);
 	new_cc_interfaces->interface_tree = old_cc_interfaces->interface_tree;
 	return new_cc_interfaces;
@@ -1700,7 +1701,6 @@
 	ast_channel_unlock(chan);
 }
 
-
 static struct ast_cc_interface *cc_extension_interface_init(const char * const exten, const char * const context, const unsigned int parent_id)
 {
 	struct ast_str *str = ast_str_alloca(2 * AST_MAX_EXTENSION);
@@ -1750,14 +1750,14 @@
 	AST_LIST_INSERT_TAIL(interfaces->interface_tree, cc_interface, next);
 	dial_cc_datastore->data = interfaces;
 	dial_cc_datastore->inheritance = DATASTORE_INHERIT_FOREVER;
-	dial_cc_datastore->parent_id = cc_interface->id;
+	cc_interfaces->dial_parent_id = cc_interface->id;
 	ast_channel_lock(chan);
 	ast_channel_datastore_add(chan, dial_cc_datastore);
 	ast_channel_unlock(chan);
 	return 0;
 }
 
-static int create_root_cc_interface(struct ast_channel *chan)
+static int create_root_cc_interface(struct ast_channel *chan, int *ignore_cc)
 {
 	/* All right. So here's the deal. There are three things
 	 * that can happen here:
@@ -1782,6 +1782,7 @@
 
 	struct ast_datastore *cc_interfaces_datastore;
 	struct dial_cc_interfaces *interfaces;
+	struct ast_cc_interface *cc_interface;
 	ast_channel_lock(chan);
 	if (!(cc_interfaces_datastore = ast_channel_datastore_find(chan, &dial_cc_interfaces_info, NULL))) {
 		/* Situation 1 has occurred */
@@ -1792,16 +1793,17 @@
 
 	interfaces = cc_interfaces_datastore->data;
 	if (!interfaces->done) {
-		/* Situation 2 has occurred */
-		struct ast_cc_interface *cc_interface = cc_extension_interface_init(S_OR(chan->macroexten, chan->exten), 
-				S_OR(chan->macrocontext, chan->context), interfaces->parent_id);
-		if (!cc_interface) {
-			return -1;
-		}
-		interfaces->parent_id = cc_interface->id;
-	} else {
 		/* Situation 3 has occurred */
-	}
+		*ignore_cc = 1;
+		return 0;
+	}
+
+	/* Situation 2 has occurred */
+	if (!(cc_interface = cc_extension_interface_init(S_OR(chan->macroexten, chan->exten), 
+			S_OR(chan->macrocontext, chan->context), interfaces->dial_parent_id))) {
+		return -1;
+	}
+	interfaces->dial_parent_id = cc_interface->id;
 	return 0;
 }
 
@@ -1869,6 +1871,7 @@
 	char *opt_args[OPT_ARG_ARRAY_SIZE];
 	struct ast_datastore *datastore = NULL;
 	int fulldial = 0, num_dialed = 0;
+	int ignore_cc = 0;
 
 	/* Reset all DIAL variables back to blank, to prevent confusion (in case we don't reset all of them). */
 	pbx_builtin_setvar_helper(chan, "DIALSTATUS", "");
@@ -1903,7 +1906,7 @@
 		goto done;
 	}
 
-	if (create_root_cc_interface(chan)) {
+	if (create_root_cc_interface(chan, &ignore_cc)) {
 		goto done;
 	}
 




More information about the asterisk-commits mailing list