<www.vxml.co.za>





<training>





<voicexml tutorial>















Host Interface Exampe

Example 1

The simplest example is where an application tests the internet connectivity; whether the VXML application is able to reach the internet via a given URL. Should the application reach the internet, the PHP returns VXML to the application, which will be played back.

Should the application not reach the URL, an event "error.badfetch" is thrown, which can be caught and handled.

The PHP code looks as follow:



When viewing it via an Internet Browser, it looks as follow:



The VXML code looks as follow:



Example 2

The following example is a simple hardcoded routine in PHP, and depending on the value sent by the VXML code, a specific value is played to the caller.

The basic PHP code looks as follow:



From the code it is clear that there is only 3 scenarios':

Input: 777 = "Your order $OrderNumber is ready"
Input 888 = "Your order $OrderNumber is not ready yet"
Input 999 = "Your order $OrderNumber has been despatched"


Viewing the code via an Internet Browser, the results will look like this; the URI is also given, where the relevant variable is sent in the URI.
http://www.10.0.0.0/vxml/order_status_AU.php?OrderNumber=777



http://www.10.0.0.0/vxml/order_status_AU.php?OrderNumber=888



http://www.10.0.0.0/vxml/order_status_AU.php?OrderNumber=999



http://www.domain.com/vxml/order_status_AU.php?OrderNumber=???



The VXML code which captures the input from the caller and handles the interaction with the web service looks as follow:



To Search this site click here.

To Get Trained in VoiceXML click here.








Copyright 2009 - Computer Assisted Telephony Systems (Pty) Ltd