if (this.sccpStackImpl.router.spcIsLocal(translationAddress.getSignalingPointCode())) { translationAddress.getSignalingPointCode()); if (remoteSpc == null) { if (logger.isEnabledFor(Level.WARN)) { logger.warn(String.format( "Received SccpMessage=%s for Translation but no %s Remote Signaling Pointcode = %d resource defined ", msg, destName, translationAddress.getSignalingPointCode())); logger.warn(String.format( "Received SccpMessage=%s for Translation but %s Remote Signaling Pointcode = %d is prohibited ", msg, destName, translationAddress.getSignalingPointCode())); logger.warn(String .format("Received SccpMessage=%s for Translation but %s Remote Signaling Pointcode = %d is congested with level %d ", msg, destName, translationAddress.getSignalingPointCode(), remoteSpc.getCurrentRestrictionLevel())); if (targetSsn != 1) { RemoteSubSystem remoteSubSystem = this.sccpStackImpl.getSccpResource().getRemoteSsn( translationAddress.getSignalingPointCode(), targetSsn); if (remoteSubSystem == null) { if (logger.isEnabledFor(Level.WARN)) { logger.warn(String.format("Received SccpMessage=%s for Translation but no %s Remote SubSystem = %d (dpc=%d) resource defined ", msg, destName, targetSsn, translationAddress.getSignalingPointCode())); if (logger.isEnabledFor(Level.WARN)) { logger.warn(String.format("Received SccpMessage=%s for Translation but %s Remote SubSystem = %d (dpc=%d) is prohibited ", msg, destName, targetSsn, translationAddress.getSignalingPointCode()));
private int getMaxUserDataLengthForGT(SccpAddress calledPartyAddress, SccpAddress callingPartyAddress, int msgNetworkId) { Rule rule = this.router.findRule(calledPartyAddress, callingPartyAddress, false, msgNetworkId); if (rule == null) { return 0; } SccpAddress translationAddressPri = this.router.getRoutingAddress(rule.getPrimaryAddressId()); if (translationAddressPri == null) { return 0; } return getMaxUserDataLengthForDpc(translationAddressPri.getSignalingPointCode(), calledPartyAddress, callingPartyAddress); }
protected void sendMessageToMtp(SccpAddressedMessageImpl msg) throws Exception { msg.setOutgoingDpc(msg.getCalledPartyAddress().getSignalingPointCode()); // if (msg.getSccpCreatesSls()) { // msg.setSls(this.sccpStackImpl.newSls()); // } ReturnCauseValue er = this.send(msg); if (er != null) { this.sendSccpError(msg, er); } }
private void sendManagementMessage(int dpc, int messageTypeCode, int affectedSsn, int subsystemMultiplicityIndicator) { Mtp3ServiceAccessPoint sap = this.sccpStackImpl.router.findMtp3ServiceAccessPoint(dpc, 0); if (sap == null) { logger.warn(String.format("Failed sendManagementMessage : Mtp3ServiceAccessPoint has not found for dpc=%d", dpc)); return; } int affectedPc; if (messageTypeCode == SST || messageTypeCode == SOG) { affectedPc = dpc; } else { affectedPc = sap.getOpc(); } SccpAddress calledAdd = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, null, dpc, 1); SccpAddress callingAdd = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, null, affectedPc, 1); byte[] data = createManagementMessageBody(messageTypeCode, affectedPc, affectedSsn, subsystemMultiplicityIndicator); SccpDataMessageImpl msg = (SccpDataMessageImpl) sccpProviderImpl.getMessageFactory().createDataMessageClass0(calledAdd, callingAdd, data, -1, false, null, null); if (logger.isDebugEnabled()) { logger.debug(String.format("Tx :SCMG Type=%d, Affected SSN=%d, AffectedPc=%d", messageTypeCode, affectedSsn, affectedPc)); } try { msg.setOutgoingDpc(msg.getCalledPartyAddress().getSignalingPointCode()); this.sccpRoutingControl.sendManagementMessage(msg); // this.sccpRoutingControl.sendMessageToMtp(msg); } catch (Exception e) { logger.error(String.format("Exception while trying to send SSP message=%s", msg), e); } }
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); } }
private NetworkIdStateImpl getRoutingAddressStatusForRoutingAddress(SccpAddress routingAddress, int affectedPc) { if (routingAddress != null && routingAddress.getAddressIndicator().isPCPresent()) { boolean affectedByPc = true; if ((affectedPc >= 0 && routingAddress.getSignalingPointCode() != affectedPc)) affectedByPc = false; boolean spcIsLocal = spcIsLocal(routingAddress.getSignalingPointCode()); if (spcIsLocal) { return new NetworkIdStateImpl(affectedByPc); } RemoteSignalingPointCode remoteSpc = sccpStack.getSccpResource().getRemoteSpcByPC( routingAddress.getSignalingPointCode()); if (remoteSpc == null) { return new NetworkIdStateImpl(affectedByPc); } if (remoteSpc.isRemoteSpcProhibited()) { return new NetworkIdStateImpl(false, affectedByPc); } int congLevel = SccpCongestionControl.generateSccpUserCongLevel(remoteSpc.getCurrentRestrictionLevel()); if (congLevel > 0) { return new NetworkIdStateImpl(congLevel, affectedByPc); } return new NetworkIdStateImpl(affectedByPc); } // we return here value that this affectedPc does not affect this rule return new NetworkIdStateImpl(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); }
int dpc = calledPartyAddress.getSignalingPointCode(); int ssn = calledPartyAddress.getSubsystemNumber(); 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; } } }
ssn = ruleAddress.getSubsystemNumber(); SccpAddress sccpAddress = new SccpAddressImpl(ruleAddress.getAddressIndicator().getRoutingIndicator(), gt,ruleAddress.getSignalingPointCode(), ssn);
locAddr.getSignalingPointCode(), smscPropertiesManagement.getHlrSsn()); dialog.setLocalAddress(locAddr2);