在twilio调用REST API创建调用中显示不同的数字

时间:2016-08-12 01:05:30

标签: php twilio phone-number phone-call twilio-api

想象一下,我正在使用REST API创建一个新调用并设置如下参数:

$client->account->calls->create("+15017250604", "+14155551212", $urlCallback);

当手机响铃时,我不想将+15017250604显示为来电者,但我想显示不同的号码。我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

查看FAQ以添加经过验证的拨出来电显示。

要使用REST API,请将您的电话号码发布到Outgoing Caller IDs list resource

以下是在PHP中添加新的传出呼叫者ID的示例:

<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

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

$caller_id = $client->account->outgoing_caller_ids->create("+14158675309", array(
        "FriendlyName" => "My Home Phone Number"
    ));
echo $caller_id->validation_code;