Você está na página 1de 5

//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 MSISDN


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 operator)


{
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 <=
range.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 return 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;
}
}
##################################################
###################################
One possible theory: 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, MVNOYY");

String referenceId = this.sendNPDisconnectToNextMvno();


if (referenceId != null) {
leavingStep("Suspending the process, waiting for
an answer from MVNO. Ref is " + referenceId);
incrementStepNr();

suspend(referenceId);
} else {
logInfo("No MVNO present in properties file.
Skipping to step [" + FINAL_STEP+"]", null);
setStepNr(FINAL_STEP);
}
}

##################################################
##
Thus, succeeded npdisconnect at MNP but BSCS API for repatriation is never called

Você também pode gostar