
The LumenVox Pizza Demo assumes you have some knowledge of working with the Asterisk Dial Plan. The Asterisk Web site contains more information about working with extensions.conf and the Dial Plan.
You will need the LumenVox Speech Engine for Asterisk installed in order to use the demo application.
;This is the entry point for the pizza demo IVR
;To open a port the the Speech Engine you need
;to do a SpeechCreate first before you can do any
;of the other Speech applications
[pizza]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,SpeechCreate
exten => s,4,Goto(order-pizza,s,1)
[order-pizza]
exten => s,1,Playback(GP-Greeting)
;The THRESHOLD is a value compared to the
;SPEECH_SCORE(x), which is the confidence score
;returned by the Speech Engine.
exten => s,2,Set(THRESHOLD=500)
exten => s,3,Goto(pizza-delivery,s,1)
;This context will get whether the caller
;requests delivery or takeout [pizza-delivery]
exten => s,1,SpeechActivateGrammar(order)
exten => s,2,SpeechStart
exten => s,3,SpeechBackground(GP-DeliveryorTakeout)
;If there are no results (no input) then we re-prompt them.
exten => s,4,GotoIf($["${SPEECH(results)}" = "0"]?5:7)
exten => s,5,Playback(GP-NoDeliveryorTake-out)
exten => s,6,Goto(2)
exten => s,7,Set(TEXT=${SPEECH_TEXT(0)})
;If the confidence score is below the threshold then we confirm the intent
;of the spoken phrase.
exten => s,8,Gotoif($[ "${SPEECH_SCORE(0)}" > "${THRESHOLD}" ]?12:9)
exten => s,9,Macro(speech-confirm,${SPEECH_TEXT(0)})
exten => s,10,GotoIf($["${CONFIRM}" = "no"]?3:11)
exten => s,11,Noop(speech_score=${SPEECH_SCORE(0)})
;If the intent has been confirmed then the type of order is fixed
exten => s,12,Set(TYPE_OF_ORDER=${TEXT})
exten => s,13,SpeechDeactivateGrammar(order)
exten => s,14,Noop
exten => s,15,GotoIf($["${ARSO}" = "1"]?16:17)
exten => s,16,Goto(confirm-order,s,1)
exten => s,17,Goto(pizza-size,s,1)