Create your first IVR application using VoicePHP January 18, 2009

In this example, we will show you how easy it is to implement an IVR application using VoicePHP in merely a few lines of code. The code is commented and self explanatory. Leave us a comment if you have any questions.

<?php

// Welcome the user to the world of VoicePHP
echo "This is a demonstration of Voice PHP. 
         You can make calls and send messages right away."
;

// Lets ask him to type in the destination, bargein is enabled
$destination prompt("Dial the destination phone number"1);

echo 
"You dialed,  $destination";

// Get user's input. Note that bargein is disabled
$action prompt("Press 1 to send a message, 2 to make a call or 3 to exit");

switch (
$action) {
    case 
1:
        echo 
"I am sending a message to, $destination";
        
sms($destination,"From VoicePHP(http://voicephp.com) demo");
        break;
        
    case 
2:
        echo 
"I am transfering you to, $destination";
        
transfer($destination0''10);
        break;
        
    case 
3:
        break;
        
    default:
        echo 
"$action is not a valid option.";
        break;
}
echo 
"Good bye, Thank you for trying Voice PHP";
?>

Download source code

Try It Now!

Click the button below or call +15672449239 to run the application.

Does'nt it look easy? Try VoicePHP for yourself and feel free to modify the above script. VoicePHP is easy and accessible from your free TringMe account. More details at http://voicephp.com/howitworks.html

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

2 Comments so far
  1. Ricardo Saavedra January 20, 2009 4:13 pm

    How can I transfer the call to Gtalk? How can I transfer the call to my extension on my trixbox server?

  2. Nirmal Natarajan February 3, 2009 7:59 pm

    How do I get the flash widget used in this page?

© Copyright TringMe., All rights reserved. - Blog powered by Wordpress - Designed by Speckyboy