]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5510 --resolve - also add logging of hangup cause
authorNathan Neulinger <nneul@neulinger.org>
Tue, 18 Jun 2013 17:21:35 +0000 (12:21 -0500)
committerNathan Neulinger <nneul@neulinger.org>
Tue, 18 Jun 2013 17:21:35 +0000 (12:21 -0500)
src/mod/endpoints/mod_skinny/mod_skinny.c

index 2e7688158d4bc697dd5959a5b552d02b8b376e65..defbf915f98e856f60351a601f42d4d88757a353 100644 (file)
@@ -801,7 +801,9 @@ int channel_on_hangup_callback(void *pArg, int argc, char **argv, char **columnN
                skinny_line_set_state(listener, line_instance, call_id, SKINNY_ON_HOOK);
                send_select_soft_keys(listener, line_instance, call_id, SKINNY_KEY_SET_ON_HOOK, 0xffff);
                send_define_current_time_date(listener);
-               send_set_speaker_mode(listener, SKINNY_SPEAKER_OFF);
+               if((call_state == SKINNY_PROCEED) || (call_state == SKINNY_RING_OUT) || (call_state == SKINNY_CONNECTED)) { /* calling parties */
+                       send_set_speaker_mode(listener, SKINNY_SPEAKER_OFF);
+               }
                send_set_ringer(listener, SKINNY_RING_OFF, SKINNY_RING_FOREVER, 0, call_id);
        }
        return 0;
@@ -817,7 +819,8 @@ switch_status_t channel_on_hangup(switch_core_session_t *session)
 
        switch_clear_flag_locked(tech_pvt, TFLAG_IO);
 
-       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP\n", switch_channel_get_name(channel));
+       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP [%s]\n", 
+               switch_channel_get_name(channel), switch_channel_cause2str(cause));
 
        helper.tech_pvt= tech_pvt;
        helper.cause= cause;