From a82506de572525ee684b6a9b9e0aef87ed0b6137 Mon Sep 17 00:00:00 2001 From: Christopher Rienzo Date: Mon, 22 Feb 2010 17:10:01 +0000 Subject: [PATCH] Added ssml-mime-type config param to deal with server that doesn't like application/ssml+xml git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16720 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c index 122186db26..8ea681c30b 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c @@ -124,6 +124,7 @@ static mod_unimrcp_globals_t globals; struct profile { /** name of the profile */ char *name; + /** MIME type to use for JSGF grammars */ const char *jsgf_mime_type; /** MIME type to use for GSL grammars */ @@ -132,6 +133,10 @@ struct profile { const char *srgs_xml_mime_type; /** MIME type to use for SRGS ABNF grammars */ const char *srgs_mime_type; + + /** MIME type to use for SSML (TTS) */ + const char *ssml_mime_type; + /** Default params to use for RECOGNIZE requests */ switch_hash_t *default_recog_params; /** Default params to use for SPEAK requests */ @@ -354,7 +359,6 @@ static const char *speech_channel_type_to_string(speech_channel_type_t type); */ /* synthesis languages */ -#define MIME_TYPE_SSML_XML "application/ssml+xml" #define MIME_TYPE_PLAIN_TEXT "text/plain" static switch_status_t synth_load(switch_loadable_module_interface_t *module_interface, switch_memory_pool_t *pool); @@ -501,6 +505,7 @@ static switch_status_t profile_create(profile_t ** profile, const char *name, sw lprofile->srgs_xml_mime_type = "application/srgs+xml"; lprofile->gsl_mime_type = "application/x-nuance-gsl"; lprofile->jsgf_mime_type = "application/x-jsgf"; + lprofile->ssml_mime_type = "application/ssml+xml"; switch_core_hash_init(&lprofile->default_synth_params, pool); switch_core_hash_init(&lprofile->default_recog_params, pool); *profile = lprofile; @@ -1013,7 +1018,7 @@ static switch_status_t synth_channel_speak(speech_channel_t *schannel, const cha /* good enough way of determining SSML or plain text body */ if (text_starts_with(text, XML_ID) || text_starts_with(text, SSML_ID)) { - apt_string_assign(&generic_header->content_type, MIME_TYPE_SSML_XML, mrcp_message->pool); + apt_string_assign(&generic_header->content_type, schannel->profile->ssml_mime_type, mrcp_message->pool); } else { apt_string_assign(&generic_header->content_type, MIME_TYPE_PLAIN_TEXT, mrcp_message->pool); } @@ -3358,6 +3363,8 @@ static int process_profile_config(profile_t *profile, const char *param, const c profile->srgs_xml_mime_type = switch_core_strdup(pool, val); } else if (strcasecmp(param, "srgs-mime-type") == 0) { profile->srgs_mime_type = switch_core_strdup(pool, val); + } else if (strcasecmp(param, "ssml-mime-type") == 0) { + profile->ssml_mime_type = switch_core_strdup(pool, val); } else { mine = 0; }