org.mobicents.protocols.ss7.indicator.RoutingIndicator Java Examples

The following examples show how to use org.mobicents.protocols.ss7.indicator.RoutingIndicator. 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: Test_SS7Firewall.java    From SigFW with GNU Affero General Public License v3.0 6 votes vote down vote up
private static void initializeSS7Firewall() {
    try {
        // Use last config
        SS7FirewallConfig.loadConfigFromFile("ss7fw_junit.json");
        // TODO use the following directive instead to do not use .last configs
        //SS7FirewallConfig.loadConfigFromFile(configName);
    } catch (Exception ex) {
        java.util.logging.Logger.getLogger(SS7FirewallConfig.class.getName()).log(Level.SEVERE, null, ex);
    }

    sigfw = new SS7Firewall();
    sigfw.unitTesting = true;

    try {
        sigfw.initializeStack(IpChannelType.SCTP);
    } catch (Exception e) {
        e.printStackTrace();
    }
    
    // set the calling and called GT for unittests
    GlobalTitle callingGT = sigfw.sccpStack.getSccpProvider().getParameterFactory().createGlobalTitle("111111111111", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_MOBILE, null, NatureOfAddress.INTERNATIONAL);
    GlobalTitle calledGT = sigfw.sccpStack.getSccpProvider().getParameterFactory().createGlobalTitle("000000000000", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_MOBILE, null, NatureOfAddress.INTERNATIONAL);
    callingParty = sigfw.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, callingGT, 1, 8);
    calledParty = sigfw.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calledGT, 2, 8);
}
 
Example #2
Source File: SS7Honeypot.java    From SigFW with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initiateUSSD() throws MAPException {
    logger.debug("[[[[[[[[[[    initiateUSSD      ]]]]]]]]]]");

    //SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 1, SSN);
    //SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 2, SSN);
    
    GlobalTitle callingGT = this.sccpProvider.getParameterFactory().createGlobalTitle("111111111111", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    GlobalTitle calledGT = this.sccpProvider.getParameterFactory().createGlobalTitle("222222222222", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    
    SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, callingGT, SERVER_SPC, 8);
    SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calledGT, CLIENT_SPC, 8);
        
    
    ISDNAddressString origReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "11111111111");
    ISDNAddressString destReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "111111111111111");
    
    // First create Dialog
    MAPDialogSupplementary mapDialog = this.mapProvider.getMAPServiceSupplementary().createNewDialog(
            MAPApplicationContext.getInstance(MAPApplicationContextName.networkUnstructuredSsContext,
                    MAPApplicationContextVersion.version2), callingParty, origReference, calledParty, destReference);

    CBSDataCodingSchemeImpl ussdDataCodingScheme = new CBSDataCodingSchemeImpl(0x0F);

    // USSD String: *111*+11111111111#
    // The Charset is null, here we let system use default Charset (UTF-7 as
    // explained in GSM 03.38. However if MAP User wants, it can set its own
    // impl of Charset
    USSDString ussdString = this.mapProvider.getMAPParameterFactory().createUSSDString("*111*+11111111111#", ussdDataCodingScheme, null);

    ISDNAddressString msisdn = this.mapProvider.getMAPParameterFactory().createISDNAddressString(
            AddressNature.international_number, NumberingPlan.ISDN, "11111111111");

    mapDialog.addProcessUnstructuredSSRequest(ussdDataCodingScheme, ussdString, null, msisdn);

    // This will initiate the TC-BEGIN with INVOKE component
    mapDialog.send();
}
 
Example #3
Source File: MobileCoreNetworkInterfaceSbb.java    From gmlc with GNU Affero General Public License v3.0 5 votes vote down vote up
private SccpAddress getHlrSCCPAddress(String address) {

    int translationType = 0; // Translation Type = 0 : Unknown
    EncodingScheme encodingScheme = null;
    GlobalTitle gt = sccpParameterFact.createGlobalTitle(address, translationType, NumberingPlan.ISDN_TELEPHONY, encodingScheme,
        NatureOfAddress.INTERNATIONAL);
    return sccpParameterFact.createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, translationType,
        gmlcPropertiesManagement.getHlrSsn());

