1

I am new to twilio.I am using twilio trial account and I am using php.I have created my account and the verification code was sent to my number .But when i try to make a call i get the error

Error: The source phone number provided, +1937xxxxxx6, is not yet verified for your account. You may only make calls from phone numbers that you've verified or purchased from Twilio.

Here is my code

<?php
// Include the Twilio PHP library
require 'twilio-php-master/Services/Twilio.php';

// Twilio REST API version
$version = "2010-04-01";

// Set our Account SID and AuthToken
$sid = 'Axxxxxxxxxxxxxxxxxxffa58';
$token = 'f878xxxxxxxxxxxxxxxeb05';

// A phone number you have previously validated with Twilio
$phonenumber = '+19xxxxxxxx6';

// Instantiate a new Twilio Rest Client
$client = new Services_Twilio($sid, $token, $version);

try {
    // Initiate a new outbound call
    $call = $client->account->calls->create(
        $phonenumber, // The number of the phone initiating the call
        '+91xxxxxxxx7', // The number of the phone receiving call
        'http://demo.twilio.com/welcome/voice' // The URL Twilio will request when the call is answered
    );
    echo 'Started call: ' . $call->sid;
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
?>
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
Vikhyath Maiya
  • 3,122
  • 3
  • 34
  • 68

1 Answers1

-1

It happened to me when using the test account/token. I double checked that the my phone number is verified but it was giving me this error. Then I replaced the test account with my real account sid/token and the call succeeds.

I consider this as a bug in their system.

tested with python 3.6, twilio 6.16.2

noam cohen
  • 87
  • 1
  • 6