]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
allow space after filename in play_and_detect_speech
authorChristopher Rienzo <chris@rienzo.net>
Wed, 25 Apr 2012 17:58:41 +0000 (17:58 +0000)
committerChristopher Rienzo <chris@rienzo.net>
Wed, 25 Apr 2012 17:58:41 +0000 (17:58 +0000)
src/mod/applications/mod_dptools/mod_dptools.c

index d40e74d017e2b7ab5ba45f2cd3a9a7469e478e3c..3331226e9d8de1176b3267f6a1239c71355f14d1 100755 (executable)
@@ -464,6 +464,7 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function)
        char *lbuf = NULL;
        const char *response = "DONE";
        char *detect = NULL;
+       char *s;
 
        switch_channel_set_variable(channel, "detect_speech_result", "");
 
@@ -474,6 +475,12 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function)
                goto done;
        }
 
+       /* trim any trailing space */
+       s = detect;
+       while (--s >= lbuf && switch_isspace(*s)) {
+               *s = '\0';
+       }
+
        /* split input at "detect:" */
        detect[0] = '\0';
        detect += 7;