0
votes

I have a trial twilio phone number 1XXXXXXXXXXXX:

I am able to receive a call, record, voicemail, But when tried to make an outbound call , i am getting the below exception.

Exception in thread "main" com.twilio.sdk.TwilioRestException: The source phone number provided, +1XXXXXXXXXXXX, 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 the code:

public class MakeCall {

public static final String ACCOUNT_SID = "My account sid";
public static final String AUTH_TOKEN = "my auth token";

public static void main(String[] args) throws TwilioRestException {

    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    Account mainAccount = client.getAccount();
    CallFactory callFactory = mainAccount.getCallFactory();
    Map<String, String> callParams = new HashMap<String, String>();
    callParams.put("To", "+917406097660"); // Replace with your phone number
    callParams.put("From", "571-206-3804"); // Replace with a Twilio number
    callParams.put("Url", "http://demo.twilio.com/welcome/voice/");
    // Make the call
    Call call = callFactory.create(callParams);
    // Print the call SID (a 32 digit hex like CA123..)
    System.out.println(call.getSid());
}

}

Thanks in advance,

1
i need your help in openbravo to solve my problemKARAN

1 Answers

1
votes

The error you're receiving is the following:

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

You should check to make sure the From number is a Twilio number or a number you've verified. It looks like the From number you've provided, 571-206-3804, is not a Twilio number - double check that it's the right value.