org.mobicents.protocols.ss7.sccp.OriginationType Java Examples

The following examples show how to use org.mobicents.protocols.ss7.sccp.OriginationType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientServer.java    From gmlc with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initServerSCCP() throws Exception {
  this.serverSccpStack = new SccpStackImpl("MapLoadServerSccpStack");
  this.serverSccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

  this.serverSccpStack.start();
  this.serverSccpStack.removeAllResourses();

  this.serverSccpStack.getSccpResource().addRemoteSpc(0, CLIENT_SPC, 0, 0);
  this.serverSccpStack.getSccpResource().addRemoteSsn(0, CLIENT_SPC, CLIENT_SSN, 0, false);

  this.serverSccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, SERVER_SPC, NETWORK_INDICATOR, 0);
  this.serverSccpStack.getRouter().addMtp3Destination(1, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);

  ParameterFactoryImpl fact = new ParameterFactoryImpl();
  EncodingScheme ec = new BCDEvenEncodingScheme();
  GlobalTitle gt1 = fact.createGlobalTitle("-", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, ec,
      NatureOfAddress.INTERNATIONAL);
  GlobalTitle gt2 = fact.createGlobalTitle("-", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, ec,
      NatureOfAddress.INTERNATIONAL);
  SccpAddress localAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt1, SERVER_SPC, SERVER_SSN);
  this.serverSccpStack.getRouter().addRoutingAddress(1, localAddress);
  SccpAddress remoteAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt2, CLIENT_SPC, CLIENT_SSN);
  this.serverSccpStack.getRouter().addRoutingAddress(2, remoteAddress);

  GlobalTitle gt = fact.createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, ec,
      NatureOfAddress.INTERNATIONAL);
  SccpAddress pattern = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
  this.serverSccpStack.getRouter().addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE,
      pattern, "K", 1, -1, null, 0);
  this.serverSccpStack.getRouter().addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL,
      pattern, "K", 2, -1, null, 0);
}
 
Example #2
Source File: ClientServer.java    From gmlc with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initClientSCCP() throws Exception {
  this.clientSccpStack = new SccpStackImpl("MapLoadClientSccpStack");
  this.clientSccpStack.setMtp3UserPart(1, this.clientM3UAMgmt);

  // this.clientSccpStack.setCongControl_Algo(SccpCongestionControlAlgo.levelDepended);

  this.clientSccpStack.start();
  this.clientSccpStack.removeAllResourses();

  this.clientSccpStack.getSccpResource().addRemoteSpc(0, SERVER_SPC, 0, 0);
  this.clientSccpStack.getSccpResource().addRemoteSsn(0, SERVER_SPC, SERVER_SSN, 0, false);

  this.clientSccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, CLIENT_SPC, NETWORK_INDICATOR, 0);
  this.clientSccpStack.getRouter().addMtp3Destination(1, 1, SERVER_SPC, SERVER_SPC, 0, 255, 255);

  ParameterFactoryImpl fact = new ParameterFactoryImpl();
  EncodingScheme ec = new BCDEvenEncodingScheme();
  GlobalTitle gt1 = fact.createGlobalTitle("-", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, ec,
      NatureOfAddress.INTERNATIONAL);
  GlobalTitle gt2 = fact.createGlobalTitle("-", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, ec,
      NatureOfAddress.INTERNATIONAL);
  SccpAddress localAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt1, CLIENT_SPC,
      CLIENT_SSN);
  this.clientSccpStack.getRouter().addRoutingAddress(1, localAddress);
  SccpAddress remoteAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt2, SERVER_SPC,
      SERVER_SSN);
  this.clientSccpStack.getRouter().addRoutingAddress(2, remoteAddress);

  GlobalTitle gt = fact.createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, ec,
      NatureOfAddress.INTERNATIONAL);
  SccpAddress pattern = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
  this.clientSccpStack.getRouter().addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE, pattern,
      "K", 1, -1, null, 0);
  this.clientSccpStack.getRouter().addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL, pattern, "K",
      2, -1, null, 0);
  this.clientSccpStack.getRouter().addLongMessageRule(1, 1, 16384, LongMessageRuleType.XUDT_ENABLED);
}
 
