提交 a56dba7f authored 作者: Arsen Chaloyan's avatar Arsen Chaloyan

asr result in mrcp message body must be checked to exist before use

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5633 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f094dc4e
...@@ -487,6 +487,7 @@ static switch_status_t openmrcp_asr_get_results(switch_asr_handle_t *ah, char ** ...@@ -487,6 +487,7 @@ static switch_status_t openmrcp_asr_get_results(switch_asr_handle_t *ah, char **
</result> </result>
*/ */
if(asr_session->mrcp_message_last_rcvd && asr_session->mrcp_message_last_rcvd->body) {
char *marker = "?>"; // FIXME -- lame and brittle way of doing this. use regex or better. char *marker = "?>"; // FIXME -- lame and brittle way of doing this. use regex or better.
char *position = strstr(asr_session->mrcp_message_last_rcvd->body, marker); char *position = strstr(asr_session->mrcp_message_last_rcvd->body, marker);
if (!position) { if (!position) {
...@@ -497,6 +498,11 @@ static switch_status_t openmrcp_asr_get_results(switch_asr_handle_t *ah, char ** ...@@ -497,6 +498,11 @@ static switch_status_t openmrcp_asr_get_results(switch_asr_handle_t *ah, char **
position += strlen(marker); position += strlen(marker);
*xmlstr = strdup(position); *xmlstr = strdup(position);
} }
}
else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No result received from mrcp server: %s");
ret = SWITCH_STATUS_FALSE;
}
// since we are returning our result here, future calls to check_results // since we are returning our result here, future calls to check_results
// should return False // should return False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论