From: johny j. <joh...@gm...> - 2010-01-09 21:37:43
|
Thank you for your answer! I've got two major difficulties, one with adding action to recognizing words which match the grammar and the other with running Parrot from softphone. Please, answer at least first of these two. ---------------------------------------------------- May you tell me, please, how to add action to Parrot if the {WEATHER} is recognized? I'd like the application to respond with wav file and to follow some java code (e.g. write to file; in my case it would be calculating sum and playing either 1.wav or 2.wav). I guess there must be change to both Parrot.java and parrot.vxml. For example to parrot.vxml (perhaps it is not good way) - to answer the action with wav file: <filled> <prompt> <value expr="main"/> </prompt> <if cond="main=='weather'"> //NEW CODE BEGINS HERE <block> <audio src="weather_wav_file_URL"/> </block> </if> //NEW CODE ENDS HERE <if cond="main=='quit'"> <exit/> <else/> <clear namelist="main"/> <reprompt/> </if> </filled> And Parrot.java - to add some action with java code, e.g. writing to file: if ((rule.getTag().equals("QUIT")) && (rule.getRule().equals("main"))) { //... } if ((rule.getTag().equals("WEATHER")) && (rule.getRule().equals("main"))) { //here e.g. I perform calculations - according to their result I'd like the application to say either "control sum correct" or "control sum incorrect" - wav answer is DEPENDENT ON CALCULATIONS, not only on recognized word (which is the case of using vxml file)!!! how to specify playing either 1.wav or 2.wav here ?!?!? } Some additional, minor, questions: 1. I don't get why in parrot.vxml there is "Would you like to hear the weather, get sports news or hear a stock quote?" if the parrot application is about repeating what somebody says. 2. Why is there ~/cairo/zanzibar-0.1-src/src/resources/prompts/parrot.wav if this wav is never used? ---------------------------------------------------- May you also help me to run this Parrot from softphone, please? 1. I extracted zanzibar-0.1-bin.tar.bz2 to /home/mainaccount/cairo/zanzibar-0.1-bin. Later I did all the stuff connected with global variables for Java, extracting JSAPI etc. 2. I run /home/mainaccount/cairo/zanzibar-0.1-bin/bin/rserver.sh from Terminal. (There was error in sh file - I had to change from \ to / because it couldn't find launch.sh). 3. I copy config directory from ~/cairo/zanzibar-0.1-bin to ~/cairo/zanzibar-0.1-bin/bin because one of those three sh couldn't find config directory. 4. OK, all three sh files from ~/cairo/zanzibar-0.1-bin/bin/cairo and also ~/cairo/zanzibar-0.1-bin/bin/zanzibar/asteriskConnector.sh are running. 5. I add to sip.conf: [Zanzibar] type=peer host=localhost //I wasn't sure what to write here port=5090 dtmfmode=info canreinvite=no 6. I add to extensions.conf at the end of [mainmenu] section (is it proper place?): exten => 1,n,SIPAddHeader(x-channel:${CHANNEL}) exten => 1,n,SIPAddHeader(x-application:basic|org.speechforge.apps.demos.Parrot) exten => 1,n,Dial(SIP/Zanzibar) 7. I add to /etc/asterisk/manager.conf at the end of file: [twinkle] secret=password permit=0.0.0.0/0.0.0.0 read=system,call,log,verbose,agent,command,user write=system,call,log,verbose,agent,command,user 8. I cannot find context.xml file to do what is written here http://www.spokentech.org/openivr/aik.html 9. I run 'asterisk' in Terminal 10. I run 'twinkle'. I choos profile: 'twinkle', SIP service provider: 'None (direct IP to IP calls), username: twinkle, domain: localhost, system settings -> network -> SIP port: 5061. I write in call: '1000@127.0.0.1'. It connects me to "Congratulations. You have successfully installed and executed the Asterisk open source". So I can connect to Asterisk but cannot connect to Parrot demo. I guess the call is improper but there also may be something wrong with configurations above. Regards! PS > Are your acoustic models in jar files? Yes, it contains two directories (etc and model_parameters) without loaders (it needs sphinx3 loader to be specified in xml). |