//	    GlobalTitle0100 gt = new GlobalTitle0100Impl(address, 0, BCDEvenEncodingScheme.INSTANCE,NumberingPlan.ISDN_TELEPHONY, NatureOfAddress.INTERNATIONAL);
//		return new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, gmlcPropertiesManagement.getHlrSsn());
  }
 
Example #4
Source File: MobileCoreNetworkInterfaceSbb.java    From gmlc with GNU Affero General Public License v3.0 5 votes vote down vote up
protected SccpAddress getGmlcSccpAddress() {

    if (this.gmlcSCCPAddress == null) {
      int translationType = 0; // Translation Type = 0 : Unknown
      EncodingScheme encodingScheme = null;
      GlobalTitle gt = sccpParameterFact.createGlobalTitle(gmlcPropertiesManagement.getGmlcGt(), translationType,
          NumberingPlan.ISDN_TELEPHONY, encodingScheme, NatureOfAddress.INTERNATIONAL);
      this.gmlcSCCPAddress = sccpParameterFact.createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,
          gt, translationType, gmlcPropertiesManagement.getGmlcSsn());

//			GlobalTitle0100 gt = new GlobalTitle0100Impl(gmlcPropertiesManagement.getGmlcGt(),0,BCDEvenEncodingScheme.INSTANCE,NumberingPlan.ISDN_TELEPHONY,NatureOfAddress.INTERNATIONAL);
//			this.serviceCenterSCCPAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, gmlcPropertiesManagement.getGmlcSsn());
    }
    return this.gmlcSCCPAddress;
  }
 
Example #5
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 #6
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 #7
Source File: Client.java    From gmlc with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initSCCP() throws Exception {
  this.sccpStack = new SccpStackImpl("MapLoadClientSccpStack");
  this.sccpStack.setMtp3UserPart(1, this.clientM3UAMgmt);

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

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

  this.sccpStack.getSccpResource().addRemoteSpc(0, SERVER_SPC, 0, 0);
  this.sccpStack.getSccpResource().addRemoteSsn(0, SERVER_SPC, SERVER_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);

  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.sccpStack.getRouter().addRoutingAddress(1, localAddress);
  SccpAddress remoteAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt2, SERVER_SPC,
      SERVER_SSN);
  this.sccpStack.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.sccpStack.getRouter().addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE, pattern,
      "K", 1, -1, null, 0);
  this.sccpStack.getRouter().addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL, pattern, "K",
      2, -1, null, 0);
  this.sccpStack.getRouter().addLongMessageRule(1, 1, 16384, LongMessageRuleType.XUDT_ENABLED);
}
 
Example #8
Source File: Server.java    From gmlc with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initSCCP() throws Exception {
  this.sccpStack = new SccpStackImpl("MapLoadServerSccpStack");
  this.sccpStack.setMtp3UserPart(1, this.serverM3UAMgmt);

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

  this.sccpStack.getSccpResource().addRemoteSpc(0, CLIENT_SPC, 0, 0);
  this.sccpStack.getSccpResource().addRemoteSsn(0, CLIENT_SPC, CLIENT_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);

  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.sccpStack.getRouter().addRoutingAddress(1, localAddress);
  SccpAddress remoteAddress = new SccpAddressImpl(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt2, CLIENT_SPC, CLIENT_SSN);
  this.sccpStack.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.sccpStack.getRouter().addRule(1, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.REMOTE, pattern,
      "K", 1, -1, null, 0);
  this.sccpStack.getRouter().addRule(2, RuleType.SOLITARY, LoadSharingAlgorithm.Bit0, OriginationType.LOCAL, pattern, "K",
      2, -1, null, 0);
  this.sccpStack.getRouter().addLongMessageRule(1, 1, 16384, LongMessageRuleType.XUDT_ENABLED);
}
 
