提交 432da6e0 authored 作者: Anthony Minessale's avatar Anthony Minessale

cleanup

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9496 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0468d160
...@@ -4372,6 +4372,9 @@ SWITCH_STANDARD_APP(conference_function) ...@@ -4372,6 +4372,9 @@ SWITCH_STANDARD_APP(conference_function)
buf, buf,
sizeof(pin_buf) - strlen(pin_buf), sizeof(pin_buf) - strlen(pin_buf),
strlen(conference->pin) - strlen(pin_buf), "#", &term, 10000, 0, 0); strlen(conference->pin) - strlen(pin_buf), "#", &term, 10000, 0, 0);
if (status == SWITCH_STATUS_TIMEOUT) {
status = SWITCH_STATUS_SUCCESS;
}
} }
pin_valid = (status == SWITCH_STATUS_SUCCESS && strcmp(pin_buf, conference->pin) == 0); pin_valid = (status == SWITCH_STATUS_SUCCESS && strcmp(pin_buf, conference->pin) == 0);
......
...@@ -929,8 +929,12 @@ static switch_status_t vm_macro_get(switch_core_session_t *session, ...@@ -929,8 +929,12 @@ static switch_status_t vm_macro_get(switch_core_session_t *session,
if (maxlen == 0 || maxlen > buflen - 1) { if (maxlen == 0 || maxlen > buflen - 1) {
maxlen = buflen - 1; maxlen = buflen - 1;
} }
if (bslen < maxlen) { if (bslen < maxlen) {
status = switch_ivr_collect_digits_count(session, buf + bslen, buflen, maxlen - bslen, term_chars, terminator_key, timeout, 0, 0); status = switch_ivr_collect_digits_count(session, buf + bslen, buflen, maxlen - bslen, term_chars, terminator_key, timeout, 0, 0);
if (status == SWITCH_STATUS_TIMEOUT) {
status = SWITCH_STATUS_SUCCESS;
}
} }
return status; return status;
......
...@@ -1482,6 +1482,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel ...@@ -1482,6 +1482,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
if (status == SWITCH_STATUS_SUCCESS) { if (status == SWITCH_STATUS_SUCCESS) {
switch_channel_perform_mark_pre_answered(channel, file, func, line); switch_channel_perform_mark_pre_answered(channel, file, func, line);
status = switch_ivr_sleep(channel->session, 250, NULL);
} else { } else {
switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
} }
...@@ -1598,10 +1599,13 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t * ...@@ -1598,10 +1599,13 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
if (status == SWITCH_STATUS_SUCCESS) { if (status == SWITCH_STATUS_SUCCESS) {
switch_channel_perform_mark_answered(channel, file, func, line); switch_channel_perform_mark_answered(channel, file, func, line);
status = switch_ivr_sleep(channel->session, 250, NULL);
} else { } else {
switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
} }
return status; return status;
} }
......
...@@ -101,6 +101,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -101,6 +101,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
uint8_t done = 0; uint8_t done = 0;
int matches = 0; int matches = 0;
const char *pause_val;
int pause = 100;
if (!macro_name) { if (!macro_name) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No phrase macro specified.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No phrase macro specified.\n");
...@@ -182,7 +184,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -182,7 +184,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
old_sound_prefix = p; old_sound_prefix = p;
switch_channel_set_variable(channel, "sound_prefix", sound_path); switch_channel_set_variable(channel, "sound_prefix", sound_path);
} }
if (!(macro = switch_xml_child(language, "macro"))) { if (!(macro = switch_xml_child(language, "macro"))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find any macro tags.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find any macro tags.\n");
goto done; goto done;
...@@ -200,6 +202,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -200,6 +202,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
goto done; goto done;
} }
if ((pause_val = switch_xml_attr(macro, "pause"))) {
int tmp = atoi(pause_val);
if (tmp >= 0) {
pause = tmp;
}
}
if (!(input = switch_xml_child(macro, "input"))) { if (!(input = switch_xml_child(macro, "input"))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find any input tags.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "can't find any input tags.\n");
goto done; goto done;
...@@ -316,6 +325,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -316,6 +325,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
status = switch_ivr_speak_text(session, my_tts_engine, my_tts_voice, odata, args); status = switch_ivr_speak_text(session, my_tts_engine, my_tts_voice, odata, args);
} }
} }
switch_ivr_sleep(session, pause, NULL);
} }
} }
...@@ -1497,7 +1508,10 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t ...@@ -1497,7 +1508,10 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
/* Try to grab some more digits for the timeout period */ /* Try to grab some more digits for the timeout period */
status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &terminator, timeout, 0, 0); status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &terminator, timeout, 0, 0);
if (status == SWITCH_STATUS_TIMEOUT) {
status = SWITCH_STATUS_SUCCESS;
}
/* Make sure we made it out alive */ /* Make sure we made it out alive */
if (status != SWITCH_STATUS_SUCCESS) { if (status != SWITCH_STATUS_SUCCESS) {
/* Bail */ /* Bail */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论