dongmao9217 2017-11-06 09:15 采纳率: 100%
浏览 56
已采纳

状态回叫不在twilio中工作

Iam using twilio Programmable voice while trying to Tracking the call status of an outbound call and save it log whether the user answer or cut the call ,but the problem i didn't get any log and while checking in twilio debugger it showing error:15003

Here my Code:

<?php   
  require_once "vendor/autoload.php";
     use Twilio\Rest\Client;
    $AccountSid= 'AC04421826f5ffaa58eaefa1ba6984dac2';
    $AuthToken= 'token';
    $client = new Client($AccountSid, $AuthToken);
    try {
        $call = $client->account->calls->create(         
            // to call.
            "+9120000000",
            "+1209000001",
            array(
              "url" => "http://demo.twilio.com/docs/voice.xml",
              "method" => "GET",
              "statusCallbackMethod" => "POST",
              "statusCallback" => "localhost/twilio/log.txt",
              "statusCallbackEvent" => array(
                  "initiated", "ringing", "answered", "completed"
              )
          )
        );
        echo "Started call: " . $call->sid;
    } catch (Exception $e) {
        echo "Error: " . $e->getMessage();
    }
  • 写回答

2条回答 默认 最新

  • douweng7083 2017-11-06 17:33
    关注

    Twilio evangelist here.

    Looks like you have set the statuscallback property to point to localhost.

    localhost is a domain that is only reachable from your own local machine so Twilio does not how to reach the localhost running on your local machine.

    I'd suggest checking out ngrok which is a simple tool that lets you expose the web server running on your local machine via a publicly addressable domain.

    Hope that helps

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 综合布线实例设计,就好看好看不恐怖可好滤镜好聚
  • ¥15 使用moviepy库视频合并时出错
  • ¥30 FLUENT液固传质UDF
  • ¥15 怎么看梯度直方图以,怎么判断梯度消失/爆炸,怎么解决
  • ¥15 aspnetdll文件访问拒绝
  • ¥15 wpf中在模版中寻找元素
  • ¥15 MFC平台生成指定圆
  • ¥15 jmeter出现403
  • ¥500 求华为P30PRO手机硬盘数据恢复
  • ¥15 关于#vscode#的问题:ESP32开发板对接MQTT实现小灯泡的开关