Adhearsion + Unimrcp + ASR

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Adhearsion + Unimrcp + ASR

johnogara
This post has NOT been accepted by the mailing list yet.
Hello All,
   I'm using adhearsion (1.2) with unimrcp (1.0) and an ASR engine and for the most part everything works fine (my asterisk version is 1.6.2).
My problem is with using ReadFile to assign an asterisk variable in one command and then to access it in the next, code snippet is below

@call.execute("ReadFile", "URI_LIST=#{options[:grammar_file_location]}#{@sep}#{File.size(options[:grammar_file_location])}")
@call.execute("MRCPRecog", "${URI_LIST}#{@sep}f=#{background}&nb=#{options[:nbest]}&sit=false&p=default&b=1&t=#{options[:timeout] * 1000}&sl=.8&sct=500&sint=800&nit=#{options[:timeout] * 1000}&i=none")

In the first line I'm reading contents of the grammar file (its actually a list of grammar locations) into the URI_LIST variable and in the second I'm attempting to use this variable as a parameter to the my MRCPRecog command, unfortunately the variable is always blank.
I have tried reading the file contents into a var on the ahn side and passing it to the MRCPRecog cammon like my other vars (options[:timeout] etc.) but this doesn't work as there are newline characters in the file contents which result in the rest of the params not being passed at all.
I've tried this exact sequence of commands in my dialplan and they work fine.
Any help much appreciated
John