diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index 4a169f93f8..5adc12bbcb 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -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); } diff --git a/src/switch_msrp.c b/src/switch_msrp.c index 1630de613b..9b05774ceb 100644 --- a/src/switch_msrp.c +++ b/src/switch_msrp.c @@ -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; }