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

FreeSWITCH SVN mrene at freeswitch.org
Tue Mar 3 08:58:25 PST 2009


Author: mrene
Date: Tue Mar  3 10:58:24 2009
New Revision: 12369

Log:
MODAPP-244 bkw stop trying to commit faster than me :P

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

Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h	(original)
+++ freeswitch/trunk/src/include/switch_channel.h	Tue Mar  3 10:58:24 2009
@@ -410,6 +410,14 @@
 SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, const char *key);
 
 /*!
+  \brief Unsets private from a given channel
+  \param channel channel to unsets data from
+  \param key your private data's unique keyname 
+  \return void pointer to channel's private data
+*/
+SWITCH_DECLARE(switch_status_t) switch_channel_unset_private(switch_channel_t *channel, const char *key);
+
+/*!
   \brief Assign a name to a given channel
   \param channel channel to assign name to
   \param name name to assign

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Tue Mar  3 10:58:24 2009
@@ -565,6 +565,18 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
+SWITCH_DECLARE(switch_status_t) switch_channel_unset_private(switch_channel_t *channel, const char *key)
+{
+	switch_status_t status;
+	switch_assert(channel != NULL);
+	
+	switch_mutex_lock(channel->profile_mutex);
+	status = switch_core_hash_delete(channel->private_hash, key);
+	switch_mutex_unlock(channel->profile_mutex);
+	
+	return status;
+}
+
 SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, const char *key)
 {
 	void *val;

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Tue Mar  3 10:58:24 2009
@@ -188,7 +188,7 @@
 			switch_core_file_close(&dh->fh);
 
 			if (session && (channel = switch_core_session_get_channel(session))) {
-				switch_channel_set_private(channel, dh->file, NULL);
+				switch_channel_unset_private(channel, dh->file);
 			}
 		}
 		break;
@@ -269,7 +269,7 @@
 			switch_core_file_close(&dh->fh);
 
 			if (session && (channel = switch_core_session_get_channel(session))) {
-				switch_channel_set_private(channel, dh->file, NULL);
+				switch_channel_unset_private(channel, dh->file);
 			}
 		}
 		break;



More information about the Freeswitch-svn mailing list