[svn-commits] mmichelson: branch group/CCSS r246668 - in /team/group/CCSS: channels/ includ...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Feb 15 16:08:10 CST 2010


Author: mmichelson
Date: Mon Feb 15 16:08:06 2010
New Revision: 246668

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=246668
Log:
First commit dealing with name consistency issues.

Use the term "dialstring" instead of "dialable_name"
from now on.


Modified:
    team/group/CCSS/channels/chan_local.c
    team/group/CCSS/include/asterisk/ccss.h
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_local.c?view=diff&rev=246668&r1=246667&r2=246668
==============================================================================
--- team/group/CCSS/channels/chan_local.c (original)
+++ team/group/CCSS/channels/chan_local.c Mon Feb 15 16:08:06 2010
@@ -690,7 +690,7 @@
 	}
 	snprintf(full_dest, sizeof(full_dest), "Local/%s", dest);
 	ast_set_cc_interfaces_chanvar(p->chan, reduced_dest);
-	ast_cc_set_extension_dialable_name(p->chan, full_dest);
+	ast_cc_set_extension_dialstring(p->chan, full_dest);
 
 	/* Start switch on sub channel */
 	if (!(res = ast_pbx_start(p->chan)))

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=246668&r1=246667&r2=246668
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Mon Feb 15 16:08:06 2010
@@ -101,7 +101,7 @@
  *
  * \param chan The channel onto which to queue the frame
  * \param monitor_type The type of monitor to use when CC is requested
- * \param dialable_name The dial string used to call the device
+ * \param dialstring The dial string used to call the device
  * \param service The type of CC service the device is willing to offer
  * \param private_data If a native monitor is being used, and some channel-driver-specific private
  * data has been allocated, then this parameter should contain a pointer to that data. If using a generic
@@ -111,7 +111,7 @@
  * \retval -1 Error
  */
 int ast_queue_cc_frame(struct ast_channel *chan, const char * const monitor_type,
-		const char * const dialable_name, enum ast_cc_service_type service, void *private_data);
+		const char * const dialstring, enum ast_cc_service_type service, void *private_data);
 
 /*!
  * \brief Allocate and initialize an ast_cc_config_params structure
@@ -506,7 +506,7 @@
 	 * to recognize as being a CC recall. Similarly, ISDN will need a specific
 	 * dial string to know that the call is a recall.
 	 */
-	char *dialable_name;
+	char *dialstring;
 	/*!
 	 * The ID of the available timer used by the current monitor
 	 */
@@ -662,7 +662,7 @@
  * will never be used outside of that file, so you can safely ignore
  * this function, most likely.
  */
-void ast_cc_set_extension_dialable_name(struct ast_channel *chan, const char * const dialable_name);
+void ast_cc_set_extension_dialstring(struct ast_channel *chan, const char * const dialstring);
 
 /*!
  * \since 1.8
@@ -1435,7 +1435,7 @@
  * \param cc_params The CC configuration parameters for the outbound target
  * \param monitor_type The type of monitor to use when CC is requested
  * \param device_name The name of the outbound target device.
- * \param dialable_name The dial string used when calling this specific interface
+ * \param dialstring The dial string used when calling this specific interface
  * \param private_data If a native monitor is being used, and some channel-driver-specific private
  * data has been allocated, then this parameter should contain a pointer to that data. If using a generic
  * monitor, this parameter should remain NULL. Note that if this function should fail at some point,
@@ -1452,7 +1452,7 @@
  * by the channel driver.
  */
 void ast_cc_busy_interface(struct ast_channel *inbound, struct ast_cc_config_params *cc_params,
-	const char *monitor_type, const char * const device_name, const char * const dialable_name, void *private_data);
+	const char *monitor_type, const char * const device_name, const char * const dialstring, void *private_data);
 
 /*!
  * \since 1.8
@@ -1468,7 +1468,7 @@
  * \param cc_params The CC configuration parameters for the outbound target
  * \param monitor_type The type of monitor to use when CC is requested
  * \param device_name The name of the outbound target device.
- * \param dialable_name The dial string used when calling this specific interface
+ * \param dialstring The dial string used when calling this specific interface
  * \param service What kind of CC service is being offered. (CCBS/CCNR/etc...)
  * \param private_data If a native monitor is being used, and some channel-driver-specific private
  * data has been allocated, then this parameter should contain a pointer to that data. If using a generic
@@ -1481,7 +1481,7 @@
  */
 int ast_cc_build_frame(struct ast_channel *chan, struct ast_cc_config_params *cc_params,
 	const char *monitor_type, const char * const device_name,
-	const char * const dialable_name, enum ast_cc_service_type service, void *private_data,
+	const char * const dialstring, enum ast_cc_service_type service, void *private_data,
 	struct ast_frame *frame);
 
 
