DialogDesigner 50 Sample Applications.docx
《DialogDesigner 50 Sample Applications.docx》由会员分享,可在线阅读,更多相关《DialogDesigner 50 Sample Applications.docx(17页珍藏版)》请在冰点文库上搜索。
DialogDesigner50SampleApplications
DialogDesigner
SampleApplications
Version5.0
Disclaimer
ThesampleapplicationsreleasedwithDialogDesignerareintendedtodemonstratespecificfunctionsortechnologies.Whilesomeapplicationswillrun“out-of-the-box”withtheDialogDesignersimulationvoicebrowseroronavoiceplatform(AvayaIRorAvayaVoicePortal),theseapplicationsarenotguaranteedtorunwithouttheproperhardwareandtelephonysetup.Theseexamplesareintendedtobeusedastechnicalsamplesforreferenceonly,andnotproduction-readyapplications.
AdditionalsampleapplicationsarealsoavailableontheAvayaDevConnectportal.
Installationinstructions
1)InEclipse,makesurethattheTomcathomepropertyhasbeensetintheEclipsepreferences:
WindowàPreferencesàTomcat.BrowsefortherootdirectorywhereyouinstalledTomcat(i.e.C:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.5,etc.).
2)LocatethesampleDD__SampleApplications.zipandusingWinZIP(orsomeothercompressedfileextractionutility)unzipto,whereistheDialogDesignerreleaseversion(e.g.5.0)andisthebasedirectoryofyourEclipseinstallation.(Note:
ThesampleapplicationZIPfileisdistributedontheDialogDesignerreleaseCD,sobrowsetolocatethefile.Thesampleapplicationsmayalsobedownloadedfrom).
3)UsingEclipse,importtheapplicationsintoyourEclipseworkspace.UseFileàImportàExistingProjectintoWorkspacetoselectoneormoreproject(s)andimportitintotheEclipseenvironment.(Note:
Thisassumesthatyourworkspaceisconfiguredtobe/workspace.IfyouhaveconfiguredyourEclipseenvironmenttouseaworkspaceinadifferentlocation,youwillhavetomanuallymovethesampleapplicationprojectstoyourworkspacelocation).
NOTE:
ToreducethesizeofthesampleapplicationZIPfile,thesampleapplicationsaredistributedwithoutthescert.jarfile.WhentheapplicationsareimportedintoDialogDesigner,itwillpromptyoutoupdatetheruntimelibraries,whichwillcopythescert.jarintotheproject.
Sampleapplications
ThefollowingsampleapplicationsandmoduleshavebeenprovidedwithDialogDesigner:
∙ArrayExample
∙BloominBloomsLite
∙ConverseExample2
∙ConverseStep
∙DDIceCreamStore
∙DTMFToneMask
∙DynamicPhraseLoading
∙Events
∙GoogleWebservice1
∙InBandTonePulse
∙LexingtonLegends(requiresmodules:
StadiumDirections&CollectTicketInfo)
∙MultilingualHelloWorld
∙MyCreditCard
∙MyMathQuiz
∙MyTreasureMap
∙MyTroubleDesk
∙NBestExample
∙RecordMessage
∙RecordMessageOSDM
∙Spelling
∙StockAndWeatherAudio
∙TASExample
∙UserDefinedVXML
∙VoiceThermostat
MultilingualHelloWorld
Thisapplicationisthebasic“HelloWorld”withafewaddedenhancements.Afterthelanguagemenu,theapplicationsayshellotothecallerandpromptsthecallerforagreetingresponse.Aftercollectingthecaller’sresponse,theapplicationrepeatsthecaller’sutterance.Thentheapplicationasksiftheuserwantstogothroughtheapplicationagain.Ifcallerrespondswithanaffirmativeresponse,thentheappgoesbacktothelanguagemenutorepeat.ThislanguagesupportsEnglish&Spanishpromptsandgrammars.Onethingtonoteisthe“GoAgain”nodeusesamultilingualgrammarforyes/noinputandtheSpanishandEnglishgrammaritemsuse“true”and“false”forthetagvalueswhichallowsthecallflowtobranchbasedontheuserinputinterpretationratherthantheutterance(“yes”isdifferentfrom“si”,etc.).Oneothernote,ifyouarerunningthisapplicationonMicrosoftASR/TTS,theSpanishsupportisbarelyfunctional,sodonotexpectverysuccessfulrecognitionsandtheTTSiscomical.ThemorerecentMicrosoftSpeechpackage(6.0)maytreatthisbetter,orifaSpanishTTS/ASRenginehasbeeninstalled,youmayhavebetterTTS/ASRexperiences.(Configurationnote:
ifyoudohaveaSpanishTTSengineinstalled,youwillhavetoconfiguretheprojectsothatitemitstheSpanishTTSlanguagetagintheVXMLsotheSpanishTTSengineisloadedatruntime.RefertotheDialogDesignerhelpcontentsforinformationonconfiguringlanguagesintheworkspaceandconfiguringlanguagesforaproject).
RecordMessage
ThisisasimpleapplicationthatdemonstrateshowaRecorditemcanbeusedtoletacallerleaveamessage,listentothemessage,re-record,etc.ThisapplicationcanalsobereusedasamodulebecauseitreturnstheURLtotherecordedaudiofileasanoutputparameterfromthemodule.
RecordMessageOSDM
ThisapplicationisidenticaltoRecordMessageexceptitusestheRecordOSDMfromNuance.Inordertorunthisapplication,youmusthavepurchasedtheOSDMsNuance.AfteryouhaveinstalledandconfiguredtheOSDMsforthevoiceplatform,importtheOSDMsintoDialogDesignerinordertobuildRecordMessageOSDM.
NOTE:
AvayadoesnotprovideconfigurationortroubleshootingsupportforOSDMs.OSDMsmustbeconfiguredpriortoattemptingtousewithDialogDesigner.
Events
Thisapplicationdemonstrateseventhandlingaswellasevent-drivencallcontrol.ThereisaneventhandleronAppRootforthecustomeventtype“MyEvent”.ApromptandcollectnodecatchestheNoInput/NoMatchevents,playsapromptandthenthrowsa“MyEvent”.ThethirdtimetheMyEventiscaught,thecallisroutedtoadifferentdisconnectnodeandthecallends.ImportantthingstonotearetheuseofpromptlevelsontheME.promptandME3.prompt.
ArrayExample
OneofthefeaturesofDialogDesigneristheabilitytotreatruntimevariablesasacollection(orcanbethoughtofasanarray).Collectionsareusefulwhenworkingwithresultsfromdatabasequeries,webservicecalls,oriftheASRenginereturnsmorethanonerecognitionresult(seeNBestExample).ThisapplicationdemonstratesworkingwiththecollectionAPItopopulateacollectionvariablefromboththeGUIandfromJavacode.
TASExample
ThisapplicationdemonstratesinvokingaTASscriptviatheVXMLObjecttag.UsingtheVXMLObjecttagtoinvokeTASscriptsisanimportantwaytoleverageexistingand/orlegacyscriptsonanIRplatform.Thisexampleinvokesthe“avftst”TASscript.ForadditionalinformationoninvokingTASscriptsonIRusingtheVXMLObjecttag,refertoIR/TASdocumentation(HelpàApplicationdevelopmentàAdvancedapplicationdevelopmentàUsingVoiceXMLàCreatingaVoiceXMLapplicationàUsingtheVoiceXML
TASapplicationsarenotcompatiblewithVoicePortal,sothisexampleisforIRonly.Additionally,simulationoftheobjecttagandTASscriptsarenotsupported.
NBestExample
ThisapplicationdemonstrateshowtohandlemorethanoneresultfromanASRengine.Whilethisapplicationsimplyreadsalloftheresults,anotherusecouldbetoiterateovertheresultandgivethecallerachancetoacceptoneoftheresponses(i.e.“callbillsmith”mayreturn“willsmith”and“billsmith”—youcouldgivethecallerachancetoacceptoneoftheresponses).IfyouareusingtheMicrosoftASRengine,n-bestisnotsupportedsoyoucan’tusespeech,butyoucansimulaten-bestbytypingintheASRrecognitionandconfidencevalues(commaseparated)andusingtheSendASRbutton.Forexample:
UserDefinedVXML
ThisapplicationusestheVXMLServletnodetosupportcustomVXML.Whilethisjustplaysatext-to-speechprompt,thisnodecouldbeusedtodomoreadvancedVXML.
InBandTonePulse
ThisapplicationdemonstratesplayingDTMFtonesfromaVXMLpage.ItusesthenewPhraseVariabletype“DTMFTones”toconvertthevalueofthevariableintothecorrespondingDTMFkey.TheDTMFtonesthatareplayedare50msDTMFtonepulsesfollowedby50msofsilence.ThistypeofapplicationmaybeusefulinsomeinstanceswhereatelephonysystemrequirestheapplicationtopulseDTMFtonesinband(suchasforatransfer,etc.).
NOTE:
PlayingtheDTMFtonesinbandmaynotworkforalltelephonyconfigurations.ItisrecommendedthatyouvalidatethefunctionalitywithyourIVRplatformandswitch.ThisisjustanexampleofhowtonescouldbeplayedinaVXMLapplicationandhasnoguarantees.
DynamicPhraseLoading
Thisisasimpleapplicationthatdemonstratesloadingandplayingdynamicphrases(pre-recordedaudio)atruntime.TheDialogDesignerruntimeframeworkprovidesAPIthatallowsanapplicationtooverridethelocationofanaudiofilesuchthatitmaybelocatedoutsideoftheprojectorevenonadifferentapplicationserver(i.e.anHTTP-enabledmediaserver).ThissampledemonstratesusingtheAPItoloadaudiofilesfromadifferentdirectorywithintheproject;thecallerispromptedforaphrasenumber(1-4)andbasedonthecallerinput,thecorrespondingphrasenumberisloadedfromthe“myphrases”directory.Whiletheapplicationisnotveryexciting,itisasimpledemonstrationofhowdynamicaudiocanbeaddedtoaproject.ThelogicthatisusedtoloadphrasesdynamicallyshouldbereviewedinWEB-INF/src/English/phrasesets/DynamicPhraseset.java.
Spelling
ThisapplicationdemonstratesusingaPhraseVariabletoplayaudiofilesbasedonthevalueofavariable.Thisapplicationactsasaverylimitedlocalizationbundleandwill“spell”individuallettersandnumbersfromavariablevalue.
Theapplicationcontainsaphraseset(spell),whichcontains36phrases(A-Z,0-9).AsimpleJavautilityclasswillparsethevalueofavariableandbuildacollectionvariablethatcontainstheIDsofthephrasestospellthevalue.Forexample:
“Hello123”isparsedintoacollectionofvalues:
[0]=“spell:
h”
[1]=“spell:
e”
[2]=“spell:
l”
…
[7]=“spell:
3”
NOTE:
ThisapplicationisasimpleexampleofonewaytouseaPhraseVariable.Thissampleapplicationisnot