Example #3
Source File: SS7Honeypot.java    From SigFW with GNU Affero General Public License v3.0 4 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("SctpServerSCCP");
    this.sccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

    this.sccpStack.setPersistDir(persistDir);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(0, CLIENT_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(0, CLIENT_SPC, 6, 0, false);
    this.sccpStack.getSccpResource().addRemoteSsn(1, CLIENT_SPC, 7, 0, false);
    this.sccpStack.getSccpResource().addRemoteSsn(2, CLIENT_SPC, 8, 0, false);
    this.sccpStack.getSccpResource().addRemoteSsn(3, CLIENT_SPC, 9, 0, false);

    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, SERVER_SPC, NETWORK_INDICATOR, 0);
    this.sccpStack.getRouter().addMtp3Destination(1, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);    
    
    this.sccpProvider = this.sccpStack.getSccpProvider();
    
    this.sccpProvider.registerSccpListener(6, this);
    this.sccpProvider.registerSccpListener(7, this);
    this.sccpProvider.registerSccpListener(8, this);
    
    
    this.sccpStack.getSccpResource().addRemoteSpc(1, SERVER_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(4, SERVER_SPC, 6, 0, false);
    this.sccpStack.getSccpResource().addRemoteSsn(5, SERVER_SPC, 7, 0, false);
    this.sccpStack.getSccpResource().addRemoteSsn(6, SERVER_SPC, 8, 0, false);
    this.sccpStack.getSccpResource().addRemoteSsn(7, SERVER_SPC, 9, 0, false);
    
    //this.sccpStack.setPreviewMode(true);
    
    // SCCP routing table
    GlobalTitle gt = this.sccpProvider.getParameterFactory().createGlobalTitle("", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    this.sccpStack.getRouter().addRoutingAddress(1, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, CLIENT_SPC, 0));
    
    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    this.sccpStack.getRouter().addRoutingAddress(2, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, SERVER_SPC, SSN));
    
    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    SccpAddress pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    String mask = "K";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL, pattern, mask, 1, -1, null, 0, null);
    
    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    mask = "K";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE, pattern, mask, 2, -1, null, 0, null);
    
    logger.debug("Initialized SCCP Stack ....");
}
 
Example #4
Source File: SS7Server.java    From SigFW with GNU Affero General Public License v3.0 4 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("SctpServerSCCP");
    this.sccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

    this.sccpStack.setPersistDir(persistDir);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(0, CLIENT_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(0, CLIENT_SPC, SSN, 0, false);

    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, SERVER_SPC, NETWORK_INDICATOR, 0);
    this.sccpStack.getRouter().addMtp3Destination(1, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);    
    
    this.sccpProvider = this.sccpStack.getSccpProvider();
    
    
    this.sccpStack.getSccpResource().addRemoteSpc(1, SERVER_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(1, SERVER_SPC, SSN, 0, false);
    
    //this.sccpStack.setPreviewMode(true);
    
    // SCCP routing table
    GlobalTitle gt = this.sccpProvider.getParameterFactory().createGlobalTitle("", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    this.sccpStack.getRouter().addRoutingAddress(1, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, CLIENT_SPC, 0));
    
    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    this.sccpStack.getRouter().addRoutingAddress(2, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, SERVER_SPC, SSN));
    
    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    SccpAddress pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    String mask = "K";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL, pattern, mask, 1, -1, null, 0, null);
    
    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    mask = "R";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE, pattern, mask, 2, -1, null, 0, null);
    
    
    logger.debug("Initialized SCCP Stack ....");
}
 
