]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODAPP-244 bkw stop trying to commit faster than me :P
authorMathieu Rene <mrene@avgs.ca>
Tue, 3 Mar 2009 16:58:24 +0000 (16:58 +0000)
committerMathieu Rene <mrene@avgs.ca>
Tue, 3 Mar 2009 16:58:24 +0000 (16:58 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12369 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_channel.h
src/switch_channel.c
src/switch_ivr_async.c

index 4824a0c8a33808b802ce76a1ad69f77191e477e8..609b8877c68351797ea5f65c933756614529cbc1 100644 (file)
@@ -409,6 +409,14 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *cha
 */
 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
index b671d0ecb6337d9157418ce1124c82630df1ebb7..966a10ee837ff2d73f90dd25bd5e3705e82e1d1e 100644 (file)
@@ -565,6 +565,18 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *cha
        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;
index 82bec090e8329b1e8bfb68133eee7d3629a38fa0..778b44167af8417cab2edbd0a9c1aa70e6dfbac9 100644 (file)
@@ -188,7 +188,7 @@ static switch_bool_t write_displace_callback(switch_media_bug_t *bug, void *user
                        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 @@ static switch_bool_t read_displace_callback(switch_media_bug_t *bug, void *user_
                        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;