Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

//portingnpdisconnect.

java
switch (getSource()) {
case EXTERNAL:
result = newDisconnectExternal();
break;
case RETAIL:
result = newDisconnectRetail();
break;
case MVNO:
result = newDisconnectMvno();
break;
default:
result = false;
break;
}
#######################################################
//relevant step within newDisconnectMvno()
// *************************************************************
***
// [CRDC] [19] Is this a BASE number?
// *************************************************************
***
if (getStepNr() == 19) {
enteringStep("Is this a BASE number?");
String msisdn = getAction().getAttribute("number");
// ZIP 11086 M2M - removed hard coded check against MSIS
DN prefix
boolean isBaseMsisdn = MobileOperator.isNamnoBASE(msisdn
); // MsisdnUtil.toNationalFormat(msisdn).startsWith("048");
leavingStep();
if (isBaseMsisdn) {
setStepNr(20);
} else {
setStepNr(30);
}
################################################################################
#######################
public static boolean isNamnoBASE(String msisdn) {
return isNamno(msisdn, BASE);
################################################################
################################
public static boolean isNamno(String msisdn, MobileOperator oper
ator) {
return operator.equals(MobileOperator.getOperatorByMsisdn(msisdn
));
}
################################################################
###############################
public static MobileOperator getOperatorByMsisdn(String strMsisdn) {
String msisdnNational = MsisdnUtil.toNationalFormat(strMsisdn);
Long msisdn = Long.valueOf(msisdnNational);
for (MobileOperator mobileOperator : MobileOperator.values()) {

for (MsisdnRange range : mobileOperator.msisdnRanges) {


if (msisdn >= range.getStart() && msisdn <= rang
e.getEnd()) {
return mobileOperator;
}
}
}
return null;
// throw new IllegalArgumentException("No mobile operator found
for MSISDN: " + strMsisdn);
}
################################################################
###############################
public class MsisdnUtil {
public static final String NATIONAL_PREFIX = "0";
public static final String INTERNATIONAL_PREFIX = "32";
public static String toNationalFormat(String msisdn) {
if (msisdn == null) {
// if null, we don't do anything
return msisdn;
}
if (msisdn.startsWith(INTERNATIONAL_PREFIX)) {
// MSISDN starts with international prefix, hence change
the prefix to national
return NATIONAL_PREFIX + msisdn.substring(INTERNATIONAL_
PREFIX.length());
} else if (msisdn.startsWith(NATIONAL_PREFIX)) {
// MSISDN already starts with national prefix, hence ret
urn it as it is
return msisdn;
} else {
// MSISDN does not start with national or international
prefix. e.g. 48x, 47x, 77x, etc.
// in this case we simply prefix the national prefix
return NATIONAL_PREFIX + msisdn;
}
}
###############################################################################
######################
Assumption to satisfy the problem: we are getting false from isNamnoBASE(String
msisdn) and hence step 30: [CRDC] [30] Send NPDisconnect to EX:
then step 31: / [CRDC] [31] Handle EX feedback:
then step REUNION_STEP:
if (getStepNr() == REUNION_STEP) {
enteringStep("Send NPDisconnect to MVNOXX, MVNOY
Y");
String referenceId = this.sendNPDisconnectToNext
Mvno();
if (referenceId != null) {
leavingStep("Suspending the process, wai
ting for an answer from MVNO. Ref is " + referenceId);
incrementStepNr();
suspend(referenceId);
} else {

logInfo("No MVNO present in properties f


ile. Skipping to step [" + FINAL_STEP+"]", null);
setStepNr(FINAL_STEP);
}
}
##########Thus succeeded npdisconnect at MNP but BSCS AP
I for repatriation is never called

You might also like