Twilio浏览器调用在POST中发送错误的呼叫Sid

时间:2018-04-16 21:08:24

标签: twilio twilio-api twilio-php

我已设置浏览器调用,在我的TwiML应用程序中,设置Status CallBack网址。 Twilio以格式

发布状态
array (
  'ApiVersion' => '2010-04-01',
  'Called' => NULL,
  'CallStatus' => 'completed',
  'Duration' => '1',
  'From' => 'client:browser',
  'CallDuration' => '13',
  'Direction' => 'inbound',
  'Timestamp' => 'Mon, 16 Apr 2018 19:35:26 +0000',
  'AccountSid' => 'asdasdasdadasdasdasdasdasdasdas',
  'CallbackSource' => 'call-progress-events',
  'ApplicationSid' => 'rwerwerwerwewewewewwrwe',
  'Caller' => 'client:browser',
  'SequenceNumber' => '0',
  'To' => NULL,
  'CallSid' => 'CA9c6408108969fsf6f1c53396003d931',
)  

我正在尝试接听电话,来自和其他细节。我做的是

$callsid = $_POST['CallSid'];
$call = $client->calls($callsid)->fetch();

但它每次都失败了。当我在仪表板上检查CallSod时,它与他们在webhook中发送的内容不同。

我有什么遗失的吗?

1 个答案:

答案 0 :(得分:2)

解决了它。我需要获取Child Call SID来获取该信息。

$call = $client->calls->read(
    array("ParentCallSid" => $callsid )
);