mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-12 12:18:18 +00:00
cleanups
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6869 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
50326f4d03
commit
0fe7efe735
@ -81,7 +81,9 @@ stfu_instance_t *stfu_n_init(uint32_t qlen)
|
||||
struct stfu_instance *i;
|
||||
|
||||
i = malloc(sizeof(*i));
|
||||
assert(i != NULL);
|
||||
if (!i) {
|
||||
return NULL;
|
||||
}
|
||||
memset(i, 0, sizeof(*i));
|
||||
stfu_n_init_aqueue(&i->a_queue, qlen);
|
||||
stfu_n_init_aqueue(&i->b_queue, qlen);
|
||||
|
@ -441,7 +441,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
|
||||
switch_byte_t decoded[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
||||
uint32_t rate = read_codec->implementation->actual_samples_per_second;
|
||||
uint32_t dlen = sizeof(decoded);
|
||||
switch_status_t status;
|
||||
switch_status_t tstatus;
|
||||
switch_byte_t *sendbuf = NULL;
|
||||
uint32_t sendlen = 0;
|
||||
|
||||
@ -452,9 +452,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
} else {
|
||||
if (switch_test_flag(conninfo, SUF_NATIVE)) {
|
||||
status = SWITCH_STATUS_NOOP;
|
||||
tstatus = SWITCH_STATUS_NOOP;
|
||||
} else {
|
||||
status = switch_core_codec_decode(
|
||||
tstatus = switch_core_codec_decode(
|
||||
read_codec,
|
||||
&conninfo->read_codec,
|
||||
read_frame->data,
|
||||
@ -462,17 +462,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
|
||||
read_codec->implementation->actual_samples_per_second,
|
||||
decoded, &dlen, &rate, &flags);
|
||||
}
|
||||
switch (status) {
|
||||
switch (tstatus) {
|
||||
case SWITCH_STATUS_NOOP:
|
||||
case SWITCH_STATUS_BREAK:
|
||||
sendbuf = read_frame->data;
|
||||
sendlen = read_frame->datalen;
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
tstatus = SWITCH_STATUS_SUCCESS;
|
||||
break;
|
||||
case SWITCH_STATUS_SUCCESS:
|
||||
sendbuf = decoded;
|
||||
sendlen = dlen;
|
||||
status = SWITCH_STATUS_SUCCESS;
|
||||
tstatus = SWITCH_STATUS_SUCCESS;
|
||||
break;
|
||||
default:
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Codec Error\n");
|
||||
@ -481,7 +481,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
|
||||
}
|
||||
}
|
||||
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
if (tstatus == SWITCH_STATUS_SUCCESS) {
|
||||
len = sendlen;
|
||||
if (switch_socket_sendto(conninfo->socket, conninfo->remote_addr, 0, (void *)sendbuf, &len) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_ivr_deactivate_unicast(session);
|
||||
|
@ -785,9 +785,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||
/* read from the channel while we wait if the audio is up on it */
|
||||
if (session && (ringback_data || !switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)) &&
|
||||
(switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA))) {
|
||||
switch_status_t status = switch_core_session_read_frame(session, &read_frame, 1000, 0);
|
||||
switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, 1000, 0);
|
||||
|
||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||
if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1063,13 +1063,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||
}
|
||||
} else { /* time off the channel (if you must) */
|
||||
switch_frame_t *read_frame;
|
||||
switch_status_t status;
|
||||
switch_status_t tstatus;
|
||||
while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
|
||||
switch_yield(10000);
|
||||
}
|
||||
status = switch_core_session_read_frame(session, &read_frame, -1, 0);
|
||||
tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
|
||||
|
||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||
if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1387,13 +1387,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
|
||||
}
|
||||
} else {
|
||||
switch_frame_t *read_frame;
|
||||
switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
|
||||
switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
|
||||
|
||||
while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
|
||||
switch_yield(10000);
|
||||
}
|
||||
|
||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||
if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1450,13 +1450,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
|
||||
}
|
||||
} else { /* time off the channel (if you must) */
|
||||
switch_frame_t *read_frame;
|
||||
switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
|
||||
switch_status_t tstatus = switch_core_session_read_frame(session, &read_frame, -1, 0);
|
||||
|
||||
while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
|
||||
switch_yield(10000);
|
||||
}
|
||||
|
||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||
if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user