@@ -1493,7 +1493,7 @@
  * \param cc_params The CC configuration parameters for the outbound target
  * \param monitor_type The type of monitor to use when CC is requested
  * \param device_name The name of the outbound target device.
- * \param dialable_name The dial string used when calling this specific interface
+ * \param dialstring The dial string used when calling this specific interface
  * \param private_data If a native monitor is being used, and some channel-driver-specific private
  * data has been allocated, then this parameter should contain a pointer to that data. If using a generic
  * monitor, this parameter should remain NULL. Note that if this function should fail at some point,
@@ -1507,7 +1507,7 @@
  * \return Nothing
  */
 typedef void (*ast_cc_callback_fn)(struct ast_channel *chan, struct ast_cc_config_params *cc_params,
-	const char *monitor_type, const char * const device_name, const char * const dialable_name, void *private_data);
+	const char *monitor_type, const char * const device_name, const char * const dialstring, void *private_data);
 
 /*!
  * \since 1.8

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=246668&r1=246667&r2=246668
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Mon Feb 15 16:08:06 2010
@@ -153,7 +153,7 @@
 	struct ast_cc_config_params config_params;
 	int parent_interface_id;
 	char device_name[AST_CHANNEL_NAME];
-	char dialable_name[AST_CHANNEL_NAME];
+	char dialstring[AST_CHANNEL_NAME];
 };
 
 /*!
@@ -1267,7 +1267,7 @@
 		monitor->callbacks->destructor(monitor->private_data);
 	}
 	cc_unref(monitor->interface, "Unreffing tree's reference to interface");
-	ast_free(monitor->dialable_name);
+	ast_free(monitor->dialstring);
 }
 
 static void cc_interface_tree_destroy(void *data)
@@ -1344,7 +1344,7 @@
 	 * This needs to be preserved as the dialable name on an extension tree item
 	 * which may be created for the local channel.
 	 */
-	char *current_extension_dialable_name;
+	char *current_extension_dialstring;
 	/*!
 	 * Reference-counted "tree" of interfaces.
 	 */
@@ -1367,7 +1367,7 @@
 {
 	struct dialed_cc_interfaces *cc_interfaces = data;
 	cc_unref(cc_interfaces->interface_tree, "Unref dial's ref to interface tree");
-	ast_free(cc_interfaces->current_extension_dialable_name);
+	ast_free(cc_interfaces->current_extension_dialstring);
 	ast_free(cc_interfaces);
 }
 
@@ -1415,7 +1415,7 @@
 	.destroy = dialed_cc_interfaces_destroy,
 };
 
-void ast_cc_set_extension_dialable_name(struct ast_channel *chan, const char * const dialable_name)
+void ast_cc_set_extension_dialstring(struct ast_channel *chan, const char * const dialstring)
 {
 	struct ast_datastore *datastore;
 	struct dialed_cc_interfaces *cc_interfaces;
@@ -1427,7 +1427,7 @@
 	}
 
 	cc_interfaces = datastore->data;
-	cc_interfaces->current_extension_dialable_name = ast_strdup(dialable_name);
+	cc_interfaces->current_extension_dialstring = ast_strdup(dialstring);
 	ast_channel_unlock(chan);
 	return;
 }
@@ -1598,12 +1598,12 @@
  * to happen anyway.
  *
  * \param device_name The name of the device being added to the tree
- * \param dialable_name The dialstring used to dial the device being added
+ * \param dialstring The dialstring used to dial the device being added
  * \param parent_id The parent of this new tree node.
  * \retval NULL Memory allocation failure
  * \retval non-NULL The new ast_cc_interface created.
  */
-static struct ast_cc_monitor *cc_device_monitor_init(const char * const device_name, const char * const dialable_name, const struct ast_control_cc_payload *cc_data, int core_id)
+static struct ast_cc_monitor *cc_device_monitor_init(const char * const device_name, const char * const dialstring, const struct ast_control_cc_payload *cc_data, int core_id)
 {
 	struct ast_cc_interface *cc_interface;
 	struct ast_cc_monitor *monitor;
@@ -1627,7 +1627,7 @@
 		return NULL;
 	}
 
