]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
abstract out originate_signal_bond to a function to avoid confustion and regressions
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 29 May 2012 18:10:15 +0000 (13:10 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 29 May 2012 18:10:15 +0000 (13:10 -0500)
27 files changed:
libs/freetdm/mod_freetdm/mod_freetdm.c
libs/openzap/mod_openzap/mod_openzap.c
src/include/switch_channel.h
src/include/switch_types.h
src/mod/applications/mod_callcenter/mod_callcenter.c
src/mod/applications/mod_commands/mod_commands.c
src/mod/applications/mod_dptools/mod_dptools.c
src/mod/applications/mod_nibblebill/mod_nibblebill.c
src/mod/applications/mod_valet_parking/mod_valet_parking.c
src/mod/endpoints/mod_h323/mod_h323.cpp
src/mod/endpoints/mod_khomp/include/applications.h
src/mod/endpoints/mod_loopback/mod_loopback.c
src/mod/endpoints/mod_rtmp/rtmp_sig.c
src/mod/endpoints/mod_skinny/skinny_server.c
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c
src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
src/switch_channel.c
src/switch_core_io.c
src/switch_core_session.c
src/switch_ivr.c
src/switch_ivr_async.c
src/switch_ivr_bridge.c
src/switch_ivr_originate.c
src/switch_ivr_play_say.c
src/switch_rtp.c

index 6238513be20cabd67cb0748c5a1d86c57fb4c2ae..35b8d9b01aa7401b1da260fc8aadc429b8a5ec00 100755 (executable)
@@ -288,7 +288,7 @@ static void cycle_foreground(ftdm_channel_t *ftdmchan, int flash, const char *bc
                        const char *buuid;
                        tech_pvt = switch_core_session_get_private(session);
                        channel = switch_core_session_get_channel(session);
-                       buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                       buuid = switch_channel_get_partner_uuid(channel);
 
                        
                        if (tokencnt  == 1 && flash) {
@@ -2142,19 +2142,19 @@ static FIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
 
                                if ((session_a = switch_core_session_locate(ftdm_channel_get_token(sigmsg->channel, 0)))) {
                                        channel_a = switch_core_session_get_channel(session_a);
-                                       br_a_uuid = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE);
+                                       br_a_uuid = switch_channel_get_partner_uuid(channel_a);
 
                                        tech_pvt = switch_core_session_get_private(session_a);
-                                       stop_hold(session_a, switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE));
+                                       stop_hold(session_a, switch_channel_get_partner_uuid(channel_a));
                                        switch_clear_flag_locked(tech_pvt, TFLAG_HOLD);
                                }
 
                                if ((session_b = switch_core_session_locate(ftdm_channel_get_token(sigmsg->channel, 1)))) {
                                        channel_b = switch_core_session_get_channel(session_b);
-                                       br_b_uuid = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE);
+                                       br_b_uuid = switch_channel_get_partner_uuid(channel_b);
 
                                        tech_pvt = switch_core_session_get_private(session_b);
-                                       stop_hold(session_a, switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE));
+                                       stop_hold(session_a, switch_channel_get_partner_uuid(channel_b));
                                        switch_clear_flag_locked(tech_pvt, TFLAG_HOLD);
                                }
 
@@ -2222,7 +2222,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
                                        
                                        tech_pvt = switch_core_session_get_private(session);
                                        channel = switch_core_session_get_channel(session);
-                                       buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                       buuid = switch_channel_get_partner_uuid(channel);
                                        ftdm_channel_call_unhold(sigmsg->channel);
                                        stop_hold(session, buuid);
                                        switch_clear_flag_locked(tech_pvt, TFLAG_HOLD);
index ea10ab5cd44a7662e67851db67ce8db93192ce00..e67d71e15e10606ded5962f90d95863a80191d02 100644 (file)
@@ -297,7 +297,7 @@ static void cycle_foreground(zap_channel_t *zchan, int flash, const char *bcast)
                        const char *buuid;
                        tech_pvt = switch_core_session_get_private(session);
                        channel = switch_core_session_get_channel(session);
-                       buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                       buuid = switch_channel_get_partner_uuid(channel);
 
                        
                        if (zchan->token_count == 1 && flash) {
@@ -1663,19 +1663,19 @@ static ZIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
 
                                if ((session_a = switch_core_session_locate(sigmsg->channel->tokens[0]))) {
                                        channel_a = switch_core_session_get_channel(session_a);
-                                       br_a_uuid = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE);
+                                       br_a_uuid = switch_channel_get_partner_uuid(channel_a);
 
                                        tech_pvt = switch_core_session_get_private(session_a);
-                                       stop_hold(session_a, switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE));
+                                       stop_hold(session_a, switch_channel_get_partner_uuid(channel_a));
                                        switch_clear_flag_locked(tech_pvt, TFLAG_HOLD);
                                }
 
                                if ((session_b = switch_core_session_locate(sigmsg->channel->tokens[1]))) {
                                        channel_b = switch_core_session_get_channel(session_b);
-                                       br_b_uuid = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE);
+                                       br_b_uuid = switch_channel_get_partner_uuid(channel_b);
 
                                        tech_pvt = switch_core_session_get_private(session_b);