Example #9
Source File: SS7Client.java    From SigFW with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initiateUSSD() throws MAPException {

        //SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 1, SSN);
        //SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 2, SSN);
        
        GlobalTitle callingGT = this.sccpProvider.getParameterFactory().createGlobalTitle("111111111111", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
        GlobalTitle calledGT = this.sccpProvider.getParameterFactory().createGlobalTitle("222222222222", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
        
        SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, callingGT, CLIENT_SPC, 8);
        SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calledGT, SERVER_SPC, 8);
            
        
        ISDNAddressString origReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "11111111111");
        ISDNAddressString destReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "111111111111111");
        
        // First create Dialog
        MAPDialogSupplementary mapDialog = this.mapProvider.getMAPServiceSupplementary().createNewDialog(
                MAPApplicationContext.getInstance(MAPApplicationContextName.networkUnstructuredSsContext,
                        MAPApplicationContextVersion.version2), callingParty, origReference, calledParty, destReference);

        CBSDataCodingSchemeImpl ussdDataCodingScheme = new CBSDataCodingSchemeImpl(0x0F);

        // USSD String: *111*+11111111111#
        // The Charset is null, here we let system use default Charset (UTF-7 as
        // explained in GSM 03.38. However if MAP User wants, it can set its own
        // impl of Charset
        USSDString ussdString = this.mapProvider.getMAPParameterFactory().createUSSDString("*111*+11111111111#", ussdDataCodingScheme, null);

        ISDNAddressString msisdn = this.mapProvider.getMAPParameterFactory().createISDNAddressString(
                AddressNature.international_number, NumberingPlan.ISDN, "11111111111");

        mapDialog.addProcessUnstructuredSSRequest(ussdDataCodingScheme, ussdString, null, msisdn);

        // This will initiate the TC-BEGIN with INVOKE component
        mapDialog.send();
    }
 
Example #10
Source File: SS7ClientLiveInput.java    From SigFW with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initiateUSSD() throws MAPException {

        //SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 1, SSN);
        //SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 2, SSN);
        
        GlobalTitle callingGT = this.sccpProvider.getParameterFactory().createGlobalTitle("111111111111", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
        GlobalTitle calledGT = this.sccpProvider.getParameterFactory().createGlobalTitle("222222222222", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
        
        SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, callingGT, CLIENT_SPC, 8);
        SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calledGT, SERVER_SPC, 8);
            
        
        ISDNAddressString origReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "11111111111");
        ISDNAddressString destReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "111111111111111");
        
        // First create Dialog
        MAPDialogSupplementary mapDialog = this.mapProvider.getMAPServiceSupplementary().createNewDialog(
                MAPApplicationContext.getInstance(MAPApplicationContextName.networkUnstructuredSsContext,
                        MAPApplicationContextVersion.version2), callingParty, origReference, calledParty, destReference);

        CBSDataCodingSchemeImpl ussdDataCodingScheme = new CBSDataCodingSchemeImpl(0x0F);

        // USSD String: *111*+11111111111#
        // The Charset is null, here we let system use default Charset (UTF-7 as
        // explained in GSM 03.38. However if MAP User wants, it can set its own
        // impl of Charset
        USSDString ussdString = this.mapProvider.getMAPParameterFactory().createUSSDString("*111*+11111111111#", ussdDataCodingScheme, null);

        ISDNAddressString msisdn = this.mapProvider.getMAPParameterFactory().createISDNAddressString(
                AddressNature.international_number, NumberingPlan.ISDN, "11111111111");

        mapDialog.addProcessUnstructuredSSRequest(ussdDataCodingScheme, ussdString, null, msisdn);

        // This will initiate the TC-BEGIN with INVOKE component
        mapDialog.send();
    }
 
