Java Code Examples for org.mobicents.protocols.ss7.map.api.service.mobility.MAPDialogMobility#addProvideSubscriberInfoResponse()

The following examples show how to use org.mobicents.protocols.ss7.map.api.service.mobility.MAPDialogMobility#addProvideSubscriberInfoResponse() . 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: SS7Honeypot.java    From SigFW with GNU Affero General Public License v3.0 4 votes vote down vote up
public void onProvideSubscriberInfoRequest(ProvideSubscriberInfoRequest psir) {
    logger.debug("[[[[[[[[[[    onProvideSubscriberInfoRequest      ]]]]]]]]]]");
    
    try {
        
        MAPDialogMobility curDialog = psir.getMAPDialog();
        long invokeId = curDialog.getLocalDialogId();
        
        ISDNAddressString vlrNumber = mapProvider.getMAPParameterFactory().createISDNAddressString(AddressNature.international_number, NumberingPlan.ISDN, "5555555666");
        LocationNumberMap locationNumber = null;
        LSAIdentity selectedLSAId = null;
        ISDNAddressString mscNumber = null;
        LocationInformationEPS locationInformationEPS = null;
        UserCSGInformation userCSGInformation = null;

        int mcc = HP_MCC;
        int mnc = HP_MNC;
        int lac = HP_LAC;
        int cellId = HP_CELLID;
        int ageOfLocationInformation = HP_AGE_OF_LOCATION;
        GeographicalInformation geographicalInformation = mapProvider.getMAPParameterFactory().createGeographicalInformation(HP_GEO_INFO_d, HP_GEO_INFO_d1, HP_GEO_INFO_d2);
        boolean saiPresent = false;
        GeodeticInformation geodeticInformation = null;
        boolean currentLocationRetrieved = false;
        
        CellGlobalIdOrServiceAreaIdFixedLength cellGlobalIdOrServiceAreaIdFixedLength = mapProvider.getMAPParameterFactory()
                .createCellGlobalIdOrServiceAreaIdFixedLength(mcc, mnc, lac, cellId);
        CellGlobalIdOrServiceAreaIdOrLAI cellGlobalIdOrServiceAreaIdOrLAI = mapProvider.getMAPParameterFactory().createCellGlobalIdOrServiceAreaIdOrLAI(
                cellGlobalIdOrServiceAreaIdFixedLength);
        LocationInformation li = mapProvider.getMAPParameterFactory().createLocationInformation(ageOfLocationInformation, geographicalInformation,
                vlrNumber, locationNumber, cellGlobalIdOrServiceAreaIdOrLAI, null, selectedLSAId, mscNumber, geodeticInformation,
                currentLocationRetrieved, saiPresent, locationInformationEPS, userCSGInformation);

        SubscriberState ss = this.mapProvider.getMAPParameterFactory().createSubscriberState(SubscriberStateChoice.netDetNotReachable, NotReachableReason.imsiDetached);
        
        SubscriberInfo si = this.mapProvider.getMAPParameterFactory().createSubscriberInfo(li, ss, null, null, null, null, null, null, null);
        
        // clamp InvokeID
        if (invokeId > 127) { invokeId = 127; }
        if (invokeId < -128) { invokeId = -128; }
        
        curDialog.addProvideSubscriberInfoResponse(invokeId, si, null);          
        
    } catch (MAPException e) {
        logger.error("Error while sending SendRoutingInfoForSMResponse ", e);
    }
}
 
Example 2
Source File: ProvideSubscriberInformationResp.java    From SigPloit with MIT License 4 votes vote down vote up
@Override
public void onProvideSubscriberInfoRequest(ProvideSubscriberInfoRequest provideSubscriberInfoRequest) {
    try{

        long invokeId = provideSubscriberInfoRequest.getInvokeId();

        //Creating Subscriber Information
        //cs domain info
        double Lat = 29.13;
        double Long = 31.56;
        double Uncertain = 10.123;

        //more accurate info from ps domain
        double Lat_ps = 28.113;
        double Long_ps = 32.568;
        double Uncertain_ps = 2.12;

        int mcc = 602;
        int mnc = 03;
        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);

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

        LocationInformation locationInformation = this.mapProvider.getMAPParameterFactory()
                .createLocationInformation(30,geographicalInformation,Vmsc,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);

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

        GeographicalInformation geographicalInformation_ps = this.mapProvider.getMAPParameterFactory()
                .createGeographicalInformation(Lat_ps,Long_ps,Uncertain_ps);

        RAIdentity raIdentity = this.mapProvider.getMAPParameterFactory().createRAIdentity(new byte[] {(byte) 0x06,(byte)0x0020, (byte) 0x3, (byte) 0x40,
                (byte)0x2d, (byte) 0x21});

        LocationInformationGPRS locationInformationGPRS = this.mapProvider.getMAPParameterFactory().
                createLocationInformationGPRS(null,raIdentity,geographicalInformation_ps,sgsn,null,null,false,null,
                        true,30);

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

        MAPDialogMobility mapDialogMobility = provideSubscriberInfoRequest.getMAPDialog();

        mapDialogMobility.setUserObject(invokeId);
        mapDialogMobility.addProvideSubscriberInfoResponse(invokeId,subscriberInfo,null);

        mapDialogMobility.send();

        logger.info("Subscriber Information Sent.....");

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


}