-                                       stop_hold(session_a, switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE));
+                                       stop_hold(session_a, switch_channel_get_partner_uuid(channel_b));
                                        switch_clear_flag_locked(tech_pvt, TFLAG_HOLD);
                                }
 
@@ -1738,7 +1738,7 @@ static ZIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
                                        
                                        tech_pvt = switch_core_session_get_private(session);
                                        channel = switch_core_session_get_channel(session);
-                                       buuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                       buuid = switch_channel_get_partner_uuid(channel);
                                        zap_set_state_locked(sigmsg->channel,  ZAP_CHANNEL_STATE_UP);
                                        stop_hold(session, buuid);
                                        switch_clear_flag_locked(tech_pvt, TFLAG_HOLD);
index 9bf89d57963cbb791621f62c1ffee0491bc6ffac..2348a4cc54fc02cd5abfb6f86b6f71d57c35cbb1 100644 (file)
@@ -641,6 +641,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_api_on(switch_channel_t *channel,
 
 SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_queued_extension(switch_channel_t *channel);
 SWITCH_DECLARE(void) switch_channel_transfer_to_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension);
+SWITCH_DECLARE(const char *) switch_channel_get_partner_uuid(switch_channel_t *channel);
 
 SWITCH_END_EXTERN_C
 #endif
index 4699cd238f21d4234e973abad9b7e53a5e3a0d45..5d62b597eef40097c1c9041f05fc798c46a01007 100644 (file)
@@ -183,6 +183,7 @@ SWITCH_BEGIN_EXTERN_C
 #define SWITCH_LAST_BRIDGE_VARIABLE "last_bridge_to"
 #define SWITCH_SIGNAL_BRIDGE_VARIABLE "signal_bridge_to"
 #define SWITCH_SIGNAL_BOND_VARIABLE "signal_bond"
+#define SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE "originate_signal_bond"
 #define SWITCH_ORIGINATOR_VARIABLE "originator"
 #define SWITCH_ORIGINATOR_CODEC_VARIABLE "originator_codec"
 #define SWITCH_ORIGINATOR_VIDEO_CODEC_VARIABLE "originator_video_codec"
index 99ece2ff39cdce67833db33c22506706f804a274..df8670f2ee68d617239653508b280c94b7b51e4a 100644 (file)
@@ -1536,7 +1536,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
                                /* Wait for the real channel to be fully bridged */
                                switch_channel_wait_for_flag(other_loopback_channel, CF_BRIDGED, SWITCH_TRUE, 5000, member_channel);
 
