*/
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
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;
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;
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;