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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Nov 2 16:14:50 CST 2009


Author: mmichelson
Date: Mon Nov  2 16:14:46 2009
New Revision: 227048

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=227048
Log:
Add a "done" flag to the cc_recall_ds_data struct.

Now, like the original datastore used for CC, the recall
datastore also has an indicator for when CC is valid or not
for a particular interface.

There are some compile errors that I need to fix next.


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=227048&r1=227047&r2=227048
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Mon Nov  2 16:14:46 2009
@@ -1370,10 +1370,13 @@
 };
 
 /*!
- * \brief Routine to set the done flag on the dialed_cc_interfaces datastore
+ * \brief Routine to set the ignore flag on all CC datastores
  *
  * When we determine that further calls to Dial in a particular thread should
  * not pay attention to any new CC offers, we set this flag as an indicator.
+ *
+ * The same also applies for recall purposes. If a call is forwarded or a second
+ * Dial is invoked, then the target cannot be a purposeful target of a CC recall.
  *
  * \param chan The calling channel with teh dial_cc_interfaaces datastore on it
  * \return void
@@ -1381,12 +1384,19 @@
 void ast_ignore_cc(struct ast_channel *chan)
 {
 	struct ast_datastore *cc_datastore;
+	struct ast_datastore *cc_recall_datastore;
 	struct dialed_cc_interfaces *cc_interfaces;
+	struct cc_recall_ds_data *recall_cc_data;
 
 	ast_channel_lock(chan);
 	if ((cc_datastore = ast_channel_datastore_find(chan, &dialed_cc_interfaces_info, NULL))) {
 		cc_interfaces = cc_datastore->data;
 		cc_interfaces->done = 1;
+	}
+
+	if ((cc_recall_datastore = ast_channel_datastore_find(chan, &cc_recall_ds_info, NULL))) {
+		recall_cc_data = cc_recall_datastore->data;
+		recall_cc_data->done = 1;
 	}
 	ast_channel_unlock(chan);
 }
@@ -2786,6 +2796,7 @@
 
 struct cc_recall_ds_data {
 	int core_id;
+	char done;
 	struct ast_cc_interface_tree *interface_tree;
 };
 
@@ -2869,6 +2880,16 @@
 	}
 
 	recall_data = recall_datastore->data;
+
+	if (recall_data->done) {
+		/* Though this is a recall, the call to this particular interface is not part of the
+		 * recall either because this is a call forward or because this is not the first
+		 * invocation of Dial during this call
+		 */
+		ast_channel_unlock(chan);
+		return 0;
+	}
+
 	interface_tree = cc_ref(recall_data->interface_tree, "Bump refcount for tree while we search for specific channel");
 	ast_channel_get_device_name(chan, device_name, sizeof(device_name));
 	ast_str_set(&extencontext, 0, "%s@%s", S_OR(chan->macroexten, chan->exten), S_OR(chan->macrocontext, chan->context));




More information about the svn-commits mailing list