-                               real_uuid = switch_channel_get_variable(other_loopback_channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                               real_uuid = switch_channel_get_partner_uuid(other_loopback_channel);
                                switch_channel_set_variable(other_loopback_channel, "cc_member_pre_answer_uuid", NULL);
 
                                /* Switch the agent session */
index 0a9cac196c453a1aca00524abb3949f6eb524d4e..65518dc0d3331705958592d5a2927dacb00e9171 100644 (file)
@@ -3439,7 +3439,7 @@ SWITCH_STANDARD_API(break_function)
        channel = switch_core_session_get_channel(psession);
 
        if (both) {
-               const char *quuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+               const char *quuid = switch_channel_get_partner_uuid(channel);
                if (quuid && (qsession = switch_core_session_locate(quuid))) {
                        qchannel = switch_core_session_get_channel(qsession);
                }
index 0e441dc731d22cbd84f7363e90d0806eaed7ff24..009088e9f9daf63f00a27e7acf1979229b422250 100755 (executable)
@@ -974,7 +974,7 @@ SWITCH_STANDARD_APP(transfer_function)
                        if (bleg || both) {
                                const char *uuid;
                                switch_channel_t *channel = switch_core_session_get_channel(session);
-                               if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+                               if ((uuid = switch_channel_get_partner_uuid(channel))) {
                                        switch_core_session_t *b_session;
                                        if ((b_session = switch_core_session_locate(uuid))) {
                                                switch_ivr_session_transfer(b_session, argv[1], argv[2], argv[3]);
@@ -2149,7 +2149,7 @@ SWITCH_STANDARD_APP(att_xfer_function)
 
        channel = switch_core_session_get_channel(session);
 
-       if ((bond = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+       if ((bond = switch_channel_get_partner_uuid(channel))) {
                bond = switch_core_session_strdup(session, bond);
        }
 
@@ -3570,13 +3570,8 @@ SWITCH_STANDARD_APP(pickup_function)
                        caller_profile->callee_id_number = num;
                        
                        if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
-                               const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                               const char *uuid = switch_channel_get_partner_uuid(channel);
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
-
-                               if (!uuid) {
-                                       uuid = switch_channel_get_variable(channel, "originate_signal_bond");
-                               }
-
                                
                                if (uuid) {
                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
index 44cbc29abc47ff474c9d37fe2603e96181c997a2..c1a788454a8c2b2cda8485c924e620db505b115f 100755 (executable)
@@ -287,7 +287,7 @@ static void transfer_call(switch_core_session_t *session, char *destination)
        switch_separate_string(mydup, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
 
        /* Find the uuid of our B leg. If it exists, transfer it first */
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                switch_core_session_t *b_session;
 
                /* Get info on the B leg */
index 9b70e5b3174fecc4ec43057f153250d30b809a03..773fdbabebdfe8c1738d56a531452376d4842185 100644 (file)
@@ -618,7 +618,7 @@ SWITCH_STANDARD_APP(valet_parking_function)
                        char tmp[512] = "";
                        switch_snprintf(tmp, sizeof(tmp), "%s:%s", lot_name, ext);
 
-                       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+                       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                                switch_core_session_t *b_session;
 
                                if ((b_session = switch_core_session_locate(uuid))) {
index e7199e0dee2c424f1ac4be8ebe6ddf0ca39ed6d6..2e7050e8502b6de77fedfb71810c05364c737a65 100644 (file)
@@ -1334,11 +1334,11 @@ void FSH323Connection::OnModeChanged(const H245_ModeDescription & newMode)
                                        else
                                                t38_options->T38FaxUdpEC = "t38UDPRedundancy";
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"T38FaxUdpEC:%s\n",t38_options->T38FaxUdpEC);
-                                       const char *uuid = switch_channel_get_variable(m_fsChannel, SWITCH_SIGNAL_BOND_VARIABLE); 
+                                       const char *uuid = switch_channel_get_partner_uuid(m_fsChannel); 
                                        if (uuid != NULL) {
                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"uuid:%s\n",uuid);
                                                
-                                               switch_core_session_t *session = switch_core_session_locate(switch_channel_get_variable(m_fsChannel, SWITCH_SIGNAL_BOND_VARIABLE));
+                                               switch_core_session_t *session = switch_core_session_locate(switch_channel_get_partner_uuid(m_fsChannel));
                                                if (session) {
                                                        switch_channel_t * channel = switch_core_session_get_channel(session);
                                                        if (channel) {
@@ -2229,7 +2229,7 @@ PBoolean FSH323_ExternalRTPChannel::Start()
                switch_channel_mark_pre_answered(m_fsChannel);
 
        if (m_capability->GetMainType() == H323Capability::e_Data && m_conn->m_rxChannel &&  m_conn->m_txChannel) {
-               const char *uuid = switch_channel_get_variable(m_fsChannel, SWITCH_SIGNAL_BOND_VARIABLE); 
+               const char *uuid = switch_channel_get_partner_uuid(m_fsChannel); 
                if (uuid != NULL){
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"------------------------->switch_rtp_udptl_mode\n");
                        switch_rtp_udptl_mode(tech_pvt->rtp_session);
index 21b66b2b0aa7e04a17d73d2479e02e9ee9e3f0c1..14ba1d33232b1e2dd9ced25ce58c63970de195d2 100644 (file)
@@ -599,7 +599,7 @@ struct Transfer<T, false>
                 return SWITCH_STATUS_FALSE;
         }
 
-        switch_core_session_t *peer_session = switch_core_session_locate(switch_channel_get_variable(chan,SWITCH_SIGNAL_BOND_VARIABLE));
+        switch_core_session_t *peer_session = switch_core_session_locate(switch_channel_get_partner_uuid(chan));
 
         if(!peer_session)
         {
@@ -662,7 +662,7 @@ struct Transfer<T, false>
             switch_channel_t * peer = switch_core_session_get_channel(peer_session);
 
             /* put the channel in hold */
-            //switch_core_session_t *session = switch_core_session_locate(switch_channel_get_variable(chan,SWITCH_SIGNAL_BOND_VARIABLE));
+            //switch_core_session_t *session = switch_core_session_locate(switch_channel_get_partner_uuid(chan));
             //switch_channel_t *chan_core = switch_core_session_get_channel(session);
 
             const char *stream;
@@ -709,7 +709,7 @@ struct Transfer<T, false>
             switch_core_session_rwunlock(pvt->session());
             switch_core_session_rwunlock(peer_session);
 
-            //switch_ivr_unhold_uuid(switch_channel_get_variable(chan,SWITCH_SIGNAL_BOND_VARIABLE));
+            //switch_ivr_unhold_uuid(switch_channel_get_partner_uuid(chan));
         }
         catch (ScopedLockFailed & err)
         {
index 200d6e5b714c6fbd7b34998865982228cf26a27f..e2a2c3daab0c29034ce045eb9423033facd906a4 100644 (file)
@@ -659,13 +659,13 @@ static switch_status_t find_non_loopback_bridge(switch_core_session_t *session,
        *br_session = NULL;
        *br_uuid = NULL;
 
-       a_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+       a_uuid = switch_channel_get_partner_uuid(channel);
 
        while (a_uuid && (sp = switch_core_session_locate(a_uuid))) {
                if (switch_core_session_check_interface(sp, loopback_endpoint_interface)) {
                        private_t *tech_pvt = switch_core_session_get_private(sp);
 
-                       a_uuid = switch_channel_get_variable(tech_pvt->other_channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                       a_uuid = switch_channel_get_partner_uuid(tech_pvt->other_channel);
                        switch_core_session_rwunlock(sp);
                        sp = NULL;
                } else {
@@ -919,7 +919,7 @@ static switch_status_t loopback_bowout_on_execute_state_handler(switch_core_sess
                /* Wait for b_channel to be fully bridged */
                switch_channel_wait_for_flag(b_channel, CF_BRIDGED, SWITCH_TRUE, 5000, NULL);
 
-               uuid = switch_channel_get_variable(b_channel, SWITCH_SIGNAL_BOND_VARIABLE);
+               uuid = switch_channel_get_partner_uuid(b_channel);
 
                if (uuid && (other_session = switch_core_session_locate(uuid))) {
                        switch_channel_t *other_channel = switch_core_session_get_channel(other_session);
index 5f57eb04c7c5bf36ff844f2e4daf3981380b0a6c..a29465ecc04c35cc443eaa06a311cd1dad30dc35 100644 (file)
@@ -539,7 +539,7 @@ RTMP_INVOKE_FUNCTION(rtmp_i_transfer)
        }
        
        if ((tech_pvt = rtmp_locate_private(rsession, uuid))) {
-               const char *other_uuid = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE);
+               const char *other_uuid = switch_channel_get_partner_uuid(tech_pvt->channel);
                switch_core_session_t *session;
                
                if (!zstr(other_uuid) && (session = switch_core_session_locate(other_uuid))) {
@@ -570,8 +570,8 @@ RTMP_INVOKE_FUNCTION(rtmp_i_join)
                return SWITCH_STATUS_FALSE;
        }
        
-       if ((other_uuid[0] = switch_channel_get_variable(tech_pvt[0]->channel, SWITCH_SIGNAL_BOND_VARIABLE)) &&
-           (other_uuid[1] = switch_channel_get_variable(tech_pvt[1]->channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+       if ((other_uuid[0] = switch_channel_get_partner_uuid(tech_pvt[0]->channel)) &&
+           (other_uuid[1] = switch_channel_get_partner_uuid(tech_pvt[1]->channel))) {
 
 #ifndef RTMP_DONT_HOLD
                if (switch_test_flag(tech_pvt[0], TFLAG_DETACHED)) {
@@ -725,8 +725,8 @@ RTMP_INVOKE_FUNCTION(rtmp_i_three_way)
                return SWITCH_STATUS_FALSE;
        }
        
-       if (!(other_uuid[0] = switch_channel_get_variable(tech_pvt[0]->channel, SWITCH_SIGNAL_BOND_VARIABLE)) ||
-           !(other_uuid[1] = switch_channel_get_variable(tech_pvt[1]->channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+       if (!(other_uuid[0] = switch_channel_get_partner_uuid(tech_pvt[0]->channel)) ||
+           !(other_uuid[1] = switch_channel_get_partner_uuid(tech_pvt[1]->channel))) {
                return SWITCH_STATUS_FALSE; /* Both calls aren't bridged */
        }
 
index 8e47691c36647c260dbb71b9fc5972fd114abf28..09577394553ddeb0a1f13186fc32f1913389e207 100644 (file)
@@ -784,12 +784,12 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener
 
        tech_pvt = switch_core_session_get_private(session);
        channel = switch_core_session_get_channel(session);
-       remote_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+       remote_uuid = switch_channel_get_partner_uuid(channel);
 
        if (tech_pvt->transfer_from_call_id) {
                if((session2 = skinny_profile_find_session(listener->profile, listener, &line_instance, tech_pvt->transfer_from_call_id))) {
                        switch_channel_t *channel2 = switch_core_session_get_channel(session2);
-                       const char *remote_uuid2 = switch_channel_get_variable(channel2, SWITCH_SIGNAL_BOND_VARIABLE);
+                       const char *remote_uuid2 = switch_channel_get_partner_uuid(channel2);
                        if (switch_ivr_uuid_bridge(remote_uuid, remote_uuid2) == SWITCH_STATUS_SUCCESS) {
                                switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
                                switch_channel_hangup(channel2, SWITCH_CAUSE_NORMAL_CLEARING);
index 92a27fd0f2c114c4f596c221e75a95b3a3937673..2b4401866560d38c36d9ffacabca85aa722bb646 100644 (file)
@@ -172,7 +172,7 @@ static switch_status_t sofia_on_reset(switch_core_session_t *session)
                const char *uuid = switch_core_session_get_uuid(session);
 
                if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
-                       const char *other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                       const char *other_uuid = switch_channel_get_partner_uuid(channel);
                        int x = 0;
 
                        if (other_uuid) {
@@ -1824,7 +1824,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        }
                        sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
 
-                       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
+                       if ((uuid = switch_channel_get_partner_uuid(channel))
                                && (other_session = switch_core_session_locate(uuid))) {
                                other_channel = switch_core_session_get_channel(other_session);
                                ip = switch_channel_get_variable(other_channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE);
@@ -2061,7 +2061,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        const char *uuid;
                        const char *call_id = NULL, *to_user = NULL, *to_host = NULL, *to_tag = NULL, *from_tag = NULL, *from_user = NULL, *from_host = NULL;
 
-                       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+                       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                                switch_core_session_t *rsession;
                                if ((rsession = switch_core_session_locate(uuid))) {
                                        switch_channel_t *rchannel = switch_core_session_get_channel(rsession);
@@ -2191,7 +2191,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                                                
 
                                                if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
-                                                       const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                                       const char *uuid = switch_channel_get_partner_uuid(channel);
                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "SEND");
 
 
index 0621b3b84d231069a6d2b29624e658aa1eaaf985..dc4fcfb0f09f1aa2957881fae827b49846b9ad74 100644 (file)
@@ -618,7 +618,7 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
 
        if (sofia_test_flag(tech_pvt, TFLAG_SLA_BARGE)) {
                switch_core_session_t *new_session, *other_session;
-               const char *other_uuid = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE);
+               const char *other_uuid = switch_channel_get_partner_uuid(tech_pvt->channel);
                char *cmd = NULL;
 
                if (!zstr(other_uuid) && (other_session = switch_core_session_locate(other_uuid))) {
@@ -783,7 +783,7 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons
                number = caller_profile->destination_number;
        }
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (session_b = switch_core_session_locate(uuid))) {
+       if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) {
                switch_core_session_message_t *msg;
                //switch_channel_t *channel_b = switch_core_session_get_channel(session_b);
 
@@ -906,7 +906,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
                caller_profile->callee_id_number = switch_sanitize_number(switch_core_strdup(caller_profile->pool, number));
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s Update Callee ID to \"%s\" <%s>\n", switch_channel_get_name(channel), name, number);
 
-               if (lazy || (att && !switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+               if (lazy || (att && !switch_channel_get_partner_uuid(channel))) {
                        switch_channel_flip_cid(channel);
                }
        }
@@ -914,7 +914,7 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
        if (send) {
 
                if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
-                       const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                       const char *uuid = switch_channel_get_partner_uuid(channel);
                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
                        if (uuid) {
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
@@ -5211,7 +5211,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
                                goto end;
                        }
 
-                       if ((br = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+                       if ((br = switch_channel_get_partner_uuid(channel))) {
                                switch_xml_t root = NULL, domain = NULL;
                                switch_core_session_t *a_session;
                                switch_channel_t *a_channel;
@@ -5370,7 +5370,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
                        if (sofia_test_flag(tech_pvt, TFLAG_SENT_UPDATE)) {
                                sofia_clear_flag_locked(tech_pvt, TFLAG_SENT_UPDATE);
 
-                               if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+                               if ((uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(uuid))) {
                                        const char *r_sdp = NULL;
                                        switch_core_session_message_t *msg;
                                        private_object_t *other_tech_pvt = switch_core_session_get_private(other_session);
@@ -5602,7 +5602,7 @@ void *SWITCH_THREAD_FUNC media_on_hold_thread_run(switch_thread_t *thread, void
                switch_channel_t *channel = switch_core_session_get_channel(session);
                private_object_t *tech_pvt = switch_core_session_get_private(session);
 
-               if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+               if ((uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(uuid))) {
                        if (switch_core_session_compare(session, other_session)) {
                                sofia_set_flag_locked(tech_pvt, TFLAG_HOLD_LOCK);
                                switch_ivr_media(switch_core_session_get_uuid(other_session), SMF_REBRIDGE);
@@ -6057,7 +6057,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                                                }
 
                                                                if ((b_private = nua_handle_magic(bnh))) {
-                                                                       const char *br_b = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                                                       const char *br_b = switch_channel_get_partner_uuid(channel);
                                                                        char *br_a = b_private->uuid;
 
                                                                        
@@ -6859,8 +6859,8 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                b_tech_pvt = (private_object_t *) switch_core_session_get_private(b_session);
                                                channel_b = switch_core_session_get_channel(b_session);
 
-                                               br_a = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE);
-                                               br_b = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE);
+                                               br_a = switch_channel_get_partner_uuid(channel_a);
+                                               br_b = switch_channel_get_partner_uuid(channel_b);
 
                                                if (!switch_ivr_uuid_exists(br_a)) {
                                                        br_a = NULL;
@@ -7109,7 +7109,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                        }
                                        nua_handle_unref(bnh);
                                } else {                /* the other channel is on a different box, we have to go find them */
-                                       if (exten && (br_a = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE))) {
+                                       if (exten && (br_a = switch_channel_get_partner_uuid(channel_a))) {
                                                switch_core_session_t *a_session;
                                                switch_channel_t *channel = switch_core_session_get_channel(session);
 
@@ -7232,7 +7232,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                const char *br;
                switch_core_session_t *b_session;
 
-               if ((br = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (b_session = switch_core_session_locate(br))) {
+               if ((br = switch_channel_get_partner_uuid(channel)) && (b_session = switch_core_session_locate(br))) {
 
                        const char *var;
                        switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
@@ -7554,7 +7554,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                const char *uuid;
                                                switch_core_session_t *session_b;
 
-                                               if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (session_b = switch_core_session_locate(uuid))) {
+                                               if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) {
                                                        while (switch_channel_has_dtmf(channel)) {
                                                                switch_dtmf_t idtmf = { 0, 0 };
                                                                if (switch_channel_dequeue_dtmf(channel, &idtmf) == SWITCH_STATUS_SUCCESS) {
@@ -8575,7 +8575,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
 
                                tech_pvt->caller_profile->dialplan = "inline";
 
-                               bridge_uuid = switch_channel_get_variable(b_channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                               bridge_uuid = switch_channel_get_partner_uuid(b_channel);
 
                                if (call_info) {
                                        const char *olu;
index 577c36668eac525c7989aa7e06bac41982612e16..cb091daf8e62afb6b143f517e156d207def7a602 100644 (file)
@@ -688,7 +688,7 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch
 
                                        pass_fmtp = NULL;
 
-                                       if (switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE)) {
+                                       if (switch_channel_get_partner_uuid(tech_pvt->channel)) {
                                                if ((of = switch_channel_get_variable_partner(tech_pvt->channel, "sip_video_fmtp"))) {
                                                        pass_fmtp = of;
                                                }
@@ -4189,9 +4189,9 @@ int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly)
                                if (!strcasecmp(stream, "indicate_hold")) {
                                        switch_channel_set_flag(tech_pvt->channel, CF_SUSPEND);
                                        switch_channel_set_flag(tech_pvt->channel, CF_HOLD);
-                                       switch_ivr_hold_uuid(switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE), NULL, 0);
+                                       switch_ivr_hold_uuid(switch_channel_get_partner_uuid(tech_pvt->channel), NULL, 0);
                                } else {
-                                       switch_ivr_broadcast(switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE), stream,
+                                       switch_ivr_broadcast(switch_channel_get_partner_uuid(tech_pvt->channel), stream,
                                                                                 SMF_ECHO_ALEG | SMF_LOOP | SMF_PRIORITY);
                                        switch_yield(250000);
                                }
@@ -4217,7 +4217,7 @@ int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly)
                                switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets);
                        }
 
-                       if ((uuid = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (b_session = switch_core_session_locate(uuid))) {
+                       if ((uuid = switch_channel_get_partner_uuid(tech_pvt->channel)) && (b_session = switch_core_session_locate(uuid))) {
                                switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
 
                                if (switch_channel_test_flag(tech_pvt->channel, CF_HOLD)) {
@@ -5330,7 +5330,7 @@ void sofia_glue_pass_sdp(private_object_t *tech_pvt, char *sdp)
        switch_core_session_t *other_session;
        switch_channel_t *other_channel;
 
-       if ((val = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE))
+       if ((val = switch_channel_get_partner_uuid(tech_pvt->channel))
                && (other_session = switch_core_session_locate(val))) {
                other_channel = switch_core_session_get_channel(other_session);
                switch_channel_set_variable(other_channel, SWITCH_B_SDP_VARIABLE, sdp);
@@ -5904,7 +5904,7 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
 
                }
 
-               if (switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) {
+               if (switch_channel_get_partner_uuid(channel)) {
                        sofia_set_flag(tech_pvt, TFLAG_RECOVERING_BRIDGE);
                } else {
                        switch_xml_t callflow, param, x_extension;
@@ -6826,7 +6826,7 @@ void sofia_glue_tech_simplify(private_object_t *tech_pvt)
 
 
 
-       if ((uuid = switch_channel_get_variable(tech_pvt->channel, SWITCH_SIGNAL_BOND_VARIABLE))
+       if ((uuid = switch_channel_get_partner_uuid(tech_pvt->channel))
                && (other_session = switch_core_session_locate(uuid))) {
 
                other_channel = switch_core_session_get_channel(other_session);
index 9f3eaf1cb654ed3ac8812a3e9d4ef4634adbf6be..77a0438cca33674d31006d732ec5612838c0636b 100644 (file)
@@ -213,7 +213,7 @@ static switch_status_t my_on_routing(switch_core_session_t *session)
                   }
                 */
                
-               if ((signal_bond = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && !zstr(signal_bond)) {
+               if ((signal_bond = switch_channel_get_partner_uuid(channel)) && !zstr(signal_bond)) {
                        if (rc_avpair_add(rad_config, &send, PW_FS_OTHER_LEG_ID, (void*) signal_bond, -1, PW_FS_PEC) == NULL) {
                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[mod_radius_cdr] Failed adding Freeswitch-Other-Leg-Id: %s\n", uuid_str);
                                rc_destroy(rad_config);
index dc983c78cda9e1485bc3526ac5ce5eba103cce07..138123f3eb20118a3da677b35144294817990d59 100644 (file)
@@ -831,7 +831,7 @@ SWITCH_DECLARE(const char *) switch_channel_get_variable_partner(switch_channel_
        switch_assert(channel != NULL);
 
        if (!zstr(varname)) {
-               if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+               if ((uuid = switch_channel_get_partner_uuid(channel))) {
                        switch_core_session_t *session;
                        if ((session = switch_core_session_locate(uuid))) {
                                switch_channel_t *tchannel = switch_core_session_get_channel(session);
@@ -896,7 +896,7 @@ SWITCH_DECLARE(void *) switch_channel_get_private_partner(switch_channel_t *chan
 
        switch_assert(channel != NULL);
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                switch_core_session_t *session;
                if ((session = switch_core_session_locate(uuid))) {
                        val = switch_core_hash_find_locked(channel->private_hash, key, channel->profile_mutex);
@@ -1324,7 +1324,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_partner_var_check(sw
        switch_assert(channel != NULL);
 
        if (!zstr(varname)) {
-               if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+               if ((uuid = switch_channel_get_partner_uuid(channel))) {
                        switch_core_session_t *session;
                        if ((session = switch_core_session_locate(uuid))) {
                                switch_channel_t *tchannel = switch_core_session_get_channel(session);
@@ -1357,7 +1357,7 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *
 
        switch_assert(channel != NULL);
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                switch_core_session_t *session;
                if ((session = switch_core_session_locate(uuid))) {
                        switch_channel_set_flag(switch_core_session_get_channel(session), flag);
@@ -1376,7 +1376,7 @@ SWITCH_DECLARE(uint32_t) switch_channel_test_flag_partner(switch_channel_t *chan
 
        switch_assert(channel != NULL);
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                switch_core_session_t *session;
                if ((session = switch_core_session_locate(uuid))) {
                        r = switch_channel_test_flag(switch_core_session_get_channel(session), flag);
@@ -1393,7 +1393,7 @@ SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t
 
        switch_assert(channel != NULL);
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                switch_core_session_t *session;
                if ((session = switch_core_session_locate(uuid))) {
                        switch_channel_clear_flag(switch_core_session_get_channel(session), flag);
@@ -1513,7 +1513,7 @@ SWITCH_DECLARE(uint32_t) switch_channel_test_cap_partner(switch_channel_t *chann
 
        switch_assert(channel != NULL);
 
-       if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) {
+       if ((uuid = switch_channel_get_partner_uuid(channel))) {
                switch_core_session_t *session;
                if ((session = switch_core_session_locate(uuid))) {
                        r = switch_channel_test_cap(switch_core_session_get_channel(session), cap);
@@ -2730,7 +2730,7 @@ SWITCH_DECLARE(void) switch_channel_flip_cid(switch_channel_t *channel)
 
 
        if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
-               const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+               const char *uuid = switch_channel_get_partner_uuid(channel);
                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
 
                if (uuid) {
@@ -4150,6 +4150,17 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
        return status;
 }
 
+SWITCH_DECLARE(const char *) switch_channel_get_partner_uuid(switch_channel_t *channel)
+{
+       const char *uuid = NULL;
+
+       if (!(uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+               uuid = switch_channel_get_variable(channel, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE);
+       }
+
+       return uuid;
+}
+
 /* For Emacs:
  * Local Variables:
  * mode:c
index 83f8ae6d268b0c7f2c81d6187056d31321ac2ab1..0a3db343ed28364006454244f693c2f8e77fbeab 100644 (file)
@@ -288,7 +288,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
 
        if (switch_test_flag(session, SSF_READ_TRANSCODE) && !need_codec && switch_core_codec_ready(session->read_codec)) {
                switch_core_session_t *other_session;
-               const char *uuid = switch_channel_get_variable(switch_core_session_get_channel(session), SWITCH_SIGNAL_BOND_VARIABLE);
+               const char *uuid = switch_channel_get_partner_uuid(switch_core_session_get_channel(session));
                switch_clear_flag(session, SSF_READ_TRANSCODE);
                
                if (uuid && (other_session = switch_core_session_locate(uuid))) {
@@ -866,7 +866,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
 
        if (switch_test_flag(session, SSF_WRITE_TRANSCODE) && !need_codec && switch_core_codec_ready(session->write_codec)) {
                switch_core_session_t *other_session;
-               const char *uuid = switch_channel_get_variable(switch_core_session_get_channel(session), SWITCH_SIGNAL_BOND_VARIABLE);
+               const char *uuid = switch_channel_get_partner_uuid(switch_core_session_get_channel(session));
 
                if (uuid && (other_session = switch_core_session_locate(uuid))) {
                        switch_set_flag(other_session, SSF_READ_CODEC_RESET);
index 4e43987ecff013fd3e8b0f2f63996a31205b6fc8..2cdbeaa81b0b838bfb02fc9625e87dab97e16977 100644 (file)
@@ -184,7 +184,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_partner(switch_core_sess
 {
        const char *uuid;
 
-       if ((uuid = switch_channel_get_variable(session->channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(session->channel, "originate_signal_bond"))) {
+       if ((uuid = switch_channel_get_partner_uuid(session->channel))) {
                if ((*partner = switch_core_session_locate(uuid))) {
                        return SWITCH_STATUS_SUCCESS;
                }
@@ -544,7 +544,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
                        switch_channel_set_variable(peer_channel, SWITCH_ORIGINATOR_VARIABLE, switch_core_session_get_uuid(session));
                        switch_channel_set_variable(peer_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(session));
                        // Needed by 3PCC proxy so that aleg can find bleg to pass SDP to, when final ACK arrives.
-                       switch_channel_set_variable(channel, "originate_signal_bond", switch_core_session_get_uuid(*new_session));
+                       switch_channel_set_variable(channel, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(*new_session));
 
                        if ((val = switch_channel_get_variable(channel, SWITCH_PROCESS_CDR_VARIABLE))) {
                                switch_channel_set_variable(peer_channel, SWITCH_PROCESS_CDR_VARIABLE, val);
@@ -797,7 +797,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_pass_indication(switch_core_
        switch_channel_t *channel = switch_core_session_get_channel(session);
        switch_status_t status = SWITCH_STATUS_SUCCESS;
 
-       if (((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) || (uuid = switch_channel_get_variable(channel, "originate_signal_bond"))) && (other_session = switch_core_session_locate(uuid))) {
+       if (((uuid = switch_channel_get_partner_uuid(channel))) && (other_session = switch_core_session_locate(uuid))) {
                msg.message_id = indication;
                msg.from = __FILE__;
                status = switch_core_session_receive_message(other_session, &msg);
index e4fc807596d6fbb17db3889b3baf9bf502d44b1a..08d1fcd5a405c559ef529d8f0dd94d00bdd8b6a7 100644 (file)
@@ -559,7 +559,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
                                switch_channel_set_flag(channel, CF_BROADCAST);
                        }
                        if (hold_bleg && switch_true(hold_bleg)) {
-                               if ((b_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+                               if ((b_uuid = switch_channel_get_partner_uuid(channel))) {
                                        const char *stream;
                                        b_uuid = switch_core_session_strdup(session, b_uuid);
 
@@ -1384,7 +1384,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session,
        switch_core_session_receive_message(session, &msg);
 
        if (moh && (stream = switch_channel_get_hold_music(channel))) {
-               if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+               if ((other_uuid = switch_channel_get_partner_uuid(channel))) {
                        switch_ivr_broadcast(other_uuid, stream, SMF_ECHO_ALEG | SMF_LOOP);
                }
        }
@@ -1421,7 +1421,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session
        switch_core_session_receive_message(session, &msg);
 
 
-       if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (b_session = switch_core_session_locate(other_uuid))) {
+       if ((other_uuid = switch_channel_get_partner_uuid(channel)) && (b_session = switch_core_session_locate(other_uuid))) {
                switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
                switch_channel_stop_broadcast(b_channel);
                switch_channel_wait_for_flag(b_channel, CF_BROADCAST, SWITCH_FALSE, 5000, NULL);
index 5d6127d054d6090a2be93bb6e800635be03f2e5c..37da4f04861726c9cd0c3607f854a275a2051c01 100644 (file)
@@ -4068,7 +4068,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const cha
                }
        }
 
-       if ((flags & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
+       if ((flags & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_partner_uuid(channel))
                && (other_session = switch_core_session_locate(other_uuid))) {
                if ((flags & SMF_EXEC_INLINE)) {
                        switch_core_session_execute_application_get_flags(other_session, app, path, &app_flags);
index d8b548b048bfab6f26f83a0c30deedd1e309cb62..4af0dbb8ff4bd9d102d2d8a864f6ecc9c154a723 100644 (file)
@@ -1704,7 +1704,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, c
                const char *brto;
 
                if ((brto = switch_channel_get_variable(rchannel, "orignate_signal_bond")) || 
-                       (brto = switch_channel_get_variable(rchannel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+                       (brto = switch_channel_get_partner_uuid(rchannel))) {
                        switch_copy_string(b_uuid, brto, blen);
                        status = SWITCH_STATUS_SUCCESS;
                }
@@ -1738,7 +1738,7 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
 
        channel = switch_core_session_get_channel(session);
        rchannel = switch_core_session_get_channel(rsession);
-       buuid = switch_channel_get_variable(rchannel, SWITCH_SIGNAL_BOND_VARIABLE);
+       buuid = switch_channel_get_partner_uuid(rchannel);
 
        if ((var = switch_channel_get_variable(channel, "intercept_unbridged_only")) && switch_true(var)) {
                if ((switch_channel_test_flag(rchannel, CF_BRIDGED))) {
index 98fed62b3472a116b1d5ea4d7d43425fac8a985f..c18da450a6aae49b458234c3ec3a01571ee8b006 100644 (file)
@@ -3592,7 +3592,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
 
                        switch_channel_set_variable(caller_channel, SWITCH_SIGNAL_BOND_VARIABLE, switch_core_session_get_uuid(*bleg));
                        // Now main SWITCH_SIGNAL_BOND_VARIABLE is populated, don't need this one anymore...
-                       switch_channel_set_variable(caller_channel, "originate_signal_bond", NULL);
+                       switch_channel_set_variable(caller_channel, SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE, NULL);
                }
                
 
index f435c8702638b66925a0a1c549756123abbee8cf..8738071cb4db44a8890c68aa521b61da5da3ee82 100644 (file)
@@ -2570,7 +2570,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_soft_hold(switch_core_session_t *sess
        channel = switch_core_session_get_channel(session);
        switch_assert(channel != NULL);
 
-       if ((other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+       if ((other_uuid = switch_channel_get_partner_uuid(channel))) {
                if ((other_session = switch_core_session_locate(other_uuid))) {
                        other_channel = switch_core_session_get_channel(other_session);
 
index 1c243e1b80de36c4c55bd06034b7b71c398d2f0c..039cad9eb6182bf5d2eb57e68a06ef3bf92b47b8 100644 (file)
@@ -3048,7 +3048,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
                                        switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session");
                                        switch_channel_t *channel = switch_core_session_get_channel(session);
 
-                                       const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                       const char *uuid = switch_channel_get_partner_uuid(channel);
                                        if (uuid) {
                                                switch_core_session_t *other_session;
                                                switch_rtp_t *other_rtp_session = NULL;
@@ -3626,7 +3626,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
                                switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session");
                                switch_channel_t *channel = switch_core_session_get_channel(session);
 
-                               const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                               const char *uuid = switch_channel_get_partner_uuid(channel);
                                if (uuid) {
                                        switch_core_session_t *other_session;
 
@@ -4257,7 +4257,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra
                                switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session");
                                switch_channel_t *channel = switch_core_session_get_channel(session);
 
-                               const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                               const char *uuid = switch_channel_get_partner_uuid(channel);
                                if (uuid) {
                                        switch_core_session_t *other_session;