]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9638 fail when write doesn't work
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 14 Nov 2016 18:40:17 +0000 (12:40 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 14 Nov 2016 18:40:17 +0000 (12:40 -0600)
src/switch_ivr_bridge.c
src/switch_msrp.c

index 4a169f93f8c98675982a6ed71f913b29adc1aabd..5adc12bbcb8276c2271b8555874f9664832e2b73 100644 (file)
@@ -128,7 +128,11 @@ static void text_bridge_thread(switch_core_session_t *session, void *obj)
                }
                
                if (!switch_test_flag(read_frame, SFF_CNG)) {
-                       switch_core_session_write_text_frame(vh->session_b, read_frame, 0, 0);
+                       switch_status_t tstatus = switch_core_session_write_text_frame(vh->session_b, read_frame, 0, 0);
+
+                       if (tstatus != SWITCH_STATUS_SUCCESS) {
+                               switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                       }
                }
                switch_core_session_write_text_frame(vh->session_a, NULL, 0, 0);
        }
index 1630de613b912e267aeb6b504b55575f6f40086d..9b05774ceb17df5cb47b8f0f88e8465b4346760a 100644 (file)
@@ -1151,7 +1151,10 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_send(switch_msrp_session_t *ms, msrp
        char *to_path = msrp_msg->headers[MSRP_H_TO_PATH] ? msrp_msg->headers[MSRP_H_TO_PATH] : ms->remote_path;
        char *from_path = msrp_msg->headers[MSRP_H_FROM_PATH] ? msrp_msg->headers[MSRP_H_FROM_PATH] : ms->local_path;
 
-       if (!from_path) return SWITCH_STATUS_SUCCESS;
+       if (!from_path) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "NO FROM PATH\n");
+               return SWITCH_STATUS_SUCCESS;
+       }
 
        random_string(transaction_id, MSRP_TRANS_ID_LEN);
 
@@ -1179,7 +1182,6 @@ SWITCH_DECLARE(switch_status_t) switch_msrp_send(switch_msrp_session_t *ms, msrp
        sprintf(buf + len, "\r\n-------%s$\r\n", transaction_id);
        len += (12 + strlen(transaction_id));
        if (globals.debug) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "---------------------send: %" SWITCH_SIZE_T_FMT " bytes\n%s\n", len, buf);
-
        return ms->csock ? msrp_socket_send(ms->csock, buf, &len) : SWITCH_STATUS_FALSE;
 }