Auto-Attendant: We've already covered a powerful auto attendant script in 5 lines of code. You could answer a call, play your company's jingle, announce your company's name, prompt the caller to press 1 or say Sales and ultimately transfer the call to the operator by returning the following XML to Teleku.
http://acme.com/jingle.mp3 Thanks for calling Acme Labs. Press 1 or say sales to be transferred to Sales or press 2 or say support to be transferred to Technical Support otherwise stay on the call to speak with our Operator http://acme.com/transferTransferring to Operator 602-555-1234
The JSON equivalent response to the script above would look like the following:
{"phoneml":[{"play":{"$":"http://acme.com/jingle.mp3"}}, {"speak":{"$":"Thanks for calling Acme Labs. Press 1 or say sales..."}}, {"input":{"$":"http://acme.com/transfer","@options":"1,2,sales,support"}}, {"speak":{"$":"Transferring to Operator"}}, {"transfer":{"$":"602-555-1234"}}]}
Listed below are a few more simple PhoneML example applications:
VoiceMail Recording: Instruct caller to leave a message after the beep and submit voice message to web server for further processing.
Thanks for calling Acme Labs. No one is available to answer your call at the moment. Please leave your name and number after the beep and we'll return your call. http://acme.com/uploadvmail.php
High-Low Game: Inform the caller of the number selected by the dealer and ask them to indicate if the next random number selected by the dealer will be higher or lower. The speech recognition response will be submitted to the web server for further processing. If the caller says something other than higher or lower, they will be reprompted. If nothing is heard, the system will thank them for calling and hangup. The <hangup> tag is not necessary at this point since no further instruction is provided. You could also add a <goto> tag after the input option to redirect the call to another prompt to handle no input or back to the same script to select a new random number and ask them to make a selection again.
Check out this complete Ruby/Sinatra High/Low voice application source code or the Python High/Low voice application source code!
The dealer has randomly selected number 5. Will the next number be higher or lower? http://acme.com/highlowNothing heard. Thanks for playing
The JSON equivalent response to the script above would look like the following:
{"phoneml":[{"speak":{"$":"The dealer has randomly selected number 5...?"}}, {"input":{"$":"http://acme.com/highlow","@options":"higher,lower"}}, {"speak":{"$":"Nothing heard. Thanks for playing"}}, {"hangup":{}}]}
Note: There is a super handy JSON validator available at http://jsonformatter.curiousconcept.com.
HighLow - Ruby Sinatra PhoneML Game - Deployed on Heroku
HighLow - Python PhoneML Game - Deployed on Google AppEngine
Copyright © 2010 - All Rights Reserved - GetVocal, inc. - Trademarks belong to their respective companies
Template by OS Templates & Artwork by Sumo Web Works