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条)

报告相同问题?