Example #11
Source File: SS7Server.java    From SigFW with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initiateUSSD() throws MAPException {
    logger.debug("[[[[[[[[[[    initiateUSSD      ]]]]]]]]]]");

    //SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 1, SSN);
    //SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, null, 2, SSN);
    
    GlobalTitle callingGT = this.sccpProvider.getParameterFactory().createGlobalTitle("111111111111", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    GlobalTitle calledGT = this.sccpProvider.getParameterFactory().createGlobalTitle("222222222222", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
    
    SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, callingGT, SERVER_SPC, 8);
    SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, calledGT, CLIENT_SPC, 8);
        
    
    ISDNAddressString origReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "11111111111");
    ISDNAddressString destReference = this.mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.land_mobile, "111111111111111");
    
    // First create Dialog
    MAPDialogSupplementary mapDialog = this.mapProvider.getMAPServiceSupplementary().createNewDialog(
            MAPApplicationContext.getInstance(MAPApplicationContextName.networkUnstructuredSsContext,
                    MAPApplicationContextVersion.version2), callingParty, origReference, calledParty, destReference);

    CBSDataCodingSchemeImpl ussdDataCodingScheme = new CBSDataCodingSchemeImpl(0x0F);

    // USSD String: *111*+11111111111#
    // The Charset is null, here we let system use default Charset (UTF-7 as
    // explained in GSM 03.38. However if MAP User wants, it can set its own
    // impl of Charset
    USSDString ussdString = this.mapProvider.getMAPParameterFactory().createUSSDString("*111*+11111111111#", ussdDataCodingScheme, null);

    ISDNAddressString msisdn = this.mapProvider.getMAPParameterFactory().createISDNAddressString(
            AddressNature.international_number, NumberingPlan.ISDN, "11111111111");

    mapDialog.addProcessUnstructuredSSRequest(ussdDataCodingScheme, ussdString, null, msisdn);

    // This will initiate the TC-BEGIN with INVOKE component
    mapDialog.send();
}
 
Example #12
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 #13
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 #14
Source File: SS7Firewall.java    From SigFW with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * Method to execute firewall policy on target SCCP message.
 * 
 * @param mup M3UA instance in forward direction
 * @param mupReturn M3UA instance in reverse direction, to return UDTS
 * @param opc M3UA OPC
 * @param dpc M3UA DPC
 * @param sls M3UA SLS
 * @param ni M3UA NI
 * @param lmrt LongMessageRuleType
 * @param message Original SCCP message
 * @param reason the reason of discarding the message
 * @param lua_hm the LUA parameters, decoded from the message
 */