Example #5
Source File: SendRoutingInfoResp.java    From SigPloit with MIT License 4 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("MapLoadServerSccpStack");
    this.sccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(1, CLIENT_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(1, CLIENT_SPC, SSN_Client, 0, false);



    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, SERVER_SPC, NETWORK_INDICATOR, 0);
    //addMtp3Destination(sapID, destID, firstDPC, lastDPC, firstSls, lastSls, slaMask)
    this.sccpStack.getRouter().addMtp3Destination(1, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);


    this.sccpProvider = this.sccpStack.getSccpProvider();

    // SCCP routing table
    GlobalTitle0100 calling = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);
    GlobalTitle0100 called = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("201522222222", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);

    GlobalTitle0100 localHLR = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("201500000000", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);


    this.sccpStack.getRouter().addRoutingAddress
            (1, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC, SSN_Server));

    this.sccpStack.getRouter().addRoutingAddress
            (2, this.sccpProvider.getParameterFactory().createSccpAddress(
                    RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, calling, CLIENT_SPC, SSN_Client));
    this.sccpStack.getRouter().addRoutingAddress
            (3, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localHLR, SERVER_SPC, SSN_Server));



    SccpAddress patternLocal = this.sccpProvider.getParameterFactory().createSccpAddress(
            RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calling, CLIENT_SPC,SSN_Client );
    SccpAddress patternRemote = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC,SSN_Server);
    SccpAddress patternHLR = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localHLR, SERVER_SPC,SSN_Server);


    String maskLocal = "K";
    String maskRemote = "R";

    //translate local GT to its POC+SSN (local rule)GTT
    this.sccpStack.getRouter().addRule
            (1, RuleType.SOLITARY, null,OriginationType.LOCAL, patternLocal, maskLocal, 2, -1, null, 0);
    this.sccpStack.getRouter().addRule
            (2, RuleType.SOLITARY, null, OriginationType.REMOTE, patternRemote, maskRemote, 1, -1, null, 0);
    this.sccpStack.getRouter().addRule
            (3, RuleType.SOLITARY, null, OriginationType.REMOTE, patternHLR, maskRemote, 3, -1, null, 0);


    logger.debug("Initialized SCCP Stack ....");
}
 
Example #6
Source File: AnyTimeInterrogationResp.java    From SigPloit with MIT License 4 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("MapLoadServerSccpStack");
    this.sccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(1, CLIENT_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(1, CLIENT_SPC, SSN_Client, 0, false);



    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, SERVER_SPC, NETWORK_INDICATOR, 0);
    //addMtp3Destination(sapID, destID, firstDPC, lastDPC, firstSls, lastSls, slaMask)
    this.sccpStack.getRouter().addMtp3Destination(1, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);


    this.sccpProvider = this.sccpStack.getSccpProvider();

    // SCCP routing table

    //createGlobalTitle(gt, TranslationType, NP, encodingScheme(BCD_ODD || BCD_EVEN), natureofAddress)
    //used GlobalTitleIndicator(GTI) class for createGlobalTitle is GlobalTitle0100(used for MAP)
    GlobalTitle0100 calling = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);
    GlobalTitle0100 called = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("96599657765", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);

    GlobalTitle0100 localHlr = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("96599657764", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);


    this.sccpStack.getRouter().addRoutingAddress
            (1, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC, SSN_Server));

    this.sccpStack.getRouter().addRoutingAddress
            (2, this.sccpProvider.getParameterFactory().createSccpAddress(
                    RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, calling, 1, SSN_Client));
   this.sccpStack.getRouter().addRoutingAddress
            (3, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localHlr, SERVER_SPC, SSN_Server));



    SccpAddress patternLocal = this.sccpProvider.getParameterFactory().createSccpAddress(
            RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calling, 1,SSN_Client );
    SccpAddress patternRemote = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC,SSN_Server);
   SccpAddress patternHLR = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localHlr, SERVER_SPC,SSN_Server);


    String maskLocal = "K";
    String maskRemote = "R"; //change mask to match on any digits after (2010) i.e 2010*

    //translate local GT to its POC+SSN (local rule)GTT
    this.sccpStack.getRouter().addRule
            (1, RuleType.SOLITARY, null,OriginationType.LOCAL, patternLocal, maskLocal, 2, -1, null, 0);
    this.sccpStack.getRouter().addRule
            (2, RuleType.SOLITARY, null, OriginationType.REMOTE, patternRemote, maskRemote, 1, -1, null, 0);
    this.sccpStack.getRouter().addRule
            (3, RuleType.SOLITARY, null, OriginationType.REMOTE, patternHLR, maskRemote, 3, -1, null, 0);




    logger.debug("Initialized SCCP Stack ....");
}
 
