3

Is it possible to integrate IVR with PHP ? is there any tutorial or links related to the same?

I want, When a user calls certain phone number and input their booking registration number and booking date, IVR should response the booking order, and status to the user by automatic voice.

Is it possible to implement with PHP (CodeIgniter)?

Thanks.

Prasoon
  • 49
  • 1
  • 5

3 Answers3

2

Check this link, will help you https://www.twilio.com/docs/tutorials/walkthrough/ivr-phone-tree/php/laravel the also have library for codeigniter.

rickyrobinett
  • 1,224
  • 10
  • 13
Ravi Sharma
  • 1,162
  • 3
  • 11
  • 20
1

You can use PHP with Tropo and any VoiceXML compatible IVR. Here is a tutorial for generating VoiceXML using PHP and the Voxeo Prophecy IVR platform. You can try out Tropo and Prophecy IVR's out for free. You only pay if want to put your application into a production environment.

blfbt
  • 40
  • 3
  • 9
Kevin Junghans
  • 17,475
  • 4
  • 45
  • 62
0

Yes, this is definitely possible. Developing for VoiceXML is done using the standard HTTP protocol just like normal web development except your PHP scripts generate VoiceXML instead of HTML. You need to write an initial VoiceXML document with all the code to collect their registration number and booking date (using tags) and then you can send the user input to a PHP script via HTTP POST (using the tag). The PHP script accesses the POST variables, performs the search for a booking order and outputs the result in a new VoiceXML document. Here is a very stripped down example in PHP:

start.xml:
<?xml version="1.0"?>
<vxml version="2.1">
<form>
<field name="registration_number" type="digits">
  <prompt>Please say or enter your booking registration number.</prompt>
</field>
<field name="date" type="date">
  <prompt>Please say or enter your booking date.</prompt>
</field>
<filled>
  <submit next="search.php" method="post" namelist="registration_number date"/>
</filled>
</form>
</vxml>

search.php:
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$booking_details = lookup_booking_order($_POST['registration_number'], $_POST['date']);
?>
<vxml version="2.1">
<form>
<block>
  <prompt><?=htmlspecialchars($booking_details)?></prompt>
</block>
</form>
</vxml>

Using a MVC framework like CodeIgniter is slightly more work, it require you to break out these scripts into a controller to handle the GET/POST requests and two views (one for the start page one for the search result page).