private void firewallMessage(Mtp3UserPart mup, Mtp3UserPart mupReturn, int opc, int dpc, int sls, int ni, LongMessageRuleType lmrt, SccpDataMessage message, String reason, HashMap<String, String> lua_hm) {
    String firewallPolicy = "";
    if (SS7FirewallConfig.firewallPolicy == SS7FirewallConfig.FirewallPolicy.DROP_SILENTLY) {
        firewallPolicy = "DROP_SILENTLY";
    } else if (SS7FirewallConfig.firewallPolicy == SS7FirewallConfig.FirewallPolicy.DROP_WITH_SCCP_ERROR) {
        firewallPolicy = "DROP_WITH_SCCP_ERROR";
        sendSccpErrorMessage(mupReturn, dpc, opc, sls, ni, lmrt, message, ReturnCauseValue.NO_TRANSLATION_FOR_ADDRESS);
    } else if (SS7FirewallConfig.firewallPolicy == SS7FirewallConfig.FirewallPolicy.DNAT_TO_HONEYPOT && dnat_sessions != null
            && message.getCallingPartyAddress() != null
            && message.getCallingPartyAddress().getGlobalTitle() != null 
            && message.getCalledPartyAddress() != null
            && message.getCalledPartyAddress().getGlobalTitle() != null
            ) {
        firewallPolicy = "DNAT_TO_HONEYPOT";
        
        GlobalTitle gt = this.sccpProvider.getParameterFactory().createGlobalTitle(SS7FirewallConfig.honeypot_sccp_gt, 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null, NatureOfAddress.INTERNATIONAL);
        SccpAddress sa_dnat = this.sccpProvider.getParameterFactory().createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, gt, 0, message.getCalledPartyAddress().getSubsystemNumber());
        SccpAddress sa = message.getCalledPartyAddress();
        String session_key = message.getCallingPartyAddress().getGlobalTitle().getDigits();
        dnat_sessions.put(session_key, message.getCalledPartyAddress().getGlobalTitle().getDigits() + ":" + message.getCalledPartyAddress().getSubsystemNumber());
        message.setCalledPartyAddress(sa_dnat);
        
        sendSccpMessage(mup, opc, dpc, sls, ni, lmrt, message);
    } else if (SS7FirewallConfig.firewallPolicy == SS7FirewallConfig.FirewallPolicy.ALLOW) {
        firewallPolicy = "ALLOW";
        sendSccpMessage(mup, opc, dpc, sls, ni, lmrt, message);
    }
    
    logger.info("Blocked message: Reason [" + reason + "] Policy [" + firewallPolicy + "] " + message.toString());
    
    JSONObject json_alert = new JSONObject();
    logger.debug("============ LUA variables ============");
    // mThreat alerting
    MessageDigest digest;
    try {
        digest = MessageDigest.getInstance("SHA-256");
    
        for (String key : lua_hm.keySet()) {
            logger.debug(key + ": " + lua_hm.get(key));

            String value = lua_hm.get(key);
            // Anonymize MSISDN, IMSI
            if (key.equals("map_imsi") || key.equals("map_msisdn")) {
                // add salt before hashing
                value = SS7FirewallConfig.mthreat_salt + value;
                value = DatatypeConverter.printHexBinary(digest.digest(value.getBytes(StandardCharsets.UTF_8)));
            } 
            json_alert.put(key, value);
        }
        mThreat_alerts.add(json_alert.toJSONString());
    } catch (NoSuchAlgorithmException ex) {
        java.util.logging.Logger.getLogger(SS7Firewall.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
Example #15
Source File: UpdateLocationResp.java    From SigPloit with MIT License 4 votes vote down vote up
@Override
public void onInsertSubscriberDataResponse(InsertSubscriberDataResponse insertSubscriberDataResponse) {
    try{

        /*long invokeId = insertSubscriberDataResponse.getInvokeId();
        ISDNAddressString HlrNumber = this.mapProvider.getMAPParameterFactory().createISDNAddressString(
                AddressNature.international_number,NumberingPlan.ISDN,"20109876543211");
        MAPDialogMobility mapDialogMobility = insertSubscriberDataResponse.getMAPDialog();

        mapDialogMobility.setUserObject(invokeId);
        mapDialogMobility.addUpdateLocationResponse(invokeId,HlrNumber,null,false,false);
        mapDialogMobility.send();

        logger.info("UpdateLocationResponse Message Sent...Update Location Completed");
        logger.info("Sending SMS...");*/




        //SMS MT
        AddressString orig_smsc = this.mapProvider.getMAPParameterFactory().createAddressString(AddressNature.international_number,
                NumberingPlan.ISDN,"966123456789");
        IMSI test_imsi = this.mapProvider.getMAPParameterFactory().createIMSI("602027891234567");
        SM_RP_DA sm_rp_da = this.mapProvider.getMAPParameterFactory().createSM_RP_DA(test_imsi);
        SM_RP_OA sm_rp_oa = this.mapProvider.getMAPParameterFactory().createSM_RP_OA_ServiceCentreAddressOA(orig_smsc);

        AddressField oa = new AddressFieldImpl(TypeOfNumber.InternationalNumber,
                NumberingPlanIdentification.ISDNTelephoneNumberingPlan,"2010789123456");


        AbsoluteTimeStampImpl timeStamp = new AbsoluteTimeStampImpl(16,4,3,15,51,18,2);
        ProtocolIdentifierImpl pi = new ProtocolIdentifierImpl(0);


        DataCodingSchemeImpl dcs = new DataCodingSchemeImpl(0); //default gsm 7 bit
        UserDataImpl ud = new UserDataImpl("Hello World!",dcs,null,null);
        SmsDeliverTpduImpl tpdu = new SmsDeliverTpduImpl(false,false,false,false,oa,pi,timeStamp,ud);
        SmsSignalInfoImpl sm_Rp_UI = new SmsSignalInfoImpl(tpdu, null);

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

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

        SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().
                createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtLocalMSC,SERVER_SPC,SSN_MSC);
        SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory()
                .createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtAttackerMSC,CLIENT_SPC,SSN_MSC);

        MAPDialogSms mapDialogSms = this.mapProvider.getMAPServiceSms().
                createNewDialog(MAPApplicationContext.getInstance(MAPApplicationContextName.shortMsgMTRelayContext,
                        MAPApplicationContextVersion.version2),callingParty,null,calledParty,null);
        mapDialogSms.addForwardShortMessageRequest(sm_rp_da,sm_rp_oa,sm_Rp_UI,false);


        logger.info("Sending SMS...\n");
        mapDialogSms.send();
        logger.info("SMS Sent...");

    } catch (MAPException e){
        e.printStackTrace();
    }

}
 
