mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
FS-3910 forgot part of this last patch
This commit is contained in:
parent
4bbd967142
commit
2c52f23643
@ -1097,28 +1097,26 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
|
|||||||
switch_size_t len;
|
switch_size_t len;
|
||||||
uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
||||||
switch_frame_t frame = { 0 };
|
switch_frame_t frame = { 0 };
|
||||||
|
switch_status_t status;
|
||||||
|
|
||||||
frame.data = data;
|
frame.data = data;
|
||||||
frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
|
frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
switch_status_t status = switch_core_media_bug_read(bug, &frame, SWITCH_FALSE);
|
|
||||||
|
|
||||||
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
|
status = switch_core_media_bug_read(bug, &frame, SWITCH_FALSE);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK) {
|
||||||
len = (switch_size_t) frame.datalen / 2;
|
len = (switch_size_t) frame.datalen / 2;
|
||||||
|
|
||||||
if (len && switch_core_file_write(rh->fh, data, &len) != SWITCH_STATUS_SUCCESS && rh->hangup_on_error) {
|
if (len && switch_core_file_write(rh->fh, data, &len) != SWITCH_STATUS_SUCCESS && rh->hangup_on_error) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error writing %s\n", rh->file);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error writing %s\n", rh->file);
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
|
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
|
||||||
return SWITCH_FALSE;
|
return SWITCH_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status == SWITCH_STATUS_BREAK) break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SWITCH_ABC_TYPE_WRITE:
|
case SWITCH_ABC_TYPE_WRITE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user