[asterisk-commits] mmichelson: branch group/CCSS r214057 - in /team/group/CCSS: apps/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 25 12:40:37 CDT 2009


Author: mmichelson
Date: Tue Aug 25 12:40:34 2009
New Revision: 214057

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214057
Log:
Remove unused function from ccss.c and change the first control
frame handled logic in app_dial to be part of the datastore.


Modified:
    team/group/CCSS/apps/app_dial.c
    team/group/CCSS/main/ccss.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=214057&r1=214056&r2=214057
==============================================================================
--- team/group/CCSS/apps/app_dial.c (original)
+++ team/group/CCSS/apps/app_dial.c Tue Aug 25 12:40:34 2009
@@ -582,7 +582,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 handle_cc_control_frame(struct ast_channel *inbound, struct ast_channel *outbound, void *frame_data, int *first);
+static void handle_cc_control_frame(struct ast_channel *inbound, struct ast_channel *outbound, void *frame_data);
 
 static void hanguptree(struct chanlist *outgoing, struct ast_channel *exception, int answered_elsewhere)
 {
@@ -886,7 +886,6 @@
 #endif
 	struct ast_party_connected_line connected_caller;
 	struct ast_str *featurecode = ast_str_alloca(FEATURE_MAX_LEN + 1);
-	int first_cc_frame = 1;
 
 	ast_party_connected_line_init(&connected_caller);
 	if (single) {
@@ -988,7 +987,7 @@
 						/* This channel is forwarding the call, and is capable of CC, so
 						 * be sure to add the new device interface to the list
 						 */
-						handle_cc_control_frame(in, c, f->data.ptr, &first_cc_frame);
+						handle_cc_control_frame(in, c, f->data.ptr);
 					}
 					ast_frfree(f);
 				}
@@ -1141,7 +1140,7 @@
 					break;
 				case AST_CONTROL_CC:
 					if (!ignore_cc) {
-						handle_cc_control_frame(in, c, f->data.ptr, &first_cc_frame);
+						handle_cc_control_frame(in, c, f->data.ptr);
 					}
 					break;
 				case -1:
@@ -1674,6 +1673,14 @@
 	 */
 	char done;
 	/*!
+	 * When an AST_CONTROL_CC frame is received, we need to create
+	 * a new instance of the CC core. However, we only need to do
+	 * this one time, so if there are nested Dials, we need to let
+	 * the new one know not to try to create a new instance of the
+	 * core
+	 */
+	char core_created;
+	/*!
 	 * Reference-counted "tree" of interfaces.
 	 */
 	struct ast_cc_interface_tree *interface_tree;
@@ -1718,6 +1725,7 @@
 	}
 	new_cc_interfaces->done = old_cc_interfaces->done;
 	new_cc_interfaces->dial_parent_id = old_cc_interfaces->dial_parent_id;
+	new_cc_interfaces->core_created = old_cc_interfaces->core_created;
 	ao2_ref(old_cc_interfaces->interface_tree, +1);
 	new_cc_interfaces->interface_tree = old_cc_interfaces->interface_tree;
 	return new_cc_interfaces;
@@ -1903,10 +1911,9 @@
  * \param inbound The caller's channel
  * \param outbound The channel we read the control frame from
  * \param frame_data The data on the frame (XXX currently unused)
- * \param first Indicator of whether the frame we are reading is the first for the call.
  * \return void
  */
-static void handle_cc_control_frame(struct ast_channel *inbound, struct ast_channel *outbound, void *frame_data, int *first)
+static void handle_cc_control_frame(struct ast_channel *inbound, struct ast_channel *outbound, void *frame_data)
 {
 	char device_name[AST_CHANNEL_NAME];
 	char *dash;
@@ -1938,9 +1945,9 @@
 	/* If this is the first CC frame we're processing, we need to
 	 * save the list in the core.
 	 */
-	if (*first) {
+	if (!cc_interfaces->core_created) {
 		ast_cc_core_init_instance(inbound, cc_interfaces->interface_tree);
-		*first = 0;
+		cc_interfaces->core_created = 1;
 	}
 }
 

Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=214057&r1=214056&r2=214057
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Aug 25 12:40:34 2009
@@ -353,12 +353,6 @@
 	}
 }
 
-int ast_add_cc_interface_to_tree(struct ast_cc_interface_tree *cc_interface_tree, struct ast_cc_interface *cc_interface)
-{
-	AST_LIST_INSERT_TAIL(cc_interface_tree, cc_interface, next);
-	return 0;
-}
-
 void ast_cc_interface_tree_destroy(void *data)
 {
 	struct ast_cc_interface_tree *cc_interface_tree = data;




More information about the asterisk-commits mailing list