我有一個網站,它使用Twilio來允許人們使用我們的臨時號碼來接收在驗證過程中收到的短信等。公司正在切換到音頻驗證,而不是所以更爲常見,所以我想開始記錄所有收到的呼叫,使用HTML5 <audio>
標記在現有的HTML表格中顯示它們。如何在Twilio上錄製來電?
這裏是現有代碼:
<tbody>
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Get the PHP helper library from twilio.com/docs/php/install
require_once('twilio/Services/Twilio.php'); // Loads the library
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "";
$token = "";
$client = new Services_Twilio($sid, $token);
$messages = $client->account->messages->getIterator(0, 50, array(
'To' => $_SERVER['QUERY_STRING'] // this is the number
));
foreach ($messages as $message) {
echo "<tr><td>" . $message->from . "</td><td>" . $message->date_sent . "</td><td>" . $message->body . "</td></tr>";
}
?>
</tbody>
</table>
如何建立到該收到的通話記錄?我希望在eixsting SMS消息中保持日期/時間順序,如果有意義的話。
向我們展示您做了什麼來實現這一點,哪些不適合您 – gipsy