-3

我想知道如何获取特定电话号码的所有录音。假设我单击电话号码为 423-1234-1323 的页面,我希望能够列出该页面上的所有录音并从该页面播放它们。我该怎么做。我能够获得每一个录音,但不仅仅是我想要的。

$recordings = $client->account->recordings;

foreach ($client->account->calls->getIterator(0, 50, array( 'From' => $phoneNumber )) as $call) {

$recordings = $通话->录音;

$recordings = $recordings->client->last_response->calls;

dd($录音);返回 $recordings; }

- 回报是

Services_Twilio_AutoPagingIterator

{#696 ▼</p>

#generator: array:2 [▶]
#args: null
#items: array:9 [▼

0 => Services_Twilio_Rest_Recording

{#704 ▼</p>

#subresources: array:1 [▶]

+“客户端”:Services_Twilio

{#643}

+"sid": ""

+"account_sid": ""

+“call_sid”:“”

+“持续时间”:“9”

+“创建日期”:“”

+"api_version": "2010-04-01"

+"date_updated": ""

+“状态”:“完成”

+“来源”:空

+“渠道”:1

+“价格”:“-0.00250”

+"price_unit": "美元"

+"uri": "/2010-04-01/Accounts//Recordings/R"

}

1 => Services_Twilio_Rest_Recording {#706 ▶}

}

这些录音是为每个人准备的,而不仅仅是我想要的数字。即使在代码中我将它传递给 $phoneNumber 以进行过滤,但这对过滤它没有任何作用。

4

1 回答 1

0

您可以对照您希望过滤的号码检查CallSid录音。PhoneNumberSid

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of recordings and echo a property for each one
foreach ($client->account->recordings->getIterator(0, 50, array(
        "CallSid>" => // is in list of Calls for a given phone number.
    )) as $recording
) {
    echo $recording->call_sid;
}
于 2016-08-10T00:10:35.303 回答