Here is my working example, and for converting the number to English I had to parse it with a long one, I don’t know why it works and is converted to English,
public static void sendSMS(UserSms userSms, String toNumber, String body) {
TwilioRestClient client = new TwilioRestClient(userSms.getAccountSid(), userSms.getAuthToken());
long phoneNumber = Long.parseLong(toNumber.replace("+", ""));
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Body", body));
params.add(new BasicNameValuePair("To", toNumber));
params.add(new BasicNameValuePair("From", userSms.getFromNumber()));
MessageFactory messageFactory = client.getAccount().getMessageFactory();
Message message;
try {
message = messageFactory.create(params);
message = client.getAccount().getMessage(message.getSid());
SmsService.saveSmsLog(message, userSms, body);
} catch (TwilioRestException ex) {
Logger.getLogger(SmslUtil.class.getName()).log(Level.SEVERE, "send sms exception", ex);
}
}
java ; D