[asterisk-commits] nadi: branch nadi/trunk-cm r44565 - in /team/nadi/trunk-cm: include/asterisk/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Oct 6 07:06:35 MST 2006


Author: nadi
Date: Fri Oct  6 09:06:35 2006
New Revision: 44565

URL: http://svn.digium.com/view/asterisk?rev=44565&view=rev
Log:
commenting the header file

Modified:
    team/nadi/trunk-cm/include/asterisk/csel.h
    team/nadi/trunk-cm/res/res_csel.c

Modified: team/nadi/trunk-cm/include/asterisk/csel.h
URL: http://svn.digium.com/view/asterisk/team/nadi/trunk-cm/include/asterisk/csel.h?rev=44565&r1=44564&r2=44565&view=diff
==============================================================================
--- team/nadi/trunk-cm/include/asterisk/csel.h (original)
+++ team/nadi/trunk-cm/include/asterisk/csel.h Fri Oct  6 09:06:35 2006
@@ -24,28 +24,80 @@
 #ifndef _ASTERISK_CSEL_H
 #define _ASTERISK_CSEL_H
 
+/* !\brief Private csel structure
+ */
 struct csel;
 
+/* !\brief Try to occupy a channel
+ * \param priv Private pointer to a structure representing a channel
+ * Tries to occupy the channel represented by priv.
+ *
+ * Returns NULL on error (i.e. channel is busy), or a pointer which
+ * will be the return value of csel_get_next.
+ */
 typedef void * (*occupy_func) (void *priv);
+
+/* !\brief Free priv
+ * \param priv Private pointer to a structure representing a channel
+ * Cleans up the data pointer to by priv.
+ */
 typedef void   (*free_func)   (void *priv);
 
 
+/* !\brief Create a channel selection structure
+ * \param method Name of the method to be used, usually configured in the channel drivers config file
+ * \param params Parameters passed to the init function of the method
+ * \param occupy Function pointer to the channel drivers occupy function
+ * \param free Function used by csel_destroy on the added priv's. NULL if you don't want that to happen
+ * Allocates and initializes a csel structure.
+ *
+ * Returns NULL on error.
+ */
 struct csel * csel_create   (const char *method,
 							 const char *params,
 							 occupy_func occupy,
 							 free_func   free);
 
+/* !\brief Destroy a channel selection structure
+ * \param cs The channel selection structure to be destroyed
+ * Destroys a channel selection structure.
+ */
 void          csel_destroy  (struct csel *cs);
 
+/* !\brief Add a channel
+ * \param cs The channel selection structure
+ * \param priv Private pointer to a structure representing a channel
+ * Adds a channel to the pool of this cs.
+ *
+ * Returns non-zero on error.
+ */
 int           csel_add      (struct csel *cs,
 							 void        *priv);
 
+/* !\brief Get the next channel
+ * \param cs The channel selection structure
+ * Gets the next free channel.
+ *
+ * Returns NULL if there is no free channel available.
+ */
 void *        csel_get_next (struct csel *cs);
 
+/* !\brief Register a starting call
+ * \param cs The channel selection structure
+ * \param priv Private pointer to a structure representing a channel
+ * \param uid Unique identifier for that call
+ * Registers a starting call, may be useful for some methods.
+ */
 void          csel_call     (struct csel *cs,
 							 void        *priv,
 							 const char  *uid);
 
+/* !\brief Register a hangup
+ * \param cs The channel selection structure
+ * \param priv Private pointer to a structure representing a channel
+ * \param uid Unique identifier for that call
+ * Registers a hangup, may be useful for some methods.
+ */
 void          csel_hangup   (struct csel *cs,
 							 void        *priv,
 							 const char  *uid);

Modified: team/nadi/trunk-cm/res/res_csel.c
URL: http://svn.digium.com/view/asterisk/team/nadi/trunk-cm/res/res_csel.c?rev=44565&r1=44564&r2=44565&view=diff
==============================================================================
--- team/nadi/trunk-cm/res/res_csel.c (original)
+++ team/nadi/trunk-cm/res/res_csel.c Fri Oct  6 09:06:35 2006
@@ -236,7 +236,7 @@
 /* ROUND ROBIN: end */
 
 static struct method methods[] = {
-	{ "standard", "Select the first free channel. This is the default", 0,
+	{ "standard", "Select the first free channel. This is the default.", 0,
 		standard_init, standard_destroy, standard_add, standard_get_next, 0, 0 },
 	{ "random", "Select a random free channel.", 0,
 		rand_init, rand_destroy, rand_add, rand_get_next, 0, 0 },
@@ -252,7 +252,7 @@
 	struct csel *cs;
 	int i = 0;
 
-	if (method) {
+	if (method && *method) {
 		for (; i < (sizeof(methods) / sizeof(struct method)); ++i) {
 			if (!strcasecmp(methods[i].name, method))
 				break;



More information about the asterisk-commits mailing list