From a34d780d139585564ed3182f545416b0959d766c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 29 Oct 2008 20:22:34 +0000 Subject: [PATCH] declinatio mortuus obfirmo! git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10195 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_channel.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index 9ad01c14cc..b0be0ae7ca 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -473,19 +473,15 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_partner(switch_channel_ const char *uuid; const char *val = NULL; 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); val = switch_channel_get_variable(tchannel, varname); - switch_mutex_unlock(tchannel->profile_mutex); switch_core_session_rwunlock(session); } - switch_mutex_unlock(channel->profile_mutex); } } @@ -619,18 +615,11 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_partner(switch_chann 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_string(tchannel->variables, SWITCH_STACK_BOTTOM, varname, value); - } - switch_mutex_unlock(tchannel->profile_mutex); + switch_channel_set_variable(tchannel, varname, value); switch_core_session_rwunlock(session); } - switch_mutex_unlock(channel->profile_mutex); return SWITCH_STATUS_SUCCESS; } }