The dialplan is the routing core of an Asterisk server. Its sole role is to look at what is dialed, and route the call to its destination. This is the core of any telephony system and Asterisk is no different. VXI* VoiceXML browser for Asterisk provide to the PBX a new function called vxml() to extend your favorite telephony system with VoiceXML 2.0+ execution. VXI* provide dynamic XML programming services thru HTTP / HTTPS and using PHP, ASP, JSP, PERL, Python, CGI, C#, etc… to create and run advanced web enabled speech applications on your Asterisk.
The dialplan is made up of three elements: extensions, contexts, and priorities. An extension is number or pattern that the dialed number is to be matched against and a context is a collection of extensions (and possibly other included contexts too).
Configuration files:
- Dialplan location: /etc/asterisk/extensions.conf
- VoiceXML account location: /etc/asterisk/vxml.conf
Example 1: Direct mode
You can connect a VXML service using the vxml() function anywhere in the diaplan structure.
extensions.conf
;
[global]
URL=http://localhost/vxml/portalvideo/index.vxml
[default]
; Demo
exten => 34919562000,1,Answer
exten => 34919562000,2,Vxml(${URL})
exten => 34919562000,3,Hangup
Example 2: VXML Account mode
Using a VXML account, you can manage better and configure different parameters you want to assign to your service (example: portalvideo).
extensions.conf
...
[default]
; Demo
exten => 34919562000,1,Answer
exten => 34919562000,2,Vxml(portalvideo)
exten => 34919562000,3,Hangup
vxml.conf
...
[account5]
name=portalvideo
number= 34919562000
url=http://localhost/vxml/portalvideo/index.vxml
max=10
speech=no
dialformat=SIP/%s
dialformatvideo=SIP/%s
...