add access or function for channel variable iterator

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1612 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2006-06-13 01:49:18 +00:00
parent 72183965af
commit 76dfa310c0
2 changed files with 14 additions and 0 deletions

View File

@ -203,6 +203,15 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *ch
*/
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

View File

@ -292,6 +292,11 @@ SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, ch
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);