Example #16
Source File: UpdateLocationResp.java    From SigPloit with MIT License 4 votes vote down vote up
@Override
public void onUpdateLocationRequest(UpdateLocationRequest updateLocationRequest) {
    try {
        long invokeIdU = updateLocationRequest.getInvokeId();

        ISDNAddressString MscFake = updateLocationRequest.getMscNumber();
        ISDNAddressString VlrFake = updateLocationRequest.getVlrNumber();

        IMSI TargetImsi = updateLocationRequest.getImsi();
        Category category = this.mapProvider.getMAPParameterFactory().createCategory(5);
        ArrayList<ExtBearerServiceCode> bearerServiceList = new ArrayList<ExtBearerServiceCode>();
        ExtBearerServiceCode extBearerServiceCode = this.mapProvider.getMAPParameterFactory()
                .createExtBearerServiceCode(BearerServiceCodeValue.padAccessCA_9600bps);
        bearerServiceList.add(extBearerServiceCode);
        boolean roamingResttrictionDueToUnsupportedFeature = false;
        ISDNAddressString sgsnNumber = this.mapProvider.getMAPParameterFactory().
                createISDNAddressString(AddressNature.international_number,NumberingPlan.ISDN,"201022222222");

        SSCode ssCode = this.mapProvider.getMAPParameterFactory().createSSCode(SupplementaryCodeValue.allForwardingSS);

        //ArrayList<ExtSSInfo> provisionedSS =

        logger.info("New Fake MSC/VLR: "+ MscFake);
        logger.info("Victim IMSI: "+ TargetImsi);

        ISDNAddressString msisdn = this.mapProvider.getMAPParameterFactory().createISDNAddressString(
                AddressNature.international_number, NumberingPlan.ISDN, "2010789123456");

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

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

        SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().
                createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtHlr,SERVER_SPC,SSN_Server);
        SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory()
                .createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtMsc,CLIENT_SPC,SSN_Client);


        MAPDialogMobility dialogMobility = this.mapProvider.getMAPServiceMobility().createNewDialog(
                MAPApplicationContext.getInstance(MAPApplicationContextName.subscriberDataMngtContext,MAPApplicationContextVersion.version3),
                callingParty,null,calledParty,null);

        dialogMobility.addInsertSubscriberDataRequest(TargetImsi,msisdn,category,SubscriberStatus.serviceGranted,null,null,null,null,
                false,null,null,null,null,null,null,null,false,null,null,false,null,15,null,null,
                null,null,null,null,false,null,null,false,sgsnNumber,null,null,false,false,null);



        dialogMobility.send();

        logger.info("InsertSubscriberDataRequest Message Sent....");

    } catch (MAPException e){
        e.printStackTrace();
    }



}
 
