Reputation: 6826
I'm attempting to use the Java API helper with Twilio to make a call to the Twilio softphone running in Google Chrome. Here is my code:
... initialize API keys...
Client clientName = new Client( "jesse" );
PhoneNumber calerId = new PhoneNumber( "+17702349293" );
URI callAction = new URI( "https://handler.twilio.com/twiml/EH0c72cc88d481480a93e5947edb770449" );
Call call = Call.creator( clientName, calerId, callAction ).create();
I get this error message:
Exception in thread "main" com.twilio.exception.ApiException: The phone number you are attempting to call, 53773, is not valid.
It seems like Twilio is attempting to dial digits based on the letters in the client name - so "jesse" is being converted to "53773". How can I make Twilio understand that "jesse" is the name of a connected client?
Upvotes: 2
Views: 155
Reputation: 6826
Found the answer: Need to change this line:
Client clientName = new Client( "jesse" );
to this:
Client clientName = new Client( "client:jesse" );
As far as I can tell, this is not documented - I figured it out from looking at the "From:" name on incoming calls.
Upvotes: 2