[svn-commits] mmichelson: branch group/CCSS r224772 - in /team/group/CCSS: funcs/ include/a...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Oct 20 11:05:24 CDT 2009


Author: mmichelson
Date: Tue Oct 20 11:05:20 2009
New Revision: 224772

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=224772
Log:
Fix a bunch of trailing whitespace problems.`


Modified:
    team/group/CCSS/funcs/func_callcompletion.c
    team/group/CCSS/include/asterisk/ccss.h
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/funcs/func_callcompletion.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/funcs/func_callcompletion.c?view=diff&rev=224772&r1=224771&r2=224772
==============================================================================
--- team/group/CCSS/funcs/func_callcompletion.c (original)
+++ team/group/CCSS/funcs/func_callcompletion.c Tue Oct 20 11:05:20 2009
@@ -56,7 +56,7 @@
 	</function>
  ***/
 
-static int acf_cc_read(struct ast_channel *chan, const char *name, char *data, 
+static int acf_cc_read(struct ast_channel *chan, const char *name, char *data,
 		char *buf, size_t buf_len)
 {
 	struct ast_cc_config_params *cc_params;

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=224772&r1=224771&r2=224772
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Tue Oct 20 11:05:20 2009
@@ -51,16 +51,16 @@
 	CC_AVAILABLE,
 	/*! Entered when a CCSS agent has offered CCSS to a caller */
 	CC_CALLER_OFFERED,
-	/*! Entered when a CCSS agent confirms that a caller has 
+	/*! Entered when a CCSS agent confirms that a caller has
 	 * requested CCSS */
 	CC_CALLER_REQUESTED,
-	/*! Entered when a CCSS monitor confirms acknowledgment of an 
+	/*! Entered when a CCSS monitor confirms acknowledgment of an
 	 * outbound CCSS request */
 	CC_ACTIVE,
-	/*! Entered when a CCSS monitor alerts the core that the called party 
+	/*! Entered when a CCSS monitor alerts the core that the called party
 	 * has become available */
 	CC_CALLEE_READY,
-	/*! Entered when a CCSS agent alerts the core that the calling party 
+	/*! Entered when a CCSS agent alerts the core that the calling party
 	 * may not be recalled because he is unavailable
 	 */
 	CC_CALLER_BUSY,
@@ -181,7 +181,7 @@
 /*!
  * \brief get a CCSS configuration parameter, given its name
  *
- * Useful when reading input as a string, like from dialplan or 
+ * Useful when reading input as a string, like from dialplan or
  * manager.
  *
  * \param params The CCSS configuration from which to get the value
@@ -408,11 +408,11 @@
 #define AST_CC_GENERIC_MONITOR_TYPE "generic"
 
 /*!
- * \brief a link that connects two monitors in the weighted graph of 
+ * \brief a link that connects two monitors in the weighted graph of
  * monitor structures.
  *
- * The parent and child pointers are ao2 objects. This way, when a 
- * monitor has no more links pointing to it, it will be automatically 
+ * The parent and child pointers are ao2 objects. This way, when a
+ * monitor has no more links pointing to it, it will be automatically
  * destroyed.
  *
  * XXX I really think work should be done to make this structure not be
@@ -456,7 +456,7 @@
 	AST_LIST_ENTRY(ast_cc_monitor_link) next_parent;
 };
 
-/*! 
+/*!
  * Used to determine which type
  * of monitor an ast_cc_device_monitor
  * is.
@@ -467,14 +467,14 @@
 	/* A root monitor is a placeholder type, which serves
 	 * as a central root for a CCSS monitor tree. Its only job
 	 * is to pipe requests it receives from an extension monitor
-	 * to the core and vice-versa. Note that it is not mentioned 
-	 * in CCSS_architecture.pdf because it is a fairly low-level 
+	 * to the core and vice-versa. Note that it is not mentioned
+	 * in CCSS_architecture.pdf because it is a fairly low-level
 	 * concept and doesn't bear mentioning there.
 	 */
 	AST_CC_ROOT_MONITOR,
 };
 
-/*! 
+/*!
  * \brief Structure that represents a CCSS monitor
  * Both extension and device monitors will be represented
  * with this structure. Information specific to each monitor
@@ -510,7 +510,7 @@
 	 * Examples include "generic" and "SIP"
 	 */
 	const char *type;
-	/*! 
+	/*!
 	 * Init callback
 	 *
 	 * Implementors must allocate the monitor's private_data
@@ -519,7 +519,7 @@
 	 * Return 0 on success and -1 on failure.
 	 */
 	int (*init)(struct ast_cc_monitor *monitor, const int core_id);
-	/*! 
+	/*!
 	 * Request CCSS callback
 	 *
 	 * Perform whatever steps are necessary in order to request CC.
@@ -545,7 +545,7 @@
 	 * are considered "busy" by the core.
 	 */
 	enum ast_device_state(*status_request)(struct ast_cc_monitor *monitor, const int core_id);
-	/*! 
+	/*!
 	 * Unsuspend monitoring callback
 	 *
 	 * Perform the necessary steps to unsuspend monitoring.
@@ -554,14 +554,14 @@
 	/*!
 	 * Cancel the running available timer.
 	 *
-	 * In most cases, this function will likely consist of just a 
+	 * In most cases, this function will likely consist of just a
 	 * call to AST_SCHED_DEL. It might have been possible to do this
 	 * within the core, but unfortunately the mixture of sched_thread
 	 * and sched usage in Asterisk prevents such usage.
 	 */
 	int (*cancel_available_timer)(struct ast_cc_monitor *monitor, const int core_id, int *sched_id);
 	/*!
-	 * Destroy callback 
+	 * Destroy callback
 	 *
 	 * Implementors of this callback are responsible for destroying
 	 * all heap-allocated data in the monitor's private_data pointer, including
@@ -594,7 +594,7 @@
  * When a CC-capable application, such as Dial, has finished
  * with all CC processing for a channel and knows that any further
  * CC processing should be ignored, this function should be called.
- * 
+ *
  * \param chan The channel for which further CC processing should be ignored.
  * \retval void
  */
@@ -679,7 +679,7 @@
  * set by the cc_max_requests configuration option
  *
  * It is recommended that an entity which receives an incoming
- * CC request calls this function before changing state to 
+ * CC request calls this function before changing state to
  * CC_CALLER_REQUESTED. This way, immediate feedback can be
  * given to the caller about why his request was rejected.
  *
@@ -754,12 +754,12 @@
 /* BEGIN STRUCTURES FOR AGENTS */
 
 struct ast_cc_agent {
-	/*! 
+	/*!
 	 * Which instance of the core state machine does this
 	 * agent pertain to?
 	 */
 	unsigned int core_id;
-	/*! 
+	/*!
 	 * Callback functions needed for specific agent
 	 * implementations
 	 */
@@ -800,13 +800,13 @@
 struct ast_cc_agent_callbacks {
 	/*!
 	 * \brief Type of agent the callbacks belong to.
-	 * 
+	 *
 	 * Examples are "SIP" "ISDN" and "generic"
 	 */
 	const char *type;
 	/*!
 	 * \brief Initialization callback.
-	 * 
+	 *
 	 * This callback is called when the CC core
 	 * is initialized. Agents should allocate
 	 * any private data necessary for the
@@ -871,7 +871,7 @@
 	/*!
 	 * \brief Cease monitoring a monitored device
 	 *
-	 * The core will call this callback from the 
+	 * The core will call this callback from the
 	 * CC_ACTIVE state if the previous state was
 	 * CC_CALLER_BUSY. The agent should stop
 	 * monitoring its device for availability.
@@ -880,7 +880,7 @@
 	/*!
 	 * \brief Initiate the recall to the agent's device
 	 *
-	 * The core will call this callback when the 
+	 * The core will call this callback when the
 	 * CC_RECALLING state is reached. The agent should
 	 * take whatever action is necessary in order to
 	 * make his device initiate a CC recall.
@@ -921,8 +921,8 @@
  * is only called by ast_cc_create_new_core.
  *
  * \param caller The caller's channel
- * \param called_tree A tree indicating the interfaces dialed during 
- * this call, as well as which type of call completion service should 
+ * \param called_tree A tree indicating the interfaces dialed during
+ * this call, as well as which type of call completion service should
  * be requested for each device
  * \retval negative The CCSS core failed to be initialized.
  * \retval non-negative The identifier for this instance of the CCSS core

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=224772&r1=224771&r2=224772
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Oct 20 11:05:20 2009
@@ -80,7 +80,7 @@
 struct cc_core_instance {
 	/*!
 	 * Unique identifier for this instance of the CC core.
-	 */ 
+	 */
 	int core_id;
 	/*!
 	 * The current state for this instance of the CC core.
@@ -199,7 +199,7 @@
 
 /*!
  * \since 1.6.4
- * \brief A structure for holding the configuration parameters 
+ * \brief A structure for holding the configuration parameters
  * relating to CCSS
  */
 struct ast_cc_config_params {
@@ -312,7 +312,7 @@
 		return "";
 	}
 }
-int ast_cc_get_param(struct ast_cc_config_params *params, const char * const name, 
+int ast_cc_get_param(struct ast_cc_config_params *params, const char * const name,
 		char *buf, size_t buf_len)
 {
 	const char *value = NULL;
@@ -323,7 +323,7 @@
 	} else if (!strcasecmp(name, "cc_monitor_policy")) {
 		value = monitor_policy_to_str(ast_get_cc_monitor_policy(params));
 	}
-	
+
 	if (!ast_strlen_zero(value)) {
 		ast_copy_string(buf, value, buf_len);
 		return 0;
@@ -332,7 +332,7 @@
 	/* The rest of these are all ints of some sort and require some
 	 * snprintf-itude
 	 */
-	
+
 	if (!strcasecmp(name, "cc_offer_timer")) {
 		snprintf(buf, buf_len, "%u", ast_get_cc_offer_timer(params));
 	} else if (!strcasecmp(name, "ccnr_available_timer")) {
@@ -351,7 +351,7 @@
 	return 0;
 }
 
-int ast_cc_set_param(struct ast_cc_config_params *params, const char * const name, 
+int ast_cc_set_param(struct ast_cc_config_params *params, const char * const name,
 		const char * const value)
 {
 	unsigned int value_as_uint;
@@ -659,7 +659,7 @@
 		/* Never ever under any circumstances unlink
 		 * the root monitor. Of course, since the root monitor
 		 * is being acted on here, it means that a CC transaction
-		 * failed or has completed. So decrease the number of 
+		 * failed or has completed. So decrease the number of
 		 * CC requests in the system.
 		 */
 		ast_atomic_fetchadd_int(&cc_request_count, -1);
@@ -904,7 +904,7 @@
 	 */
 	prune_links(child_monitor, core_id, link);
 	AST_LIST_REMOVE(&parent_monitor->child_links, link, next_child);
-	/* We need to set the scheduler ID to -1 here so that 
+	/* We need to set the scheduler ID to -1 here so that
 	 * the cancel_available_timer callback will know not to
 	 * try to delete the scheduler entry while the scheduler
 	 * callback is running.
@@ -969,7 +969,7 @@
 			ast_cc_available_timer_expire, parent_link);
 
 	if (!gen_mon_pvt->sub && !(gen_mon_pvt->sub = ast_event_subscribe(
-			AST_EVENT_DEVICE_STATE, generic_monitor_devstate_cb, "Requesting CC", monitor, 
+			AST_EVENT_DEVICE_STATE, generic_monitor_devstate_cb, "Requesting CC", monitor,
 			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, monitor->interface->name,
 			AST_EVENT_IE_END))) {
 		return -1;
@@ -1061,7 +1061,7 @@
 	unsigned int parent_id;
 	/* What service was offered by the endpoint. Note that
 	 * this field is completely irrelevant for cc_tree_items
-	 * representing dialplan extensions. 
+	 * representing dialplan extensions.
 	 */
 	enum ast_cc_service_type service_offered;
 	/*!
@@ -1239,7 +1239,7 @@
  *
  * 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.
- * 
+ *
  * \param chan The calling channel with teh dial_cc_interfaaces datastore on it
  * \return void
  */
@@ -1605,7 +1605,7 @@
 	}
 
 	/* Situation 2 has occurred */
-	if (!(tree_item = cc_extension_tree_item_init(S_OR(chan->macroexten, chan->exten), 
+	if (!(tree_item = cc_extension_tree_item_init(S_OR(chan->macroexten, chan->exten),
 			S_OR(chan->macrocontext, chan->context), interfaces->dial_parent_id))) {
 		return -1;
 	}
@@ -1671,9 +1671,9 @@
 	ast_assert(callbacks->destructor != NULL);
 }
 
-static struct ast_cc_agent *cc_agent_init(struct ast_channel *caller_chan, 
+static struct ast_cc_agent *cc_agent_init(struct ast_channel *caller_chan,
 		const char * const caller_name, const int core_id,
-		struct ast_cc_interface_tree *interface_tree) 
+		struct ast_cc_interface_tree *interface_tree)
 {
 	struct ast_cc_agent *agent;
 
@@ -1834,7 +1834,7 @@
 	ast_str_set(&str, 0, "Starting to monitor %s device state since it is busy\n", agent->interface);
 
 	if (!(generic_pvt->sub = ast_event_subscribe(
-			AST_EVENT_DEVICE_STATE, generic_agent_devstate_cb, ast_str_buffer(str), agent, 
+			AST_EVENT_DEVICE_STATE, generic_agent_devstate_cb, ast_str_buffer(str), agent,
 			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, agent->interface,
 			AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT, AST_DEVICE_NOT_INUSE,
 			AST_EVENT_IE_END))) {
@@ -1846,7 +1846,7 @@
 static int cc_generic_agent_stop_monitoring(struct ast_cc_agent *agent)
 {
 	struct cc_generic_agent_pvt *generic_pvt = agent->private_data;
-	
+
 	ast_assert(generic_pvt->sub != NULL);
 
 	generic_pvt->sub = ast_event_unsubscribe(generic_pvt->sub);
@@ -1917,7 +1917,7 @@
 	if (!agent_pvt) {
 		return;
 	}
-	
+
 	if (agent_pvt->sub) {
 		agent_pvt->sub = ast_event_unsubscribe(agent_pvt->sub);
 	}
@@ -1936,14 +1936,14 @@
 	}
 }
 
-int ast_cc_core_init_instance(struct ast_channel *caller_chan, 
+int ast_cc_core_init_instance(struct ast_channel *caller_chan,
 		struct ast_cc_interface_tree *called_tree)
 {
 	char *caller = ast_strdupa(caller_chan->name);
 	char *dash = strrchr(caller, '-');
 	struct cc_core_instance *core_instance;
 	int core_id;
-	long agent_count; 
+	long agent_count;
 
 	if (dash) {
 		*dash = '\0';
@@ -1970,7 +1970,7 @@
 	if ((core_id = ast_cc_get_current_core_id(caller_chan)) == -1) {
 		return -1;
 	}
-	
+
 	/* Next, we need to create the core instance for this call */
 	if (!(core_instance = ao2_t_alloc(sizeof(*core_instance), cc_core_instance_destructor, "Creating core instance for CC"))) {
 		return -1;
@@ -2271,7 +2271,7 @@
 			ast_cc_request_state_change(CC_FAILED, core_instance->core_id, "Failed to start the offer timer\n");
 			break;
 		}
-		ast_log(LOG_NOTICE, "Started the offer timer for the agent!\n"); 
+		ast_log(LOG_NOTICE, "Started the offer timer for the agent!\n");
 		core_instance->current_state = args->state;
 		break;
 	case CC_CALLER_REQUESTED:
@@ -2279,7 +2279,7 @@
 		 * state is CC_CALLER_OFFERED or if the current state is CC_AVAILABLE and the type of the agent
 		 * in use is generic.
 		 */
-		if (!(core_instance->current_state == CC_CALLER_OFFERED || 
+		if (!(core_instance->current_state == CC_CALLER_OFFERED ||
 				(core_instance->current_state == CC_AVAILABLE && ast_test_flag(core_instance->agent, AST_CC_AGENT_SKIP_OFFER)))) {
 			ast_log(LOG_NOTICE, "Invalid state change request. Cannot go from %d to %d\n", core_instance->current_state, args->state);
 		}
@@ -2371,7 +2371,7 @@
 	return 0;
 }
 
-int ast_cc_request_state_change(enum ast_cc_state state, const int core_id, 
+int ast_cc_request_state_change(enum ast_cc_state state, const int core_id,
 		const char *debug)
 {
 	struct cc_state_change_args *args = ast_calloc(1, sizeof(*args) +
@@ -2477,7 +2477,7 @@
 }
 
 int ast_cc_monitor_announce_availability(struct ast_cc_monitor *monitor) {
-	return ast_taskprocessor_push(cc_core_taskprocessor, cc_devstate_change, 
+	return ast_taskprocessor_push(cc_core_taskprocessor, cc_devstate_change,
 			cc_ref(monitor, "Bump reference count until cc_devstate_change executes"));
 }
 
@@ -2582,7 +2582,7 @@
 	}
 
 	if (!exten_id) {
-		/* We couldn't find this extension. This may be because 
+		/* We couldn't find this extension. This may be because
 		 * we have been directed into an unexected extension because
 		 * the admin has changed a CC_INTERFACES variable at some point.
 		 */
@@ -2623,7 +2623,7 @@
 	const char *cc_max_requests_str;
 	struct ast_flags config_flags = {0,};
 	char *endptr;
-	
+
 	cc_config = ast_config_load2("ccss.conf", "ccss", config_flags);
 	if (!cc_config || cc_config == CONFIG_STATUS_FILEINVALID) {
 		ast_log(LOG_WARNING, "Could not find valid ccss.conf file. Using cc_max_requests default\n");
@@ -2660,7 +2660,7 @@
 
 	ast_log(LOG_NOTICE, "Successfully created pending offers container\n");
 	if (!(cc_core_instances = ao2_t_container_alloc(CC_CORE_INSTANCES_BUCKETS,
-					cc_core_instance_hash_fn, cc_core_instance_cmp_fn, 
+					cc_core_instance_hash_fn, cc_core_instance_cmp_fn,
 					"Create core instance container"))) {
 		return -1;
 	}




More information about the svn-commits mailing list