Example #17
Source File: UpdateLocationResp.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
            ("20107891234567", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_MOBILE, null,
                    NatureOfAddress.INTERNATIONAL);

    GlobalTitle0100 localHlr = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("201012345678", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                    NatureOfAddress.INTERNATIONAL);
    GlobalTitle0100 localmsc = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("201012344321", 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));
    this.sccpStack.getRouter().addRoutingAddress
            (4, this.sccpProvider.getParameterFactory().createSccpAddress
                    (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localmsc, SERVER_SPC, SSN_MSC));



    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);
    SccpAddress patternMSC = this.sccpProvider.getParameterFactory().createSccpAddress
            (RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, localmsc, SERVER_SPC,SSN_MSC);


    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);
    this.sccpStack.getRouter().addRule
            (4, RuleType.SOLITARY, null, OriginationType.REMOTE, patternMSC, maskRemote, 3, -1, null, 0);




    logger.debug("Initialized SCCP Stack ....");
}
 
Example #18
Source File: SendRoutingInfoForGPRS.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);

    //Enter the tested HLR that is being queried on
    GlobalTitle0100 called = this.sccpProvider.getParameterFactory().createGlobalTitle
            ("441234567890", 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));

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


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


    logger.debug("Initialized SCCP Stack ....");
}
 
Example #19
Source File: SriSMResp.java    From SigPloit with MIT License 4 votes vote down vote up
@Override
public void onSendRoutingInfoForSMRequest(SendRoutingInfoForSMRequest sendRoutingInfoForSMRequest) {
    try {
        long invokeId = sendRoutingInfoForSMRequest.getInvokeId();

 //Add the MSC number that is serving the user
        ISDNAddressString msc = this.mapProvider.getMAPParameterFactory().createISDNAddressString
            (AddressNature.international_number, NumberingPlan.ISDN,"201111111111");

 //Add the IMSI of the subscriber that is queried 
        IMSI imsi = this.mapProvider.getMAPParameterFactory().createIMSI("602031234567890");
        LMSI lmsi = this.mapProvider.getMAPParameterFactory().createLMSI(new byte[]{(byte)0x65,(byte)0x10,(byte)0xf2,(byte)0x29});
        LocationInfoWithLMSI Location = this.mapProvider.getMAPParameterFactory().createLocationInfoWithLMSI
            (msc, lmsi, null, false, null);

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

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

        SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().
                createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtHlr,SERVER_SPC,SSN_Server);
        SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory()
                .createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtSMSC,CLIENT_SPC,SSN_Client);

        /*MAPDialogSms dialogSms = this.mapProvider.getMAPServiceSms().createNewDialog
                (MAPApplicationContext.getInstance(MAPApplicationContextName.shortMsgGatewayContext,
                        MAPApplicationContextVersion.version3),callingParty,null,calledParty,null);*/
        MAPDialogSms dialogSms = sendRoutingInfoForSMRequest.getMAPDialog();

        dialogSms.setUserObject(invokeId);

        dialogSms.addSendRoutingInfoForSMResponse(invokeId,imsi,Location,null, false);
        dialogSms.send();

        logger.info("IMSI and MSC GT Address Sent.....");

    } catch (MAPException e) {
        e.printStackTrace();
    }
}
 
Example #20
Source File: SriSMResp.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);

