fix FSCORE-74

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6921 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-12-20 21:42:00 +00:00
parent ab210005a4
commit 8433c7e088
24 changed files with 158 additions and 53 deletions

View File

@@ -434,6 +434,34 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *ch
return SWITCH_STATUS_FALSE;
}
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_partner(switch_channel_t *channel, const char *varname, const char *value)
{
const char *uuid;
switch_assert(channel != NULL);
if (!switch_strlen_zero(varname)) {
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
switch_core_session_t *session;
switch_mutex_lock(channel->profile_mutex);
if ((session = switch_core_session_locate(uuid))) {
switch_channel_t *tchannel = switch_core_session_get_channel(session);
switch_mutex_lock(tchannel->profile_mutex);
switch_event_del_header(tchannel->variables, varname);
if (value) {
switch_event_add_header(tchannel->variables, SWITCH_STACK_BOTTOM, varname, "%s", value);
}
switch_mutex_unlock(tchannel->profile_mutex);
switch_core_session_rwunlock(session);
}
switch_mutex_unlock(channel->profile_mutex);
return SWITCH_STATUS_SUCCESS;
}
}
return SWITCH_STATUS_FALSE;
}
SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags)
{
switch_assert(channel != NULL);