[Freeswitch-svn] [commit] r1612 - in freeswitch/trunk/src: . include

mikej at freeswitch.org mikej at freeswitch.org
Mon Jun 12 21:49:18 EDT 2006


Author: mikej
Date: Mon Jun 12 21:49:18 2006
New Revision: 1612

Modified:
   freeswitch/trunk/src/include/switch_channel.h
   freeswitch/trunk/src/switch_channel.c

Log:
add access or function for channel variable iterator

Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h	(original)
+++ freeswitch/trunk/src/include/switch_channel.h	Mon Jun 12 21:49:18 2006
@@ -204,6 +204,15 @@
 SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, char *varname);
 
 /*!
+ * Start iterating over the entries in the channel variable list.
+ * @param channel the channel to intterate the variales for
+ * @param pool The pool to allocate the switch_hash_index_t iterator. If this
+ *          pool is NULL, then an internal, non-thread-safe iterator is used.
+ * @remark  Use switch_hash_next and switch_hash_this with this function to iterate all the channel variables
+ */
+SWITCH_DECLARE(switch_hash_index_t *) switch_channel_variable_first(switch_channel_t *channel, switch_memory_pool_t *pool);
+
+/*!
   \brief Assign a caller extension to a given channel
   \param channel channel to assign extension to
   \param caller_extension extension to assign

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Mon Jun 12 21:49:18 2006
@@ -292,6 +292,11 @@
 	return switch_core_hash_find(channel->variables, varname);
 }
 
+SWITCH_DECLARE(switch_hash_index_t *) switch_channel_variable_first(switch_channel_t *channel, switch_memory_pool_t *pool)
+{
+	return switch_hash_first(pool, channel->variables);
+}
+
 SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, void *private_info)
 {
 	assert(channel != NULL);



More information about the Freeswitch-svn mailing list