Page 1 of 2
Newbie - scratchpad
Posted: Sat Dec 30, 2006 9:10 am
by peterj@skipzone.co.uk
Hi Plum 'Tree',
I am just getting started. I have made a scratchpad with a voiceXML script in it. But when I dial my number it says there are no scripts enabled on this number.
Can you nudge me in the right direction.
Thanks - Pete
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<block>
<prompt>
Welcome to our new SKIPZONE TEST SYSTEM.
</prompt>
</block>
</form>
</vxml>[/code]
After call is in, IVR app for that phone number is executed
Posted: Tue Jan 02, 2007 3:20 pm
by support
Hello,
After creating your Scratchpad you must then assign it to a DNIS. This can be done by going to the "Application Setup" page, and clicking "E" to edit one of your DNISs. You should then select the scratchpad you have created for that DNIS and click "Commit".
Plum IVR Hosting allows you to assign either a URL or a simple scratchpad to your DNIS(s). When an IVR call comes in on your phone number, the IVR application for that phone number (DNIS) is executed.
Regards,
Plum Support
Started
Posted: Mon Jan 08, 2007 1:14 pm
by peterj@skipzone.co.uk
Great! Thanks! Now it works.
Now I need it to send me an email eveytime i call the test number.
Can you give me an example script.
I am sure this test will lead to something usfeful for my clients.
Regards
no way to send email using IVR scripts written on scratchpad
Posted: Mon Jan 08, 2007 4:03 pm
by support
Hi,
Unfortunately, there is no way to send emails using IVR scripts written in the scratchpad.
Instead, you will need to run/host your VoiceXML script on an IVR server with a scripting language (e.g. PHP, ASP) that has some sort of built-in mail commands.
Regards,
Plum Support
Started + email
Posted: Tue Jan 09, 2007 12:27 pm
by peterj@skipzone.co.uk
Would it be possble to give an example of some .php ?
Then I could modify it and put it on my website.
just needs to send me an email when for example the IVR returns caller to 'sales' dept.
Many thanks
IVR script using PHP mail function
Posted: Tue Jan 09, 2007 12:45 pm
by support
Hi,
For further info on the PHP mail function to use with your IVR script, we recommend looking here:
http://us3.php.net/manual/en/ref.mail.php.
Regards,
Plum Support
from scratchpad to URL
Posted: Wed Jan 10, 2007 9:23 am
by peterj@skipzone.co.uk
When I moved my demo script from scratchpad to my web site. It locates the file on the URL but then it says
VoiceXML Validator:
File:
http://www.skipzone.co.uk/skipzoneIVRtest.php
Validation Results:
Fatal Error at line 1, char 1
Message: Expected comment or processing instruction
I have searched the forum for clues and example codes but have found none.
Many thanks for your help.... I know it probably is a bit remedial! But I like to have a go at these things before I have to pay an experienced programmer to sort it all out.
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>skipzoneIVRtest</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
</html>
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<block>
<prompt>
Welcome to Skipzone Test Portals.
</prompt>
<goto next="#mainmenu"/>
</block>
</form>
<menu id="mainmenu">
<prompt>
Please choose a department:
<enumerate/>
</prompt>
<choice dtmf="1" next="#sales">
Sales</choice>
<choice dtmf="2" next="#support">
Tech Support</choice>
<choice dtmf="3" next="#directory">
Company Directory</choice>
</menu>
<form id="sales">
<block>
Please hold for the next available sales
representative.
<!-- transfer to sales -->
</block>
</form>
<form id="support">
<block>
<?php
$headers = "From: \"Me\"<pete@lt-holdings.co.uk>k>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
mail('first@lt-holdings.co.uk', "hello", $headers);
?>
<!-- transfer to tech support -->
</block>
</form>
<form id="directory">
<block>
<!-- transfer to company directory -->
</block>
</form>
</vxml>
IVR script change
Posted: Wed Jan 10, 2007 10:35 am
by support
Hi,
You can't mix html code/tags with your VoiceXML. If you remove everything up to and including the "</html>" from your IVR script, you should be OK. Also, make sure there is no whitespace before the "<?xml version="1.0"?>".
Regards,
Plum Support
Posted: Wed Jan 10, 2007 12:29 pm
by peterj@skipzone.co.uk
Removed html and spaces.
File:
http://www.skipzone.co.uk/skipzoneIVRtest.php
Validation Results:
Fatal Error at line 1, char 1
Message: Expected comment or processing instruction
Is it because I have called the file .php which is what Dreamweaver saves?
Does my server have to support any special protocols?
Thanks Pete
IVR code change due to PHP confusion
Posted: Wed Jan 10, 2007 12:51 pm
by support
Hi,
Because the PHP processing instructions and the xml prolog (<?xml version="1.0"?>) use the same escape characters, PHP is getting confused. So you need to change your first line of IVR code to look like this:
<?php echo "<?xml version=\"1.0\"?>" ?>
Regards,
Plum Support
Posted: Wed Jan 10, 2007 1:21 pm
by peterj@skipzone.co.uk
Great! works! That was the easy bit! I'll be back in a few weeks with some more questions!
choose the language
Posted: Sun Jan 21, 2007 5:13 pm
by peterj@skipzone.co.uk
I have been experimenting.... In this example the caller chooses French, German or English. I then want the subject of the email to be the relevant language.
How do I make $language = the choice?
I can't seem to write any values within the vxml portion of the script.
Many thanks for your help.
Code: Select all
<?php echo "<?xml version=\"1.0\"?>" ?>
<vxml version="2.0">
<form>
<block>
<prompt>
Welcome to Skipzone Test Portals.
</prompt>
<goto next="#mainmenu"/>
</block>
</form>
<menu id="mainmenu">
<prompt>
Please choose a language:
<enumerate/>
</prompt>
<choice dtmf="1" next="#sales">
french</choice>
<choice dtmf="2" next="#support">
german</choice>
<choice dtmf="3" next="#directory">
english</choice>
</menu>
<form id="sales">
<block>
Please hold for the next available french sales
representative.
<!-- transfer to sales -->
</block>
</form>
<form id="support">
<block>
Please hold for the next available german sales
representative.
<!-- transfer to tech support -->
</block>
</form>
<form id="directory">
<block>
Please hold for the next available english sales
representative.
<!-- transfer to company directory -->
</block>
</form>
<?php
mail('first@lt-holdings.co.uk', "sales language", $choice);
?>
</vxml>
IVR example that collects language and submits to PHP script
Posted: Sun Jan 21, 2007 10:31 pm
by support
Hello,
If you want your PHP script to get access to the selections users make in the VoiceXML dialog you will have to collect the information and then submit it to your PHP.
When data is collected in VXML it is stored in a Javscript variable, that variable can then be submitted to an IVR application server and processed using a scripting language. In your case this would be your Apache/PHP server. A simple IVR example that collects the language and then
submits it to your PHP script would be:
page1.php
Code: Select all
<?php echo "<?xml version=\"1.0\"?>" ?>
<vxml version="2.0">
<form>
<block>
<prompt>
Welcome to Skipzone Test Portals.
</prompt>
</block>
<field name="language">
<prompt>
Please choose a language: French, German, English.
</prompt>
<grammar type="application/srgs+xml" version="1.0" root="language" mode="voice">
<rule id="language">
<one-of>
<item>french</item>
<item>german</item>
<item>english</item>
</one-of>
</rule>
</grammar>
<filled>
<submit next="page2.php" method="post" namelist="language"/>
</filled>
</field>
</form>
</vxml>
page2.php
Code: Select all
<?php
mail('first@lt-holdings.co.uk', "sales language", $language);
echo "<?xml version=\"1.0\"?>"
?>
<vxml version="2.0">
<form>
<block>
<prompt>
Please hold for the next available <?php echo($language);?> sales representative.
<!-- transfer to sales -->
</prompt>
</block>
</form>
</vxml>
Passing the collected variable to your PHP page allows you to send the email with dynamic information as well as providing a dynamic prompt.
Regards,
Plum Support
Posted: Mon Jan 22, 2007 7:56 am
by peterj@skipzone.co.uk
Great. Thanks. I understand the principle now.
Posted: Tue Jan 23, 2007 2:21 pm
by peterj@skipzone.co.uk
I am trying to submit the callers phone number. Is it possible like this? There must be more to it?!
Code: Select all
<?php echo "<?xml version=\"1.0\"?>" ?>
<vxml version="2.0">
<form>
<block>
<prompt>
Welcome to Skipzone Test Portals.
</prompt>
</block>
<field name="language">
<prompt>
Please choose a language: French, German, English.
</prompt>
<grammar type="application/srgs+xml" version="1.0" root="language" mode="voice">
<rule id="language">
<one-of>
<item>french</item>
<item>german</item>
<item>english</item>
</one-of>
</rule>
</grammar>
<filled>
<submit next="page2.php" method="post" namelist="language"/>
<submit next="page2.php" method="post" session.telephone.ani ="caller"/>
</filled>
</field>
</form>
</vxml>
Code: Select all
<?php
mail('first@lt-holdings.co.uk', $caller, $language);
echo "<?xml version=\"1.0\"?>"
?>
<vxml version="2.0">
<form>
<block>
<prompt>
Please hold for the next available <?php echo($language);?> sales representative.
<!-- transfer to sales -->
</prompt>
</block>
</form>
</vxml>
Many thanks for your help.