Professional Documents
Culture Documents
Clock
Complexity:
Simple
SoftwareUsed:
AudiumBuilderforStudio
YouWillLearnHowTo:
Dynamicallyconfigureavoiceelement UseHotlinkelements
AdvancedTopic:
HowtousetheXMLAPIfordynamicconfiguration
Copyright20012005AudiumCorporation.AllRightsReserved.6/3/05
WhatItDoes
Thisapplicationinformsthecallerthattheycanstartoveratanytimebysayingtheword "home",andthenannouncesthecurrenttimebeforehangingup.Ifthecallersays "home"duringthefirstmessage,thefirstmessagewillberepeated.Ifthecallersaysit duringthetimeannouncement,thecallerwillreturntothefirstmessage(andthenhear thetimeagain).
HowToDoIt
Note!IfthisisyourfirsttimeusingAudiumStudio,pleasereadthetutorialfor
"HelloWorld"beforecontinuing.Inthistutorial,itisassumedthattheuserisfamiliarwith howtocreateanewAudiumStudioproject.
1.CreateanewAudiumproject(withdefaultsettings)named"Clock." 2.DoubleclickonClock'sapp.callflowintheNavigatorpane.Anewworkspaceisnow visible,includingaCallStartelement. 3.DraganAudiovoiceelementintotheworkspace. a.YoucanfindthiselementintheElementspane,directlyunderElements(i.e. notinasubfolder). 4.Nametheelement"Welcome". 5.DraganotherAudiovoiceelementintotheworkspace. 6.Nametheelement"Clock". 7.DragaHangUpelementintotheworkspace. 8.Linkthefollowingexitstates(seediagram1): a.LinkCallStart'sonlyexitstate(next)toWelcome. b.LinkWelcome'sonlyexitstate(done)toClock. c.LinkClock'sonlyexitstate(done)toHangUp. Copyright20012005AudiumCorporation.AllRightsReserved.6/3/05
Note!FormoreinformationabouttheXMLAPI,pleaserefertothe
AdvancedTopicofthistutorialandalsototheProgrammerGuide.
Copyright20012005AudiumCorporation.AllRightsReserved.6/3/05
Diagram2:FinishedsettinguptheDynamicConfiguration Note!YouchecktheCreateBaseConfigurationboxwhenyouknowthatonlysomeof
thesettingswillbedynamic.Youthenconfiguretheelementasyounormallywould. WhentheclassorXMLAPIstartsitswork,itreceivesthisbaseconfiguration,andthen onlymodifiesthosesettingsthataredynamic.Forthistutorial,theTimeOfDayclass configureseverything,soitdoesnotneedabaseconfiguration.
Copyright20012005AudiumCorporation.AllRightsReserved.6/3/05
Note!Usinganinlinegrammarmeansthatyouwilldefinethegrammar(listof
utterances)thatanelementusesdirectlyinAudiumBuilderforStudio.Usinganexternal grammarmeansthatyouwillprovideaURIthatpointstoagrammarfilelocated somewhereelse.Inthistutorial,weareusinganinlinegrammar.
Copyright20012005AudiumCorporation.AllRightsReserved.6/3/05
AdvancedTopic
UsingaJavaclassisnottheonlywaytodynamicallyconfigureavoiceelement,Audium alsogivesyoutheabilitytouseXMLdatasentoveranHTTPconnection(theXMLover HTTPAPI).SincethisinvolvesonlyXML,anyHTTPcompliantlanguagecanbeused (e.g.ASP,Perl,etc.).Inthisexample,aJavaServerPage(JSP)isused. Note!TheXMLoverHTTPAPIisoftenreferredtoastheXMLAPIforshort. WewillmodifytheClockelementtousetheXMLAPIforitsdynamicconfiguration insteadofaJavaclass.
Copyright20012005AudiumCorporation.AllRightsReserved.6/3/05
1.SelecttheClockelement. 2.IntheConfigurationPane,changethesettinginthedropdownmenufromClassto URI. 3.Inthetextfieldtotherightofthedropdownmenu,typethefollowing: http://<AppServerIP>:<PORT>/clock.jsp where<AppServerIP>istheIPthatyourapplicationserverisrunningon,and<PORT> istheportthatyourapplicationserverislisteningto(usually8080). 4.TheJavaServerPageusedbythisapplication(clock.jsp)canbefoundintheprebuilt Clocktutorialapplication.Itisinthesrc\webdirectoryoftheapplication. Note!YoucanviewtheJSPinatexteditortoseehowitworks.Itisessentiallyan
XMLfilethatusessomeJSPcodetofillinthedynamicparts.
Copyright20012005AudiumCorporation.AllRightsReserved.6/3/05