提交 65c4f76f authored 作者: Christopher Rienzo's avatar Christopher Rienzo

allow space after filename in play_and_detect_speech

上级 893d7eff
...@@ -464,6 +464,7 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function) ...@@ -464,6 +464,7 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function)
char *lbuf = NULL; char *lbuf = NULL;
const char *response = "DONE"; const char *response = "DONE";
char *detect = NULL; char *detect = NULL;
char *s;
switch_channel_set_variable(channel, "detect_speech_result", ""); switch_channel_set_variable(channel, "detect_speech_result", "");
...@@ -474,6 +475,12 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function) ...@@ -474,6 +475,12 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function)
goto done; goto done;
} }
/* trim any trailing space */
s = detect;
while (--s >= lbuf && switch_isspace(*s)) {
*s = '\0';
}
/* split input at "detect:" */ /* split input at "detect:" */
detect[0] = '\0'; detect[0] = '\0';
detect += 7; detect += 7;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论