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 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程