Example #7
Source File: SendIMSIResp.java    From SigPloit with MIT License 4 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("MapLoadServerSccpStack");
    this.sccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(1, CLIENT_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(1, CLIENT_SPC, SSN_Client, 0, false);



    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, SERVER_SPC, NETWORK_INDICATOR, 0);

    this.sccpStack.getRouter().addMtp3Destination(1, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);


    this.sccpProvider = this.sccpStack.getSccpProvider();

    // SCCP routing table
    GlobalTitle0100 calling = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);

    GlobalTitle0100 called = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("201522222222", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);

    GlobalTitle0100 localHLR = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("201500000000", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);


    this.sccpStack.getRouter().addRoutingAddress
            (1, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localHLR, SERVER_SPC, SSN_Server));

    this.sccpStack.getRouter().addRoutingAddress
            (2, this.sccpProvider.getParameterFactory().createSccpAddress(
                    RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, calling, CLIENT_SPC, SSN_Client));

    this.sccpStack.getRouter().addRoutingAddress
            (3, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC, SSN_Server));


    SccpAddress patternLocal = this.sccpProvider.getParameterFactory().createSccpAddress(
            RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calling, CLIENT_SPC,SSN_Client );
    SccpAddress patternHLR = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localHLR, SERVER_SPC,SSN_Server);
    SccpAddress patternRemote = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC,SSN_Server);


    String maskLocal = "K";
    String maskRemote = "R";

    //translate local GT to its POC+SSN (local rule)GTT
    this.sccpStack.getRouter().addRule
            (1, RuleType.SOLITARY, null,OriginationType.LOCAL, patternLocal, maskLocal, 2, -1, null, 0);
    this.sccpStack.getRouter().addRule
            (2, RuleType.SOLITARY, null, OriginationType.REMOTE, patternHLR, maskRemote, 1, -1, null, 0);
    this.sccpStack.getRouter().addRule
            (3, RuleType.SOLITARY, null, OriginationType.REMOTE, patternRemote, maskRemote, 1, -1, null,0);


    logger.debug("Initialized SCCP Stack ....");
}
 
Example #8
Source File: SS7Client.java    From SigFW with GNU Affero General Public License v3.0 2 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("SctpClientSCCP");
    
    this.clientM3UAMgmt.setPersistDir(persistDir);
    
    this.sccpStack.setMtp3UserPart(1, this.clientM3UAMgmt);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(0, SERVER_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(0, SERVER_SPC, SSN, 0, false);

    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, CLIENT_SPC, NETWORK_INDICATOR, 0);
    this.sccpStack.getRouter().addMtp3Destination(1, 1, SERVER_SPC, SERVER_SPC, 0, 255, 255);
    
    
    this.sccpProvider = this.sccpStack.getSccpProvider();
    
    
    //this.sccpStack.getSccpResource().addRemoteSpc(1, SERVER_SPC, 0, 0);
    //this.sccpStack.getSccpResource().addRemoteSsn(1, SERVER_SPC, SSN, 0, false);

    // SCCP routing table
    GlobalTitle gt = this.sccpProvider.getParameterFactory().createGlobalTitle("", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
             
    this.sccpStack.getRouter().addRoutingAddress(1, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, SERVER_SPC, 0));
    //this.sccpStack.getRouter().addRoutingAddress(2, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, gt, SERVER_SPC, SSN));

    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    SccpAddress pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    String mask = "K";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL, pattern, mask, 1, -1, null, 0, null);
    pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    mask = "R";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE, pattern, mask, 1, -1, null, 0, null);
    
    
    logger.debug("Initialized SCCP Stack ....");
}
 
