Skip to content

Commit

Permalink
Patch for CallManager to properly handle numbers that start with +
Browse files Browse the repository at this point in the history
This close #2158
  • Loading branch information
gvagenas committed May 17, 2017
1 parent 3e0dece commit d2ca01f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -988,17 +988,18 @@ private boolean redirectToHostedVoiceApp(final ActorRef self, final SipServletRe
// Format the destination to an E.164 phone number.
final PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance();
String formatedPhone = null;
//Don't format to E.164 if contains# or * as this is
//for a Regex or USSD call
if (phone.contains("*") || phone.contains("#")){
formatedPhone = phone;
}else{
if (!(phone.contains("*") || phone.contains("#"))) {
try {
formatedPhone = phoneNumberUtil.format(phoneNumberUtil.parse(phone, "US"), PhoneNumberFormat.E164);
} catch (NumberParseException e) {
logger.error("Exception when try to format : " + e);
}
}
if (formatedPhone == null) {
//Don't format to E.164 if phone contains # or * as this is
//for a Regex or USSD short number
formatedPhone = phone;
}
IncomingPhoneNumber number = null;
try {
// Try to find an application defined for the phone number.
Expand Down

0 comments on commit d2ca01f

Please sign in to comment.