<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16717] </title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16717">16717</a></dd>
<dt>Author</dt> <dd>crienzo</dd>
<dt>Date</dt> <dd>2010-02-22 08:26:16 -0600 (Mon, 22 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Added synthparams and recogparams to config so that default MRCP params can be defined for SPEAK and RECOGNIZE requests.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkconfmrcp_profilesloquendo7mrcpv2xml">freeswitch/trunk/conf/mrcp_profiles/loquendo-7-mrcp-v2.xml</a></li>
<li><a href="#freeswitchtrunkconfmrcp_profilesnuance100mrcpv1xml">freeswitch/trunk/conf/mrcp_profiles/nuance-1.0.0-mrcp-v1.xml</a></li>
<li><a href="#freeswitchtrunkconfmrcp_profilesnuance50mrcpv1xml">freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v1.xml</a></li>
<li><a href="#freeswitchtrunkconfmrcp_profilesnuance50mrcpv2xml">freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v2.xml</a></li>
<li><a href="#freeswitchtrunkconfmrcp_profilesunimrcpservermrcpv1xml">freeswitch/trunk/conf/mrcp_profiles/unimrcpserver-mrcp-v1.xml</a></li>
<li><a href="#freeswitchtrunkconfmrcp_profilesvoxeoprophecy80mrcpv1xml">freeswitch/trunk/conf/mrcp_profiles/voxeo-prophecy-8.0-mrcp-v1.xml</a></li>
<li><a href="#freeswitchtrunksrcmodasr_ttsmod_unimrcpmod_unimrcpc">freeswitch/trunk/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkconfmrcp_profilesloquendo7mrcpv2xml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/mrcp_profiles/loquendo-7-mrcp-v2.xml (16716 => 16717)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/mrcp_profiles/loquendo-7-mrcp-v2.xml        2010-02-22 07:38:54 UTC (rev 16716)
+++ freeswitch/trunk/conf/mrcp_profiles/loquendo-7-mrcp-v2.xml        2010-02-22 14:26:16 UTC (rev 16717)
</span><span class="lines">@@ -19,5 +19,14 @@
</span><span class="cx"> <!--param name="ptime" value="20"/-->
</span><span class="cx"> <param name="codecs" value="PCMU PCMA L16/96/8000"/>
</span><span class="cx"> <param name="jsgf-mime-type" value="application/jsgf"/>
</span><ins>+
+ <!-- Add any default MRCP params for SPEAK requests here -->
+ <synthparams>
+ </synthparams>
+
+ <!-- Add any default MRCP params for RECOGNIZE requests here -->
+ <recogparams>
+ <!--param name="start-input-timers" value="false"/-->
+ </recogparams>
</ins><span class="cx"> </profile>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchtrunkconfmrcp_profilesnuance100mrcpv1xml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/mrcp_profiles/nuance-1.0.0-mrcp-v1.xml (16716 => 16717)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/mrcp_profiles/nuance-1.0.0-mrcp-v1.xml        2010-02-22 07:38:54 UTC (rev 16716)
+++ freeswitch/trunk/conf/mrcp_profiles/nuance-1.0.0-mrcp-v1.xml        2010-02-22 14:26:16 UTC (rev 16717)
</span><span class="lines">@@ -26,5 +26,14 @@
</span><span class="cx"> <!--param name="max-playout-delay" value="200"/-->
</span><span class="cx"> <!--param name="ptime" value="20"/-->
</span><span class="cx"> <param name="codecs" value="PCMU PCMA L16/96/8000"/>
</span><ins>+
+ <!-- Add any default MRCP params for SPEAK requests here -->
+ <synthparams>
+ </synthparams>
+
+ <!-- Add any default MRCP params for RECOGNIZE requests here -->
+ <recogparams>
+ <!--param name="start-input-timers" value="false"/-->
+ </recogparams>
</ins><span class="cx"> </profile>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchtrunkconfmrcp_profilesnuance50mrcpv1xml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v1.xml (16716 => 16717)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v1.xml        2010-02-22 07:38:54 UTC (rev 16716)
+++ freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v1.xml        2010-02-22 14:26:16 UTC (rev 16717)
</span><span class="lines">@@ -26,5 +26,14 @@
</span><span class="cx"> <!--param name="max-playout-delay" value="200"/-->
</span><span class="cx"> <!--param name="ptime" value="20"/-->
</span><span class="cx"> <param name="codecs" value="PCMU PCMA L16/96/8000"/>
</span><ins>+
+ <!-- Add any default MRCP params for SPEAK requests here -->
+ <synthparams>
+ </synthparams>
+
+ <!-- Add any default MRCP params for RECOGNIZE requests here -->
+ <recogparams>
+ <!--param name="start-input-timers" value="false"/-->
+ </recogparams>
</ins><span class="cx"> </profile>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchtrunkconfmrcp_profilesnuance50mrcpv2xml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v2.xml (16716 => 16717)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v2.xml        2010-02-22 07:38:54 UTC (rev 16716)
+++ freeswitch/trunk/conf/mrcp_profiles/nuance-5.0-mrcp-v2.xml        2010-02-22 14:26:16 UTC (rev 16717)
</span><span class="lines">@@ -30,5 +30,14 @@
</span><span class="cx"> <!--param name="max-playout-delay" value="200"/-->
</span><span class="cx"> <!--param name="ptime" value="20"/-->
</span><span class="cx"> <param name="codecs" value="PCMU PCMA L16/96/8000"/>
</span><ins>+
+ <!-- Add any default MRCP params for SPEAK requests here -->
+ <synthparams>
+ </synthparams>
+
+ <!-- Add any default MRCP params for RECOGNIZE requests here -->
+ <recogparams>
+ <!--param name="start-input-timers" value="false"/-->
+ </recogparams>
</ins><span class="cx"> </profile>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchtrunkconfmrcp_profilesunimrcpservermrcpv1xml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/mrcp_profiles/unimrcpserver-mrcp-v1.xml (16716 => 16717)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/mrcp_profiles/unimrcpserver-mrcp-v1.xml        2010-02-22 07:38:54 UTC (rev 16716)
+++ freeswitch/trunk/conf/mrcp_profiles/unimrcpserver-mrcp-v1.xml        2010-02-22 14:26:16 UTC (rev 16717)
</span><span class="lines">@@ -14,5 +14,14 @@
</span><span class="cx"> <!--param name="max-playout-delay" value="200"/-->
</span><span class="cx"> <!--param name="ptime" value="20"/-->
</span><span class="cx"> <param name="codecs" value="PCMU PCMA L16/96/8000"/>
</span><ins>+
+ <!-- Add any default MRCP params for SPEAK requests here -->
+ <synthparams>
+ </synthparams>
+
+ <!-- Add any default MRCP params for RECOGNIZE requests here -->
+ <recogparams>
+ <!--param name="start-input-timers" value="false"/-->
+ </recogparams>
</ins><span class="cx"> </profile>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchtrunkconfmrcp_profilesvoxeoprophecy80mrcpv1xml"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/conf/mrcp_profiles/voxeo-prophecy-8.0-mrcp-v1.xml (16716 => 16717)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/conf/mrcp_profiles/voxeo-prophecy-8.0-mrcp-v1.xml        2010-02-22 07:38:54 UTC (rev 16716)
+++ freeswitch/trunk/conf/mrcp_profiles/voxeo-prophecy-8.0-mrcp-v1.xml        2010-02-22 14:26:16 UTC (rev 16717)
</span><span class="lines">@@ -14,5 +14,14 @@
</span><span class="cx"> <!--param name="max-playout-delay" value="200"/-->
</span><span class="cx"> <!--param name="ptime" value="20"/-->
</span><span class="cx"> <param name="codecs" value="PCMU PCMA L16/96/8000"/>
</span><ins>+
+ <!-- Add any default MRCP params for SPEAK requests here -->
+ <synthparams>
+ </synthparams>
+
+ <!-- Add any default MRCP params for RECOGNIZE requests here -->
+ <recogparams>
+ <!--param name="start-input-timers" value="false"/-->
+ </recogparams>
</ins><span class="cx"> </profile>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchtrunksrcmodasr_ttsmod_unimrcpmod_unimrcpc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c (16716 => 16717)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c        2010-02-22 07:38:54 UTC (rev 16716)
+++ freeswitch/trunk/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c        2010-02-22 14:26:16 UTC (rev 16717)
</span><span class="lines">@@ -136,6 +136,10 @@
</span><span class="cx">         const char *srgs_xml_mime_type;
</span><span class="cx">         /** MIME type to use for SRGS ABNF grammars */
</span><span class="cx">         const char *srgs_mime_type;
</span><ins>+        /** Default params to use for RECOGNIZE requests */
+        switch_hash_t *default_recog_params;
+        /** Default params to use for SPEAK requests */
+        switch_hash_t *default_synth_params;
</ins><span class="cx"> };
</span><span class="cx"> typedef struct profile profile_t;
</span><span class="cx"> static switch_status_t profile_create(profile_t ** profile, const char *name, switch_memory_pool_t *pool);
</span><span class="lines">@@ -501,6 +505,8 @@
</span><span class="cx">                 lprofile->srgs_xml_mime_type = "application/srgs+xml";
</span><span class="cx">                 lprofile->gsl_mime_type = "application/x-nuance-gsl";
</span><span class="cx">                 lprofile->jsgf_mime_type = "application/x-jsgf";
</span><ins>+                switch_core_hash_init(&lprofile->default_synth_params, pool);
+                switch_core_hash_init(&lprofile->default_recog_params, pool);
</ins><span class="cx">                 *profile = lprofile;
</span><span class="cx">
</span><span class="cx">                 if (globals.enable_profile_events && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_PROFILE_CREATE) == SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -1498,6 +1504,7 @@
</span><span class="cx">         profile_t *profile = NULL;
</span><span class="cx">         int speech_channel_number = get_next_speech_channel_number();
</span><span class="cx">         char name[200] = { 0 };
</span><ins>+        switch_hash_index_t *hi = NULL;
</ins><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
</span><span class="cx">                                          "speech_handle: name = %s, rate = %d, speed = %d, samples = %d, voice = %s, engine = %s, param = %s\n", sh->name, sh->rate,
</span><span class="lines">@@ -1534,6 +1541,17 @@
</span><span class="cx">                 speech_channel_set_param(schannel, "Voice-Name", voice_name);
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        /* Set default TTS params */
+        for (hi = switch_hash_first(NULL, profile->default_synth_params); hi; hi = switch_hash_next(hi)) {
+                char *param_name = NULL, *param_val = NULL;
+                const void *key;
+                void *val;
+                switch_hash_this(hi, &key, NULL, &val);
+                param_name = (char *) key;
+                param_val = (char *) val;
+                speech_channel_set_param(schannel, param_name, param_val);
+        }
+
</ins><span class="cx"> done:
</span><span class="cx">
</span><span class="cx">         return status;
</span><span class="lines">@@ -2679,6 +2697,7 @@
</span><span class="cx">         const char *profile_name = NULL;
</span><span class="cx">         profile_t *profile = NULL;
</span><span class="cx">         recognizer_data_t *r = NULL;
</span><ins>+        switch_hash_index_t *hi = NULL;
</ins><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "asr_handle: name = %s, codec = %s, rate = %d, grammar = %s, param = %s\n",
</span><span class="cx">                                          ah->name, ah->codec, ah->rate, ah->grammar, ah->param);
</span><span class="lines">@@ -2714,8 +2733,22 @@
</span><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><del>-        status = speech_channel_open(schannel, profile);
</del><ins>+        
+        if ((status = speech_channel_open(schannel, profile)) != SWITCH_STATUS_SUCCESS) {
+                goto done;
+        }
</ins><span class="cx">
</span><ins>+        /* Set default ASR params */
+        for (hi = switch_hash_first(NULL, profile->default_recog_params); hi; hi = switch_hash_next(hi)) {
+                char *param_name = NULL, *param_val = NULL;
+                const void *key;
+                void *val;
+                switch_hash_this(hi, &key, NULL, &val);
+                param_name = (char *) key;
+                param_val = (char *) val;
+                speech_channel_set_param(schannel, param_name, param_val);
+        }
+
</ins><span class="cx"> done:
</span><span class="cx">
</span><span class="cx">         return status;
</span><span class="lines">@@ -3589,6 +3622,7 @@
</span><span class="cx">                         mrcp_profile_t *mprofile = NULL;
</span><span class="cx">                         mpf_rtp_config_t *rtp_config = NULL;
</span><span class="cx">                         profile_t *mod_profile = NULL;
</span><ins>+                        switch_xml_t default_params = NULL;
</ins><span class="cx">
</span><span class="cx">                         /* get profile attributes */
</span><span class="cx">                         const char *name = apr_pstrdup(pool, switch_xml_attr(profile, "name"));
</span><span class="lines">@@ -3603,6 +3637,42 @@
</span><span class="cx">                         profile_create(&mod_profile, name, mod_pool);
</span><span class="cx">                         switch_core_hash_insert(globals.profiles, mod_profile->name, mod_profile);
</span><span class="cx">
</span><ins>+                        /* pull in any default SPEAK params */
+                        default_params = switch_xml_child(profile, "synthparams");
+                        if (default_params) {
+                                switch_xml_t param = NULL;
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading SPEAK params\n");
+                                for (param = switch_xml_child(default_params, "param"); param; param = switch_xml_next(param)) {
+                                        const char *param_name = switch_xml_attr(param, "name");
+                                        const char *param_value = switch_xml_attr(param, "value");
+                                        if (zstr(param_name)) {
+                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing SPEAK param name\n");
+                                                client = NULL;
+                                                goto done;
+                                        }
+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading SPEAK Param %s:%s\n", param_name, param_value);
+                                        switch_core_hash_insert(mod_profile->default_synth_params, param_name, param_value);
+                                }
+                        }
+
+                        /* pull in any default RECOGNIZE params */
+                        default_params = switch_xml_child(profile, "recogparams");
+                        if (default_params) {
+                                switch_xml_t param = NULL;
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading RECOGNIZE params\n");
+                                for (param = switch_xml_child(default_params, "param"); param; param = switch_xml_next(param)) {
+                                        const char *param_name = switch_xml_attr(param, "name");
+                                        const char *param_value = switch_xml_attr(param, "value");
+                                        if (zstr(param_name)) {
+                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing RECOGNIZE param name\n");
+                                                client = NULL;
+                                                goto done;
+                                        }
+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loading RECOGNIZE Param %s:%s\n", param_name, param_value);
+                                        switch_core_hash_insert(mod_profile->default_recog_params, param_name, param_value);
+                                }
+                        }
+
</ins><span class="cx">                         /* create RTP config, common to MRCPv1 and MRCPv2 */
</span><span class="cx">                         rtp_config = mpf_rtp_config_create(pool);
</span><span class="cx">                         rtp_config->rtp_port_min = DEFAULT_RTP_PORT_MIN;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>