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); }
/** * Checks if SSN matches between rule address pattern and provided destination address. SSN is assumed to always match in * case it has insignificant value or pattern AI SSNPresent flag is set to false. * * @param address - a provided address to match * @param pattern - a rule pattern address * @return true if SSN is present in both pattern and received addresses and they are the same or pattern has SSN flag unset * in AI (bit 7)(isSsnPresent = false for pattern) or pattern SSN value is insignificant */ private boolean isSsnMatch(SccpAddress address, SccpAddress pattern) { if (!isSsnSignificant(pattern.getSubsystemNumber()) || !pattern.getAddressIndicator().isSSNPresent()) { if (logger.isTraceEnabled()) { logger.trace(String.format("SSN is not present or insignificant [%s]. Assume SSN matches. Return True", pattern.getSubsystemNumber())); } return true; } if (pattern.getAddressIndicator().isSSNPresent() && address.getAddressIndicator().isSSNPresent()) { if (address.getSubsystemNumber() == pattern.getSubsystemNumber()) { return true; } } if (logger.isTraceEnabled()) { logger.trace(String.format( "SSN didn't match. Pattern: isSsnPresent=%s, SSN=%s Address: isSsnPresent=%s, SSN=%s Return False", pattern.getAddressIndicator().isSSNPresent(), pattern.getSubsystemNumber(), address.getAddressIndicator() .isSSNPresent(), address.getSubsystemNumber())); } return false; }
int ssn = msg.getCalledPartyAddress().getSubsystemNumber(); if (ssn == 1) { return; switch (ri) { case ROUTING_BASED_ON_DPC_AND_SSN: int ssn = msg.getCalledPartyAddress().getSubsystemNumber(); if (ssn == 1) {
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); } }
int targetSsn = translationAddress.getSubsystemNumber(); if (targetSsn == 0) targetSsn = msg.getCalledPartyAddress().getSubsystemNumber();
int ssn = calledPartyAddress.getSubsystemNumber(); GlobalTitle gt = calledPartyAddress.getGlobalTitle(); calledPartyAddress.getSubsystemNumber()); if (remoteSsn == null) { if (logger.isEnabledFor(Level.WARN)) { logger.warn(String.format( "Received SCCPMessage=%s for routing, but no Remote SubSystem = %d resource defined ", msg, calledPartyAddress.getSubsystemNumber())); logger.warn(String.format( "Routing of Sccp Message=%s failed as Remote SubSystem = %d is prohibited ", msg, calledPartyAddress.getSubsystemNumber()));
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); }
int ssn = address.getSubsystemNumber(); if (ruleAddress.getSubsystemNumber() > 0) ssn = ruleAddress.getSubsystemNumber(); SccpAddress sccpAddress = new SccpAddressImpl(ruleAddress.getAddressIndicator().getRoutingIndicator(), gt,ruleAddress.getSignalingPointCode(), ssn);
if (!addr.getAddressIndicator().isPCPresent()) { msgAddr.setCallingPartyAddress(new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, null, msgAddr.getIncomingOpc(), addr .getSubsystemNumber()));
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.opc = message.getIncomingOpc(); dm.dpc = message.getIncomingDpc(); dm.callingSsn = message.getCallingPartyAddress().getSubsystemNumber(); dm.calledSsn = message.getCalledPartyAddress().getSubsystemNumber();