To configure your first VoiceXML application inside Asterisk, just edit your dialpan (extensions.conf):
# cd /etc/asterisk # vi extensions.conf
Add a new extension in your dialplan (/etc/asterisk/extensions.conf ) like:
exten => 888,1,Answer exten => 888,2,Wait(3) exten => 888,3,Vxml(http://vxml.i6net.com/index.vxml) exten => 888,4,Hangup exten => 999,1,Answer exten => 999,2,Wait(3) exten => 999,3,Vxml(file:///tmp/helloworld2.vxml) exten => 999,4,Hangup
Install first demo VoiceXML examples programs in your /tmp directory:
helloworld2.vxml ; 1st program with WAV file access says “Hello World!”
Please ensure you have reloaded your extensions in Asterisk using the prompt command:
*CLI> extensions reload
Call the service by calling :
SIP:888@<your server IP address> SIP:999@<your server IP address>
The best way to manage VoiceXML applications is to use the VoiceXML account configuration.
You can catch the errors generated from the Asterisk Vxml application (error is in the variable VXML_ERROR) to propose an alternative call processing from the Asterisk dialplan.
Example :
exten => _X.,n,Vxml() exten => _X.,n,NoOp(${VXML_ERROR}) exten => _X.,n,GotoIf($["${VXML_ERROR}" == ""]?hangup) exten => _X.,n,Busy() exten => _X.,n(hangup),Hangup()