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 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试