-	if (!(monitor->dialable_name = ast_strdup(dialable_name))) {
+	if (!(monitor->dialstring = ast_strdup(dialstring))) {
 		cc_unref(monitor, "Failed to copy dialable name. Unref monitor");
 		cc_unref(cc_interface, "Failed to copy dialable name");
 		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
@@ -1675,7 +1675,7 @@
 void ast_handle_cc_control_frame(struct ast_channel *inbound, struct ast_channel *outbound, void *frame_data)
 {
 	char *device_name;
-	char *dialable_name;
+	char *dialstring;
 	struct ast_cc_monitor *monitor;
 	struct ast_datastore *cc_datastore;
 	struct dialed_cc_interfaces *cc_interfaces;
@@ -1683,7 +1683,7 @@
 	struct cc_core_instance *core_instance;
 
 	device_name = cc_data->device_name;
-	dialable_name = cc_data->dialable_name;
+	dialstring = cc_data->dialstring;
 
 	ast_channel_lock(inbound);
 	if (!(cc_datastore = ast_channel_datastore_find(inbound, &dialed_cc_interfaces_info, NULL))) {
@@ -1744,7 +1744,7 @@
 	}
 	AST_DLLIST_UNLOCK(cc_interfaces->interface_tree);
 
-	if (!(monitor = cc_device_monitor_init(device_name, dialable_name, cc_data, cc_interfaces->core_id))) {
+	if (!(monitor = cc_device_monitor_init(device_name, dialstring, cc_data, cc_interfaces->core_id))) {
 		ast_log(LOG_WARNING, "Unable to create CC device interface for '%s'. CC services will be unavailable on this interface.\n", device_name);
 		cc_unref(core_instance, "Returning early from ast_handle_cc_control_frame");
 		call_destructor_with_no_monitor(cc_data->monitor_type, cc_data->private_data);
@@ -1833,7 +1833,7 @@
 	/* In situation 2, chan_local will have set the extension's dialable name
 	 * on the datastore, so we need to copy that into this monitor.
 	 */
-	monitor->dialable_name = ast_strdup(interfaces->current_extension_dialable_name);
+	monitor->dialstring = ast_strdup(interfaces->current_extension_dialstring);
 	AST_DLLIST_LOCK(interfaces->interface_tree);
 	cc_ref(monitor, "Interface tree's reference to the monitor");
 	AST_DLLIST_INSERT_TAIL(interfaces->interface_tree, monitor, next);
@@ -2830,7 +2830,7 @@
 	struct cc_recall_ds_data *recall_data;
 	struct ast_str *var_value = ast_str_create(64);
 	int multi = 0;
-	char previous_dialable_name[AST_CHANNEL_NAME] = "";
+	char previous_dialstring[AST_CHANNEL_NAME] = "";
 	int top_level_id;
 
 	ast_channel_lock(chan);
@@ -2848,11 +2848,11 @@
 	top_level_id = monitor_iter->id;
 
 	while ((monitor_iter = AST_DLLIST_NEXT(monitor_iter, next))) {
-		if (monitor_iter->parent_id == top_level_id && strcmp(monitor_iter->dialable_name, previous_dialable_name)) {
-			char *dialable_name = monitor_iter->dialable_name;
-			ast_str_append(&var_value, 0, "%s%s", multi ? "&" : "", dialable_name);
+		if (monitor_iter->parent_id == top_level_id && strcmp(monitor_iter->dialstring, previous_dialstring)) {
+			char *dialstring = monitor_iter->dialstring;
+			ast_str_append(&var_value, 0, "%s%s", multi ? "&" : "", dialstring);
 			multi = 1;
-			ast_copy_string(previous_dialable_name, dialable_name, sizeof(previous_dialable_name));
+			ast_copy_string(previous_dialstring, dialstring, sizeof(previous_dialstring));
 		}
 	}
 	AST_DLLIST_UNLOCK(interface_tree);
@@ -2873,7 +2873,7 @@
 	unsigned int exten_id = 0;
 	struct ast_str *var_value = ast_str_create(64);
 	int multi = 0;
-	char previous_dialable_name[AST_CHANNEL_NAME] = "";
+	char previous_dialstring[AST_CHANNEL_NAME] = "";
 
 	ast_channel_lock(chan);
 	if (!(recall_datastore = ast_channel_datastore_find(chan, &recall_ds_info, NULL))) {
@@ -2907,11 +2907,11 @@
 	/* I kind of feel wrong re-using monitor_iter here, but eh, it works
 	 */
 	while ((monitor_iter = AST_DLLIST_NEXT(monitor_iter, next))) {
-		if (monitor_iter->parent_id == exten_id && strcmp(monitor_iter->dialable_name, previous_dialable_name)) {
-			char *dialable_name = monitor_iter->dialable_name;
-			ast_str_append(&var_value, 0, "%s%s", multi ? "&" : "", dialable_name);
+		if (monitor_iter->parent_id == exten_id && strcmp(monitor_iter->dialstring, previous_dialstring)) {
+			char *dialstring = monitor_iter->dialstring;
+			ast_str_append(&var_value, 0, "%s%s", multi ? "&" : "", dialstring);
 			multi = 1;
-			ast_copy_string(previous_dialable_name, dialable_name, sizeof(previous_dialable_name));
+			ast_copy_string(previous_dialstring, dialstring, sizeof(previous_dialstring));
 		}
 	}
 	AST_DLLIST_UNLOCK(interface_tree);
@@ -3259,7 +3259,7 @@
 }
 
 static int cc_build_payload(struct ast_channel *chan, struct ast_cc_config_params *cc_params,
-	const char *monitor_type, const char * const device_name, const char * dialable_name,
+	const char *monitor_type, const char * const device_name, const char * dialstring,
 	enum ast_cc_service_type service, void *private_data, struct ast_control_cc_payload *payload)
 {
 	struct ast_datastore *datastore;
@@ -3282,12 +3282,12 @@
 	ast_cc_copy_config_params(&payload->config_params, cc_params);
 	payload->parent_interface_id = dial_parent_id;
 	ast_copy_string(payload->device_name, device_name, sizeof(payload->device_name));
-	ast_copy_string(payload->dialable_name, dialable_name, sizeof(payload->dialable_name));
+	ast_copy_string(payload->dialstring, dialstring, sizeof(payload->dialstring));
 	return 0;
 }
 
 int ast_queue_cc_frame(struct ast_channel *chan, const char *monitor_type, 
-		const char * const dialable_name, enum ast_cc_service_type service, void *private_data)
+		const char * const dialstring, enum ast_cc_service_type service, void *private_data)
 {
 	struct ast_frame frame = {0,};
 	char device_name[AST_CHANNEL_NAME];
@@ -3304,7 +3304,7 @@
 		return -1;
 	}
 
-	if (ast_cc_build_frame(chan, cc_params, monitor_type, device_name, dialable_name, service, private_data, &frame)) {
+	if (ast_cc_build_frame(chan, cc_params, monitor_type, device_name, dialstring, service, private_data, &frame)) {
 		/* Frame building failed. We can't use this. */
 		return -1;
 	}
@@ -3315,7 +3315,7 @@
 
 int ast_cc_build_frame(struct ast_channel *chan, struct ast_cc_config_params *cc_params,
 	const char *monitor_type, const char * const device_name,
-	const char * const dialable_name, enum ast_cc_service_type service, void *private_data,
+	const char * const dialstring, enum ast_cc_service_type service, void *private_data,
 	struct ast_frame *frame)
 {
 	struct ast_control_cc_payload *payload = ast_calloc(1, sizeof(*payload));
@@ -3323,7 +3323,7 @@
 	if (!payload) {
 		return -1;
 	}
-	if (cc_build_payload(chan, cc_params, monitor_type, device_name, dialable_name, service, private_data, payload)) {
+	if (cc_build_payload(chan, cc_params, monitor_type, device_name, dialstring, service, private_data, payload)) {
 		/* Something screwed up, we can't make a frame with this */
 		ast_free(payload);
 		return -1;
@@ -3370,10 +3370,10 @@
 }
 
 void ast_cc_busy_interface(struct ast_channel *inbound, struct ast_cc_config_params *cc_params,
-	const char *monitor_type, const char * const device_name, const char * const dialable_name, void *private_data)
+	const char *monitor_type, const char * const device_name, const char * const dialstring, void *private_data)
 {
 	struct ast_control_cc_payload payload;
-	if (cc_build_payload(inbound, cc_params, monitor_type, device_name, dialable_name, AST_CC_CCBS, private_data, &payload)) {
+	if (cc_build_payload(inbound, cc_params, monitor_type, device_name, dialstring, AST_CC_CCBS, private_data, &payload)) {
 		/* Something screwed up. Don't try to handle this payload */
 		call_destructor_with_no_monitor(monitor_type, private_data);
 		return;




More information about the svn-commits mailing list