提交 d1d6081d authored 作者: Anthony Minessale's avatar Anthony Minessale

phrase update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4185 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 be1e4e39
...@@ -46,8 +46,11 @@ static const char modname[] = "mod_say_en"; ...@@ -46,8 +46,11 @@ static const char modname[] = "mod_say_en";
#define say_file(...) {\ #define say_file(...) {\
char tmp[80];\ char tmp[80];\
switch_status_t status;\
snprintf(tmp, sizeof(tmp), __VA_ARGS__);\ snprintf(tmp, sizeof(tmp), __VA_ARGS__);\
switch_ivr_play_file(session, NULL, tmp, args); \ if ((status = switch_ivr_play_file(session, NULL, tmp, args)) != SWITCH_STATUS_SUCCESS){ \
return status;\
}\
if (!switch_channel_ready(switch_core_session_get_channel(session))) {\ if (!switch_channel_ready(switch_core_session_get_channel(session))) {\
return SWITCH_STATUS_FALSE;\ return SWITCH_STATUS_FALSE;\
}}\ }}\
...@@ -540,10 +543,10 @@ static switch_status_t en_say(switch_core_session_t *session, ...@@ -540,10 +543,10 @@ static switch_status_t en_say(switch_core_session_t *session,
} }
if (say_cb) { if (say_cb) {
say_cb(session, tosay, type, method, args); return say_cb(session, tosay, type, method, args);
} }
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_FALSE;
} }
static const switch_say_interface_t en_say_interface= { static const switch_say_interface_t en_say_interface= {
......
...@@ -4697,7 +4697,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -4697,7 +4697,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
} }
if (match) { if (match) {
for (action = switch_xml_child(match, "action"); action; action = action->next) { status = SWITCH_STATUS_SUCCESS;
for (action = switch_xml_child(match, "action"); action && status == SWITCH_STATUS_SUCCESS; action = action->next) {
char *adata = (char *) switch_xml_attr_soft(action, "data"); char *adata = (char *) switch_xml_attr_soft(action, "data");
char *func = (char *) switch_xml_attr_soft(action, "function"); char *func = (char *) switch_xml_attr_soft(action, "function");
...@@ -4739,7 +4740,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -4739,7 +4740,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
char *say_type = (char *) switch_xml_attr_soft(action, "type"); char *say_type = (char *) switch_xml_attr_soft(action, "type");
char *say_method = (char *) switch_xml_attr_soft(action, "method"); char *say_method = (char *) switch_xml_attr_soft(action, "method");
si->say_function(session, odata, get_say_type_by_name(say_type), get_say_method_by_name(say_method), args); status = si->say_function(session, odata, get_say_type_by_name(say_type), get_say_method_by_name(say_method), args);
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid SAY Interface [%s]!\n", lang); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid SAY Interface [%s]!\n", lang);
} }
...@@ -4747,12 +4748,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -4747,12 +4748,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
switch_codec_t *read_codec; switch_codec_t *read_codec;
if ((read_codec = switch_core_session_get_read_codec(session))) { if ((read_codec = switch_core_session_get_read_codec(session))) {
switch_ivr_speak_text(session, status = switch_ivr_speak_text(session,
tts_engine, tts_engine,
tts_voice, tts_voice,
read_codec->implementation->samples_per_second, read_codec->implementation->samples_per_second,
odata, odata,
args); args);
} }
} }
} }
...@@ -4763,6 +4764,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s ...@@ -4763,6 +4764,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
switch_safe_free(substituted); switch_safe_free(substituted);
} }
if (status != SWITCH_STATUS_SUCCESS) {
break;
}
input = input->next; input = input->next;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论