]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5772 --resolve this is sort of a hack but less painful than reporting bugs to...
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 10 Sep 2013 18:14:30 +0000 (23:14 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 10 Sep 2013 18:14:30 +0000 (23:14 +0500)
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia.c
src/switch_channel.c

index 8efb07193f90150b8f770748b68dd0732280bd05..2bc0476da780e63fdcd186c595fb6d2b39b2dc07 100644 (file)
@@ -5396,10 +5396,13 @@ SWITCH_STANDARD_APP(sofia_sla_function)
        private_object_t *tech_pvt;
        switch_core_session_t *bargee_session;
        switch_channel_t *channel = switch_core_session_get_channel(session);
+
        if (zstr(data)) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: <uuid>\n");
                return;
        }
+
+       switch_channel_answer(channel);
        
        if ((bargee_session = switch_core_session_locate((char *)data))) {
                if (bargee_session == session) {
index 83080a3890904e9c2bfb8ddfe4a5a667642f544d..be0cfdde238451c44683a4b61ceba5f2d849faf9 100644 (file)
@@ -8782,6 +8782,17 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
                                        }
 
                                        if (!zstr(bridge_uuid) && switch_channel_test_flag(b_channel, CF_LEG_HOLDING)) {
+                                               const char *b_call_id = switch_channel_get_variable(b_channel, "sip_call_id");
+
+                                               if (b_call_id) {
+                                                       char *sql = switch_mprintf("update sip_dialogs set call_info_state='idle' where call_id='%q'", b_call_id);
+                                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "SQL: %s\n", sql);
+                                                       sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
+
+                                                       switch_channel_presence(b_channel, "unknown", "idle", NULL);
+                                                       
+                                               }
+
                                                tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool,
                                                                                                                                                                                   "%sanswer,intercept:%s", codec_str, bridge_uuid);
                                        } else {
index cbae78ba44f214cde0796b5b4c1787f5f9238a76..771fd750424bea766e61f9c3af80fdf806271e0b 100644 (file)
@@ -730,7 +730,7 @@ SWITCH_DECLARE(void) switch_channel_perform_presence(switch_channel_t *channel,
                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
 
 
-               if (!switch_channel_up_nosig(channel)) {
+               if (!strcasecmp(status, "idle") || !switch_channel_up_nosig(channel)) {
                        call_info_state = "idle";
                } else if (!strcasecmp(status, "hold-private")) {
                        call_info_state = "held-private";