I'm writing an application to send SMS to my customers and I integrated with Twilio on localhost successfully. But my test environment is restricted machine and can't access to open network. Someone can define domain and when test machine tries to reach it, that address wilb resolved as address of Twilio. Such as she/he can define an address like this
https://external.domain.com:port
But the question is how can I override host address of Twilio in application level?
Here is sms sending code:
String ACCOUNT_SID = "";
String AUTH_TOKEN = "";
Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
try {
toPhoneNumber = "+" + toPhoneNumber;
Message message = Message
.creator(new PhoneNumber(toPhoneNumber), // to
new PhoneNumber("+90..."), // from
smsTemplate)
.create();
logger.info("message.getSid():" + message.getSid());
smsSent = true;
} catch (Throwable t) {
logger.error("Error on sending SMS to " + toPhoneNumber);
logger.error("Error is:");
logger.error(ExceptionUtils.getFullStackTrace(t));
}