IVR集成使用php


IVR integration using php

是否可以将IVR与PHP集成?有相关的教程或链接吗?

我想要的,当用户拨打某个电话号码,输入预约挂号号和预约日期时,IVR应自动语音向用户响应预约订单和预约状态。

有可能实现与PHP (CodeIgniter)?

谢谢。

点击这个链接,会对你有所帮助https://www.twilio.com/docs/tutorials/walkthrough/ivr-phone-tree/php/laravel

您可以使用PHP与Tropo和任何VoiceXML兼容的IVR。这是一个使用PHP和Voxeo预言IVR平台生成VoiceXML的教程。你可以免费试用Tropo和Prophecy的IVR。

是的,这绝对是可能的。VoiceXML的开发是使用标准的HTTP协议完成的,就像正常的web开发一样,除了PHP脚本生成VoiceXML而不是HTML。您需要编写一个包含所有代码的初始VoiceXML文档来收集他们的注册号和预订日期(使用标记),然后您可以通过HTTP POST(使用标记)将用户输入发送到PHP脚本。PHP脚本访问POST变量,执行预订订单搜索,并在新的VoiceXML文档中输出结果。下面是一个非常简单的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>

使用像CodeIgniter这样的MVC框架稍微需要更多的工作,它需要您将这些脚本分解为一个控制器来处理GET/POST请求和两个视图(一个用于开始页面,一个用于搜索结果页面)。