]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
clarify usage of unimrcp
authorBrian West <brian@freeswitch.org>
Mon, 31 Aug 2009 20:38:23 +0000 (20:38 +0000)
committerBrian West <brian@freeswitch.org>
Mon, 31 Aug 2009 20:38:23 +0000 (20:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14706 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c
src/switch_core_asr.c

index 17bf4d91663b43d207ff889d5034013b7c91881e..c3c6e705c8c89454515c2d175af506766602c062 100644 (file)
@@ -2507,7 +2507,7 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec
        speech_channel_t *schannel = NULL;
        int speech_channel_number = get_next_speech_channel_number();
        char name[200] = { 0 };
-       const char *profile_name;
+       const char *profile_name = NULL;
        profile_t *profile = NULL;
        recognizer_data_t *r = NULL;
 
@@ -2532,8 +2532,14 @@ static switch_status_t recog_asr_open(switch_asr_handle_t *ah, const char *codec
        switch_core_hash_init(&r->grammars, ah->memory_pool); 
 
        /* try to open an MRCP channel */
-       profile_name = switch_strlen_zero(dest) ? globals.unimrcp_default_recog_profile : dest;
+       if (!(profile_name = dest)) {
+               if (!(profile_name = ah->param)) {
+                       profile_name = globals.unimrcp_default_recog_profile;
+               }
+       }
+
        profile = (profile_t *)switch_core_hash_find(globals.profiles, profile_name);
+
        if (!profile) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "(%s) Can't find profile, %s\n", name, profile_name);
                status = SWITCH_STATUS_FALSE;
index 4f851c6fd54e4df25328ab5b86fbaadc14ed6ac1..75e0ba1e68e59d402e5a9dd064b5deb8275414ef 100644 (file)
@@ -44,9 +44,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
        char buf[256] = "";
        char *param = NULL;
 
-       if (strchr(module_name, '@')) {
+       if (strchr(module_name, ':')) {
                switch_set_string(buf, module_name);
-               if ((param = strchr(buf, '@'))) {
+               if ((param = strchr(buf, ':'))) {
                        *param++ = '\0';
                        module_name = buf;
                }