]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
move the thing that passes proto_specific_hangup_cause to the core and prefix it...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 9 Nov 2011 19:52:43 +0000 (13:52 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 9 Nov 2011 19:52:43 +0000 (13:52 -0600)
src/mod/endpoints/mod_sofia/sofia.c
src/switch_channel.c

index 59a9d5734a58d24e84af7dff2d0b713ac72bbb16..1e82aa7f60a4587d507ef4c2a8a46db51abb36e9 100644 (file)
@@ -545,7 +545,6 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
        switch_snprintf(st, sizeof(st), "%d", status);
        switch_channel_set_variable(channel, "sip_term_status", st);
        switch_snprintf(st, sizeof(st), "sip:%d", status);
-       switch_channel_set_variable_partner(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st);
        switch_channel_set_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st);
 
        if (phrase) {
@@ -6027,7 +6026,6 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                switch_snprintf(st, sizeof(st), "%d", status);
                                switch_channel_set_variable(channel, "sip_term_status", st);
                                switch_snprintf(st, sizeof(st), "sip:%d", status);
-                               switch_channel_set_variable_partner(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st);
                                switch_channel_set_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st);
                                if (phrase) {
                                        switch_channel_set_variable_partner(channel, "sip_hangup_phrase", phrase);
index 6902ac7ad892d090a49f3ef401148bdd09c00e35..8af8c25c37350f868625c8a4923812c5150d3941 100644 (file)
@@ -2811,6 +2811,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
        if (channel->state < CS_HANGUP) {
                switch_channel_state_t last_state;
                switch_event_t *event;
+               const char *var;
 
                switch_mutex_lock(channel->state_mutex);
                last_state = channel->state;
@@ -2829,6 +2830,14 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
                                                  channel->name, state_names[last_state], switch_channel_cause2str(channel->hangup_cause));
 
 
+               switch_channel_set_variable_partner(channel, "last_bridge_hangup_cause", switch_channel_cause2str(hangup_cause));
+
+               if ((var = switch_channel_get_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE))) {
+                       printf("WTF %s\n", var);
+                       switch_channel_set_variable_partner(channel, "last_bridge_" SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, var);
+               }
+
+
                if (!switch_core_session_running(channel->session) && !switch_core_session_started(channel->session)) {
                        switch_core_session_thread_launch(channel->session);
                }