@@ -81,6 +81,15 @@ public class OriginatingCountryCalculatorIDD extends OriginatingCountryCalculato
81
81
public static String oparatorOnHeaderRegEx = null ;
82
82
public static String oparatorOnHeaderMCC = null ;
83
83
84
+ private boolean ignoreMSISDNFormatValidation ;
85
+
86
+ public OriginatingCountryCalculatorIDD () {
87
+
88
+ }
89
+
90
+ public OriginatingCountryCalculatorIDD (boolean ignoreMSISDNFormatValidation ) {
91
+ this .ignoreMSISDNFormatValidation = ignoreMSISDNFormatValidation ;
92
+ }
84
93
85
94
/*
86
95
* (non-Javadoc)
@@ -249,35 +258,43 @@ public OperatorEndpoint getOperatorEndpoint(
249
258
//MSISDN could be in ARC/PCR format
250
259
//if (phoneUtil.resourceInMsisdnFormat(searchDTO.getMSISDN())) {
251
260
252
- MSISDN numberProto = null ;
253
- int countryCode = 0 ;
254
- //Check MSIDN in typical format
255
- try {
256
- numberProto = phoneUtil .parse (searchDTO .getMSISDN ());
257
- if (numberProto != null ) {
261
+ if (!ignoreMSISDNFormatValidation ) {
262
+ MSISDN numberProto = null ;
263
+ int countryCode = 0 ;
264
+ //Check MSIDN in typical format
265
+ try {
266
+ numberProto = phoneUtil .parse (searchDTO .getMSISDN ());
267
+ if (numberProto != null ) {
268
+ /**
269
+ * obtain the country code form the phone number object
270
+ */
271
+ countryCode = numberProto .getCountryCode ();
272
+ }
273
+
258
274
/**
259
- * obtain the country code form the phone number object
275
+ * if the country code within the header look up context , the
276
+ * operator taken from the header object
277
+ */
278
+ if (countryLookUpOnHeader .contains (String .valueOf (countryCode ))) {
279
+ operator = operatorCode ;
280
+ }
281
+ /**
282
+ * build the MSISDN
260
283
*/
261
- countryCode = numberProto .getCountryCode ();
262
- }
263
-
264
- /**
265
- * if the country code within the header look up context , the
266
- * operator taken from the header object
267
- */
268
- if (countryLookUpOnHeader .contains (String .valueOf (countryCode ))) {
269
- operator = operatorCode ;
270
- }
271
- /**
272
- * build the MSISDN
273
- */
274
284
275
- if (numberProto != null ) {
285
+ if (numberProto != null ) {
276
286
277
- msisdn .append ("+" ).append (numberProto .getCountryCode ())
278
- .append (numberProto .getNationalNumber ());
287
+ msisdn .append ("+" ).append (numberProto .getCountryCode ())
288
+ .append (numberProto .getNationalNumber ());
289
+ }
290
+ } catch (InvalidMSISDNException e ) {
291
+ //number in either ARC/PCR format. number already validated from oneapi validation
292
+ //operator fetched from header
293
+ if (operatorCode != null ) {
294
+ operator = operatorCode ;
295
+ }
279
296
}
280
- } catch ( InvalidMSISDNException e ) {
297
+ } else {
281
298
//number in either ARC/PCR format. number already validated from oneapi validation
282
299
//operator fetched from header
283
300
if (operatorCode != null ) {
0 commit comments