From cfb0324e0eb36bbdeeaf02cd3503385de5317964 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 16 Oct 2007 15:25:38 +0000 Subject: [PATCH] fix xml to work with v1/voxeo git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5890 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c index ac9029d2b1..0503cb8f6a 100644 --- a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c +++ b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c @@ -527,16 +527,33 @@ static mrcp_status_t synth_speak(mrcp_client_context_t *context, openmrcp_sessio mrcp_message_t *mrcp_message; char *text2speak; - const char xml_head[] = + const char v2_xml_head[] = "\r\n" "\r\n" "\r\n" " "; - const char xml_tail[] = "\r\n" + const char v2_xml_tail[] = "\r\n" "\r\n" "\r\n"; + const char v1_xml_head[] = "\n" + "\n"; + + + const char v1_xml_tail[] = "\n\n"; + + const char *xml_head, *xml_tail; + + if (tts_session->profile->mrcp_options->proto_version == 1) { + xml_head = v1_xml_head; + xml_tail = v1_xml_tail; + } else { + xml_head = v2_xml_head; + xml_tail = v2_xml_tail; + } + + size_t len = sizeof(xml_head) + sizeof(text) + sizeof(xml_tail); text2speak = (char *) switch_core_alloc(tts_session->pool, len); strcat(text2speak, xml_head);