@Override public String getOriginatorSccpAddress() { if (correlationIdValue.getOriginatorSccpAddress() != null && correlationIdValue.getOriginatorSccpAddress().getGlobalTitle() != null) return correlationIdValue.getOriginatorSccpAddress().getGlobalTitle().getDigits(); else return null; }
private void rewriteLocalAddressIfGTPresentAndRouteOnSsn(Dialog d) { SccpAddress localAddress = d.getLocalAddress(); if (localAddress.getGlobalTitle() != null && localAddress.getAddressIndicator().getRoutingIndicator() != RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE) { SccpAddress newLocalAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localAddress.getGlobalTitle(), localAddress.getSignalingPointCode(), localAddress.getSubsystemNumber()); d.setLocalAddress(newLocalAddress); LOGGER.debug("rewriteCalledPartyIfGTPresent from={} to={}", localAddress, newLocalAddress); } }
public static SccpDialogId extractFromSccpMessage(SccpDataMessage msg, boolean incoming) { String remoteGT; int remoteSSN, localSSN; if (incoming) { // remoteGT may be null in some cases, e.g. ATI request remoteGT = Optional.ofNullable(msg.getCallingPartyAddress().getGlobalTitle()).map(GlobalTitle::getDigits) .orElse(null); remoteSSN = msg.getCallingPartyAddress().getSubsystemNumber(); localSSN = msg.getCalledPartyAddress().getSubsystemNumber(); } else { // outgoing // remoteGT may be null in some cases, e.g. ATI request remoteGT = Optional.ofNullable(msg.getCalledPartyAddress().getGlobalTitle()).map(GlobalTitle::getDigits) .orElse(null); remoteSSN = msg.getCalledPartyAddress().getSubsystemNumber(); localSSN = msg.getCallingPartyAddress().getSubsystemNumber(); } return new SccpDialogId(remoteGT, remoteSSN, localSSN); }
String digits = address.getGlobalTitle().getDigits(); String patternDigits = pattern.getGlobalTitle().getDigits(); String primaryDigits = ruleAddress.getGlobalTitle().getDigits(); GlobalTitle primaryGt = ruleAddress.getGlobalTitle(); gt = createNewGT(gti, primaryGt, translatedDigits); gt = createNewGT(address.getAddressIndicator().getGlobalTitleIndicator(), address.getGlobalTitle(), translatedDigits);
public int compare(RuleImpl o1, RuleImpl o2) { String digits1 = o1.getPattern().getGlobalTitle().getDigits(); String digits2 = o2.getPattern().getGlobalTitle().getDigits(); // Normalize rule. Remove all separator digits1 = digits1.replaceAll(SECTION_SEPARTOR, ""); digits2 = digits2.replaceAll(SECTION_SEPARTOR, ""); // If a rule 1 is not OriginationType.All and rule 2 is OriginationType.All we put rule 1 first if (o1.getOriginationType() != OriginationType.ALL && o2.getOriginationType() == OriginationType.ALL) return -1; if (o1.getOriginationType() == OriginationType.ALL && o2.getOriginationType() != OriginationType.ALL) return 1; // Check if digits are exactly same. In that case we sort based on the callingDigits if ( digits1.equals( digits2 )) { // if rule1 has calling party and rule2 doesn't then we put rule1 first if ( o1.getPatternCallingAddress() != null && o2.getPatternCallingAddress() == null ) { return -1; } else if ( o1.getPatternCallingAddress() == null && o2.getPatternCallingAddress() != null ) { return 1; } else if ( o1.getPatternCallingAddress() != null && o2.getPatternCallingAddress() != null ) { // both have calling party addresses. lets compare these 2 digits1 = o1.getPatternCallingAddress().getGlobalTitle().getDigits(); digits2 = o2.getPatternCallingAddress().getGlobalTitle().getDigits(); // Normalize rule. Remove all separator digits1 = digits1.replaceAll(SECTION_SEPARTOR, ""); digits2 = digits2.replaceAll(SECTION_SEPARTOR, ""); return compareDigits( digits1, digits2 ); } } return compareDigits( digits1, digits2 ); }
int patternNumberOfSecs = (pattern.getGlobalTitle().getDigits().split("/").length - 1); throw new Exception(String.format(SccpOAMMessage.NO_PRIMARY_ADDRESS, pAddressId)); int primAddNumberOfSecs = (pattern.getGlobalTitle().getDigits().split("/").length - 1); if (maskumberOfSecs != primAddNumberOfSecs) { throw new Exception(SccpOAMMessage.SEC_MISMATCH_PRIMADDRESS); throw new Exception(String.format(SccpOAMMessage.NO_BACKUP_ADDRESS, sAddressId)); int secAddNumberOfSecs = (pattern.getGlobalTitle().getDigits().split("/").length - 1); if (maskumberOfSecs != secAddNumberOfSecs) { throw new Exception(SccpOAMMessage.SEC_MISMATCH_SECADDRESS);
int patternNumberOfSecs = (pattern.getGlobalTitle().getDigits().split("/").length - 1); int primAddNumberOfSecs = (pAddress.getGlobalTitle().getDigits().split("/").length - 1); if (maskumberOfSecs != primAddNumberOfSecs) { throw new Exception(SccpOAMMessage.SEC_MISMATCH_PRIMADDRESS); int secAddNumberOfSecs = (sAddress.getGlobalTitle().getDigits().split("/").length - 1); if (maskumberOfSecs != secAddNumberOfSecs) { throw new Exception(SccpOAMMessage.SEC_MISMATCH_SECADDRESS);
private boolean matchGt( SccpAddress address, SccpAddress patternAddress ) { GlobalTitle patternGT = patternAddress.getGlobalTitle(); switch (gti) { case GLOBAL_TITLE_INCLUDES_NATURE_OF_ADDRESS_INDICATOR_ONLY: GlobalTitle0001 gt = (GlobalTitle0001) address.getGlobalTitle(); GlobalTitle0011 gt1 = (GlobalTitle0011) address.getGlobalTitle(); GlobalTitle0100 gt2 = (GlobalTitle0100) address.getGlobalTitle(); if (!matchPattern(gt2.getDigits(), patternAddress.getGlobalTitle().getDigits())) { if (logger.isDebugEnabled()) { logger.debug(String.format("digits didn't match. Pattern digits=%s Address Digits=%s Return False", GlobalTitle0010 gt3 = (GlobalTitle0010) address.getGlobalTitle(); if (!matchPattern(gt3.getDigits(), patternAddress.getGlobalTitle().getDigits())) { if (logger.isDebugEnabled()) { logger.debug(String.format("digits didn't match. Pattern digits=%s Address Digits=%s Return False",
public void write(SccpAddress ai, OutputElement xml) throws XMLStreamException { xml.setAttribute(POINT_CODE, ai.getSignalingPointCode()); xml.setAttribute(SUBSYSTEM_NUMBER, ai.getSubsystemNumber()); xml.add(ai.getAddressIndicator(), AI, AddressIndicator.class); xml.add(ai.getGlobalTitle(), GLOBAL_TITLE); }
GlobalTitle gt = calledPartyAddress.getGlobalTitle();
protected int getMaxUserDataLength(SccpAddress calledPartyAddress, SccpAddress callingPartyAddress, int msgNetworkId) { GlobalTitle gt = calledPartyAddress.getGlobalTitle(); int dpc = calledPartyAddress.getSignalingPointCode(); int ssn = calledPartyAddress.getSubsystemNumber(); if (calledPartyAddress.getAddressIndicator().isPCPresent()) { if (this.router.spcIsLocal(dpc)) { if (ssn > 0) { // local destination - unlimited length return this.getMaxDataMessage(); } else if (gt != null) { return getMaxUserDataLengthForGT(calledPartyAddress, callingPartyAddress, msgNetworkId); } else { return 0; } } else { return getMaxUserDataLengthForDpc(dpc, calledPartyAddress, callingPartyAddress); } } else { if (gt != null) { return getMaxUserDataLengthForGT(calledPartyAddress, callingPartyAddress, msgNetworkId); } else { return 0; } } }
dm.calledSsn = message.getCalledPartyAddress().getSubsystemNumber(); GlobalTitle gt = message.getCallingPartyAddress().getGlobalTitle(); if (gt != null) dm.callingPA = gt.getDigits(); gt = message.getCalledPartyAddress().getGlobalTitle(); if (gt != null) dm.calledPA = gt.getDigits();
SccpAddress locAddr2 = sccpParameterFact.createSccpAddress(locAddr.getAddressIndicator().getRoutingIndicator(), locAddr.getGlobalTitle(), locAddr.getSignalingPointCode(), smscPropertiesManagement.getHlrSsn()); dialog.setLocalAddress(locAddr2);