Example #9
Source File: SS7ClientLiveInput.java    From SigFW with GNU Affero General Public License v3.0 2 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("SctpClientLiveInputSCCP");
    
    this.sccpStack.setPersistDir(persistDir);
    
    this.sccpStack.setMtp3UserPart(1, this.clientM3UAMgmt);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(0, SERVER_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(0, SERVER_SPC, SSN, 0, false);

    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, CLIENT_SPC, NETWORK_INDICATOR, 0);
    this.sccpStack.getRouter().addMtp3Destination(1, 1, SERVER_SPC, SERVER_SPC, 0, 255, 255);
    
    
    this.sccpProvider = this.sccpStack.getSccpProvider();
    
    
    //this.sccpStack.getSccpResource().addRemoteSpc(1, SERVER_SPC, 0, 0);
    //this.sccpStack.getSccpResource().addRemoteSsn(1, SERVER_SPC, SSN, 0, false);

    // SCCP routing table
    GlobalTitle gt = this.sccpProvider.getParameterFactory().createGlobalTitle("", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
             
    this.sccpStack.getRouter().addRoutingAddress(1, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, SERVER_SPC, 0));
    //this.sccpStack.getRouter().addRoutingAddress(2, this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, gt, SERVER_SPC, SSN));

    gt = this.sccpProvider.getParameterFactory().createGlobalTitle("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    SccpAddress pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    String mask = "K";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL, pattern, mask, 1, -1, null, 0, null);
    pattern = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, 0);
    mask = "R";
    ((RouterImpl) this.sccpStack.getRouter()).addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE, pattern, mask, 1, -1, null, 0, null);
    
    
    logger.debug("Initialized SCCP Stack ....");
}
 
Example #10
Source File: ProvideSubscriberInformationResp.java    From SigPloit with MIT License 2 votes vote down vote up
private void initSCCP() throws Exception {
    logger.debug("Initializing SCCP Stack ....");
    this.sccpStack = new SccpStackImpl("MapLoadServerSccpStack");
    this.sccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

    this.sccpStack.start();
    this.sccpStack.removeAllResourses();

    this.sccpStack.getSccpResource().addRemoteSpc(1, CLIENT_SPC, 0, 0);
    this.sccpStack.getSccpResource().addRemoteSsn(1, CLIENT_SPC, SSN_Client, 0, false);



    this.sccpStack.getRouter().addMtp3ServiceAccessPoint(1, 1, SERVER_SPC, NETWORK_INDICATOR, 0);
    //addMtp3Destination(sapID, destID, firstDPC, lastDPC, firstSls, lastSls, slaMask)
    this.sccpStack.getRouter().addMtp3Destination(1, 1, CLIENT_SPC, CLIENT_SPC, 0, 255, 255);


    this.sccpProvider = this.sccpStack.getSccpProvider();

    // SCCP routing table


    //used GlobalTitleIndicator(GTI) class for createGlobalTitle is GlobalTitle0100(used for MAP)
    GlobalTitle0100 calling = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("*", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);
    GlobalTitle0100 called = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("201179008244", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);

   /* GlobalTitle0100 localVlr = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("96599657765", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);*/


    this.sccpStack.getRouter().addRoutingAddress
            (1, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC, SSN_Server));

    this.sccpStack.getRouter().addRoutingAddress
            (2, this.sccpProvider.getParameterFactory().createSccpAddress(
                    RoutingIndicator.ROUTING_BASED_ON_DPC_AND_SSN, calling, 1, SSN_Client));
    /*this.sccpStack.getRouter().addRoutingAddress
            (3, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localVlr, SERVER_SPC, SSN_Server));*/



    SccpAddress patternLocal = this.sccpProvider.getParameterFactory().createSccpAddress(
            RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calling, 1,SSN_Client );
    SccpAddress patternRemote = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, called, SERVER_SPC,SSN_Server);
    /*SccpAddress patternHLR = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localVlr, SERVER_SPC,SSN_Server);*/


    String maskLocal = "K";
    String maskRemote = "R"; //change mask to match on any digits after (2010) i.e 2010*

    //translate local GT to its POC+SSN (local rule)GTT
    this.sccpStack.getRouter().addRule
            (1, RuleType.SOLITARY, null,OriginationType.LOCAL, patternLocal, maskLocal, 2, -1, null, 0);
    this.sccpStack.getRouter().addRule
            (2, RuleType.SOLITARY, null, OriginationType.REMOTE, patternRemote, maskRemote, 1, -1, null, 0);
    /*this.sccpStack.getRouter().addRule
            (3, RuleType.SOLITARY, null, OriginationType.REMOTE, patternHLR, maskRemote, 3, -1, null, 0);*/




    logger.debug("Initialized SCCP Stack ....");
}