0
因此,我正在尝试接收传入的短信,并根据短信所说的与特定录音进行通话。如何根据短信提示发短信并拨打电话提醒某人?
例如:
我有一个调制解调器门传感器可以将文本发送到我的twilio#当门被打开时,或者当门关闭。
如果Twilio收到“门打开”文本,然后twilio会打我手机,并播放录像,上面写着“大门是敞开的”
如果Twilio收到“门关闭”文本,然后twilio会打我手机和戏剧记录,上面写着“门关闭”
<?php
require_once('/home/protranx/public_html/twilio-php- latest/Services/Twilio.php');
$sid = "SID";
$token = "Token";
$client = new Services_Twilio($sid, $token);
$alert = $_REQUEST['body'];
$TwilioNumber = "+twilio #";
$to = "+my cell #";
$url1 = "http://protran.x10.mx/Oak1_armed_door_open.php";
$url2 = "http://protran.x10.mx/Oak1_disarmed_door_closed.php";
$string1 = "door open";
$string2 = "door closed";
if ($alert == $string1){
$call = $client->account->calls->create($TwilioNumber, $to, $url1);}
elseif ($alert == $string2){
$call = $client->account->calls->create($TwilioNumber, $to, $url2);}
echo $call->sid;
header('content-type: text/xml');
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
</Response>
我不断收到此错误: 错误:12100 - 文档解析失败
任何帮助将不胜感激。
谢谢
如何阅读twillio文档:http://www.twilio.com/docs/errors/12100 – 2014-01-15 20:47:53
我做到了。没有多大帮助。如果您能指出该文档的哪一部分能够帮助我感谢它。 – user3199770