//Enter the tested MSIDN that is being queried on, or a mask to represent all the ranges
       GlobalTitle0100 called = this.sccpProvider.getParameterFactory().createGlobalTitle
               ("201124683579", 0, org.mobicents.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY, null,
                       NatureOfAddress.INTERNATIONAL);
       GlobalTitle0100 localHLR = this.sccpProvider.getParameterFactory().createGlobalTitle
               ("201179008244", 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 #21
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 #22
Source File: SendRoutingInfoResp.java    From SigPloit with MIT License 4 votes vote down vote up
@Override
public void onSendRoutingInformationRequest(SendRoutingInformationRequest sendRoutingInformationRequest) {
    try{
        long invokeId = sendRoutingInformationRequest.getInvokeId();
        //System.out.println(invokeId);

        IMSI imsi = this.mapProvider.getMAPParameterFactory().createIMSI("602021234567890");

        double Lat = 29.13;
        double Long = 31.56;
        double Uncertain = 10.123;

        int mcc = 602;
        int mnc = 02;
        int LAC = 1234;
        int CI = 5678;

        GeographicalInformation geographicalInformation = this.mapProvider.getMAPParameterFactory()
                .createGeographicalInformation(Lat,Long,Uncertain);

        CellGlobalIdOrServiceAreaIdFixedLength cellGlobalIdOrServiceAreaIdFixedLength =
                this.mapProvider.getMAPParameterFactory().createCellGlobalIdOrServiceAreaIdFixedLength(mcc,mnc,LAC,CI);
        CellGlobalIdOrServiceAreaIdOrLAI cellGlobalIdOrServiceAreaIdOrLAI = this.mapProvider
                .getMAPParameterFactory().createCellGlobalIdOrServiceAreaIdOrLAI(cellGlobalIdOrServiceAreaIdFixedLength);

        LocationInformation locationInformation = this.mapProvider.getMAPParameterFactory()
                .createLocationInformation(30,geographicalInformation,null,null,cellGlobalIdOrServiceAreaIdOrLAI
                        ,null,null,null,null,false,false,null,null);

        IMEI imei = this.mapProvider.getMAPParameterFactory().createIMEI("35209900176148");

        SubscriberState subscriberState = this.mapProvider.getMAPParameterFactory()
                .createSubscriberState(SubscriberStateChoice.assumedIdle,null);

        SubscriberInfo subscriberInfo = this.mapProvider.getMAPParameterFactory()
                .createSubscriberInfo(locationInformation,subscriberState,null,null,null,imei,null,
                        null,null);

        ISDNAddressString Vmsc = this.mapProvider.getMAPParameterFactory()
                .createISDNAddressString(AddressNature.international_number,NumberingPlan.ISDN,"20155555555");

        //Creating the Mobile Station Roaming Number used to route calls to be supplied in the routinginfo variable
        ISDNAddressString MSRN = this.mapProvider.getMAPParameterFactory()
                .createISDNAddressString(AddressNature.international_number,NumberingPlan.ISDN,"201511111111");

        RoutingInfo routingInfo = this.mapProvider.getMAPParameterFactory()
                .createRoutingInfo(MSRN);

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

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

        SccpAddress callingParty = this.sccpStack.getSccpProvider().getParameterFactory().
                createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtHlr,SERVER_SPC,SSN_Server);
        SccpAddress calledParty = this.sccpStack.getSccpProvider().getParameterFactory()
                .createSccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE,GtMsc,CLIENT_SPC,SSN_Client);

        MAPDialogCallHandling mapDialogCallHandling = sendRoutingInformationRequest.getMAPDialog();

        /*MAPDialogCallHandling mapDialogCallHandling = this.mapProvider.getMAPServiceCallHandling().createNewDialog(
                MAPApplicationContext.getInstance(MAPApplicationContextName.locationInfoRetrievalContext,MAPApplicationContextVersion.version3),
                callingParty,null,calledParty,null);*/

        mapDialogCallHandling.setUserObject(invokeId);

        //Check org.mobicents.protocols.ss7.map.api.service.callhandling.MAPDialogCallHandling to add more parameters
        // in the response.
        mapDialogCallHandling.addSendRoutingInformationResponse(invokeId,imsi,null,null,false,subscriberInfo,
                null,null,false, Vmsc,null,null,null,null,null,0,null,null,routingInfo,null,null,null,null,
                false,null);

        mapDialogCallHandling.send();

        logger.info(" [*] Subscriber Information Sent.....");


    } catch(Exception e){
        e.printStackTrace();
    }

}
 
Example #23
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 #24
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 #25
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 #26
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 #27
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 ....");
}