Search in sources :

Example 6 with IMSI

use of org.mobicents.protocols.ss7.map.api.primitives.IMSI in project smscgateway by RestComm.

the class MtTest method testMProc_TempFail.

@Test(groups = { "Mt" })
public void testMProc_TempFail() throws Exception {
    if (!this.cassandraDbInited)
        return;
    MProcManagement mProcManagement = MProcManagement.getInstance();
    SmscManagement smscManagement = SmscManagement.getInstance("Test");
    SmppManagement smppManagement = SmppManagement.getInstance("Test");
    smscManagement.setSmppManagement(smppManagement);
    mProcManagement.setSmscManagement(smscManagement);
    smscManagement.registerRuleFactory(new MProcRuleFactoryDefault());
    DBOperations.getInstance().stop();
    smscManagement.start();
    try {
        mProcManagement.destroyMProcRule(1);
    } catch (Exception e) {
    }
    try {
        mProcManagement.destroyMProcRule(2);
    } catch (Exception e) {
    }
    // mProcManagement.createMProcRule(1, MProcRuleFactoryDefault.RULE_CLASS_NAME,
    // "networkidmask 0 newnetworkidaftertempfail 1");
    mProcManagement.createMProcRule(1, MProcRuleFactoryDefault.RULE_CLASS_NAME, "networkidmask 0 newnetworkidafterpermfail 1");
    MAPServiceSmsProxy serviceSri = (MAPServiceSmsProxy) this.sriSbb.mapProvider.getMAPServiceSms();
    MAPServiceSmsProxy serviceMt = (MAPServiceSmsProxy) this.mtSbb.mapProvider.getMAPServiceSms();
    MAPServiceSmsProxy serviceRsds = (MAPServiceSmsProxy) this.rsdsSbb.mapProvider.getMAPServiceSms();
    SmscPropertiesManagement smscPropertiesManagement = SmscPropertiesManagement.getInstance();
    MProcManagement.getInstance("Test");
    ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
    SmsDef sd1 = new SmsDef();
    lst.add(sd1);
    SmsSet smsSet = prepareDatabase(lst);
    Sms sms1 = smsSet.getSms(0);
    // UUID smsId = sms1.getDbId();
    // SmsProxy smsx1 = this.pers.obtainArchiveSms(procDueSlot, smsSet.getDestAddr(), smsId);
    // assertNull(smsx1);
    // SmsSet smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    // assertNotNull(smsSetX);
    // Sms smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
    // assertEquals(smsX.getSmsSet().getInSystem(), 0);
    // assertEquals(SmsSetCache.getInstance().getProcessingSmsSetSize(), 1);
    // initial onSms message
    SmsSetEvent event = new SmsSetEvent();
    event.setSmsSet(smsSet);
    this.sriSbb.onSms(event, null, null);
    MAPDialogSmsProxy dlg = serviceSri.getLastMAPDialogSms();
    // assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version1));
    // assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version2));
    // assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version3));
    // assertFalse(this.mtSbb.isNegotiatedMapVersionUsing());
    // SRI response
    IMSI imsi = new IMSIImpl(imsiDig);
    ISDNAddressString networkNodeNumber = new ISDNAddressStringImpl(AddressNature.international_number, org.restcomm.protocols.ss7.map.api.primitives.NumberingPlan.ISDN, nnnDig);
    LocationInfoWithLMSI locationInfoWithLMSI = new LocationInfoWithLMSIImpl(networkNodeNumber, null, null, false, null);
    SendRoutingInfoForSMResponse evt1 = new SendRoutingInfoForSMResponseImpl(imsi, locationInfoWithLMSI, null, null, null);
    evt1.setMAPDialog(dlg);
    // MAPErrorMessage mapErrorMessage = new MAPErrorMessageAbsentSubscriberSMImpl(null, null, null);
    // ErrorComponent evt2 = new ErrorComponent(dlg, 0L, mapErrorMessage);
    MAPErrorMessage mapErrorMessage = new MAPErrorMessageUnknownSubscriberImpl(null, null);
    ErrorComponent evt2 = new ErrorComponent(dlg, 0L, mapErrorMessage);
    this.sriSbb.onErrorComponent(evt2, null);
    this.sriSbb.onDialogDelimiter(null, null);
    // ....................
    // assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version1));
    // assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version2));
    // assertTrue(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version3));
    // assertFalse(this.mtSbb.isNegotiatedMapVersionUsing());
    dlg = serviceMt.getLastMAPDialogSms();
// MAPApplicationContextVersion vers = dlg.getApplicationContext().getApplicationContextVersion();
// assertEquals(vers, MAPApplicationContextVersion.version3);
}
Also used : MProcManagement(org.mobicents.smsc.domain.MProcManagement) LocationInfoWithLMSI(org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI) MAPServiceSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy) SmsSetEvent(org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent) MAPErrorMessageUnknownSubscriberImpl(org.restcomm.protocols.ss7.map.errors.MAPErrorMessageUnknownSubscriberImpl) IMSIImpl(org.restcomm.protocols.ss7.map.primitives.IMSIImpl) ArrayList(java.util.ArrayList) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) SendRoutingInfoForSMResponse(org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse) SendRoutingInfoForSMResponseImpl(org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMResponseImpl) MProcRuleFactoryDefault(org.mobicents.smsc.mproc.impl.MProcRuleFactoryDefault) SmscManagement(org.mobicents.smsc.domain.SmscManagement) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI) SmppManagement(org.restcomm.smpp.SmppManagement) LocationInfoWithLMSIImpl(org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl) PersistenceException(org.mobicents.smsc.cassandra.PersistenceException) ErrorComponent(org.restcomm.slee.resource.map.events.ErrorComponent) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) SmscPropertiesManagement(org.mobicents.smsc.domain.SmscPropertiesManagement) Sms(org.mobicents.smsc.library.Sms) SmsSet(org.mobicents.smsc.library.SmsSet) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage) Test(org.testng.annotations.Test)

Example 7 with IMSI

use of org.mobicents.protocols.ss7.map.api.primitives.IMSI in project smscgateway by RestComm.

the class MtTest method SuccessDeliveryUsimTest.

/**
 * MAP V3, 1 message, 1 segment, USim message
 */
@Test(groups = { "Mt" })
public void SuccessDeliveryUsimTest() throws Exception {
    if (!this.cassandraDbInited)
        return;
    MAPServiceSmsProxy serviceSri = (MAPServiceSmsProxy) this.sriSbb.mapProvider.getMAPServiceSms();
    MAPServiceSmsProxy serviceMt = (MAPServiceSmsProxy) this.mtSbb.mapProvider.getMAPServiceSms();
    MAPServiceSmsProxy serviceRsds = (MAPServiceSmsProxy) this.rsdsSbb.mapProvider.getMAPServiceSms();
    SmscPropertiesManagement smscPropertiesManagement = SmscPropertiesManagement.getInstance();
    MProcManagement.getInstance("Test");
    ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
    SmsDef sd1 = new SmsDef();
    sd1.dataCodingScheme = 246;
    sd1.esmClass = 0x43;
    sd1.msg = "012345012345";
    sd1.msgUdh = new byte[] { 2, 112, 0 };
    lst.add(sd1);
    SmsSet smsSet = prepareDatabase(lst);
    // SmsSet smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(smsSet.getTargetId());
    // assertNotNull(smsSetX);
    // Sms smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
    // assertEquals(smsX.getSmsSet().getInSystem(), 0);
    // initial onSms message
    SmsSetEvent event = new SmsSetEvent();
    event.setSmsSet(smsSet);
    this.sriSbb.onSms(event, null, null);
    MAPDialogSmsProxy dlg = serviceSri.getLastMAPDialogSms();
    // MAPApplicationContextVersion acv =  dlg.getApplicationContext().getApplicationContextVersion();
    // assertEquals(acv, MAPApplicationContextVersion.version3);
    // assertNull(serviceMt.getLastMAPDialogSms());
    // ArrayList<MAPTestEvent> lstEvt = dlg.getEventList();
    // assertEquals(lstEvt.size(), 2);
    // assertEquals(dlg.getLocalAddress().getGlobalTitle().getDigits(), smscPropertiesManagement.getServiceCenterGt());
    // assertEquals(((GlobalTitle0100) dlg.getLocalAddress().getGlobalTitle()).getNumberingPlan(), org.restcomm.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY);
    // assertEquals(((GlobalTitle0100) dlg.getLocalAddress().getGlobalTitle()).getNatureOfAddress(), NatureOfAddress.INTERNATIONAL);
    // assertEquals(dlg.getRemoteAddress().getGlobalTitle().getDigits(), msdnDig);
    // assertEquals(((GlobalTitle0100) dlg.getRemoteAddress().getGlobalTitle()).getNumberingPlan(), org.restcomm.protocols.ss7.indicator.NumberingPlan.ISDN_TELEPHONY);
    // assertEquals(((GlobalTitle0100) dlg.getRemoteAddress().getGlobalTitle()).getNatureOfAddress(), NatureOfAddress.INTERNATIONAL);
    // 
    // MAPTestEvent evt = lstEvt.get(0);
    // assertEquals(evt.testEventType, MAPTestEventType.componentAdded);
    // SendRoutingInfoForSMRequest sriReq = (SendRoutingInfoForSMRequest) evt.event;
    // assertEquals(sriReq.getMsisdn().getAddress(), msdnDig);
    // assertEquals(sriReq.getMsisdn().getAddressNature(), AddressNature.international_number);
    // assertEquals(sriReq.getMsisdn().getNumberingPlan(), org.restcomm.protocols.ss7.map.api.primitives.NumberingPlan.ISDN);
    // assertEquals(sriReq.getServiceCentreAddress().getAddress(), smscPropertiesManagement.getServiceCenterGt());
    // assertEquals(sriReq.getServiceCentreAddress().getAddressNature(), AddressNature.international_number);
    // assertEquals(sriReq.getServiceCentreAddress().getNumberingPlan(), org.restcomm.protocols.ss7.map.api.primitives.NumberingPlan.ISDN);
    // assertTrue(sriReq.getSm_RP_PRI());
    // evt = lstEvt.get(1);
    // assertEquals(evt.testEventType, MAPTestEventType.send);
    // smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(smsSet.getTargetId());
    // assertNotNull(smsSetX);
    // smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
    // assertEquals(smsX.getSmsSet().getInSystem(), 0);
    // SRI response
    IMSI imsi = new IMSIImpl(imsiDig);
    ISDNAddressString networkNodeNumber = new ISDNAddressStringImpl(AddressNature.international_number, org.restcomm.protocols.ss7.map.api.primitives.NumberingPlan.ISDN, nnnDig);
    LocationInfoWithLMSI locationInfoWithLMSI = new LocationInfoWithLMSIImpl(networkNodeNumber, null, null, false, null);
    SendRoutingInfoForSMResponse evt1 = new SendRoutingInfoForSMResponseImpl(imsi, locationInfoWithLMSI, null, null, null);
    evt1.setMAPDialog(dlg);
    this.sriSbb.onSendRoutingInfoForSMResponse(evt1, null);
    this.sriSbb.onDialogDelimiter(null, null);
    dlg = serviceMt.getLastMAPDialogSms();
    // acv =  dlg.getApplicationContext().getApplicationContextVersion();
    // assertEquals(acv, MAPApplicationContextVersion.version3);
    // 
    // lstEvt = dlg.getEventList();
    // assertEquals(lstEvt.size(), 2);
    dlg = serviceMt.getLastMAPDialogSms();
    ArrayList<MAPTestEvent> lstEvt = dlg.getEventList();
    assertEquals(lstEvt.size(), 2);
    MAPTestEvent evt = lstEvt.get(0);
    assertEquals(evt.testEventType, MAPTestEventType.componentAdded);
    MtForwardShortMessageRequestImpl mtFsmReq = (MtForwardShortMessageRequestImpl) evt.event;
    assertFalse(mtFsmReq.getMoreMessagesToSend());
    SM_RP_DA sm_RP_DA = mtFsmReq.getSM_RP_DA();
    IMSI daImsi = sm_RP_DA.getIMSI();
    assertEquals(daImsi.getData(), imsiDig);
    SM_RP_OA sm_RP_OA = mtFsmReq.getSM_RP_OA();
    AddressString scas = sm_RP_OA.getServiceCentreAddressOA();
    assertEquals(scas.getAddress(), smscPropertiesManagement.getServiceCenterGt());
    assertEquals(scas.getAddressNature(), AddressNature.international_number);
    assertEquals(scas.getNumberingPlan(), org.restcomm.protocols.ss7.map.api.primitives.NumberingPlan.ISDN);
    SmsSignalInfo ssi = mtFsmReq.getSM_RP_UI();
    SmsDeliverTpdu tpdu = (SmsDeliverTpdu) ssi.decodeTpdu(false);
// assertEquals(tpdu.getDataCodingScheme().getCode(), 16);
// assertFalse(tpdu.getForwardedOrSpawned());
// assertFalse(tpdu.getMoreMessagesToSend());
// assertEquals(tpdu.getOriginatingAddress().getAddressValue(), origDig);
// assertEquals(tpdu.getOriginatingAddress().getNumberingPlanIdentification(), NumberingPlanIdentification.ISDNTelephoneNumberingPlan);
// assertEquals(tpdu.getOriginatingAddress().getTypeOfNumber(), TypeOfNumber.InternationalNumber);
// assertEquals(tpdu.getProtocolIdentifier().getCode(), 7);
// assertFalse(tpdu.getReplyPathExists());
// assertEquals(tpdu.getServiceCentreTimeStamp().getDay(), curDate.getDate());
// int mon1 = tpdu.getServiceCentreTimeStamp().getMonth();
// int mon2 = curDate.getMonth() + 1;
// assertEquals(mon1, mon2);
// assertEquals(tpdu.getSmsTpduType(), SmsTpduType.SMS_DELIVER);
// assertFalse(tpdu.getStatusReportIndication());
// assertFalse(tpdu.getUserDataHeaderIndicator());
// UserData ud = tpdu.getUserData();
// ud.decode();
// assertNull(ud.getDecodedUserDataHeader());
// String msg1 = ud.getDecodedMessage();
// assertEquals(msg1, msgShort);
// 
// //        evt = lstEvt.get(1);
// //        assertEquals(evt.testEventType, MAPTestEventType.send);
// //        smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(smsSet.getTargetId());
// //        assertNotNull(smsSetX);
// //        smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
// //        assertEquals(smsX.getSmsSet().getInSystem(), 0);
// //
// //        UUID smsId = smsSet.getSms(0).getDbId();
// //        SmsProxy smsx2 = this.pers.obtainArchiveSms(procDueSlot, smsSet.getDestAddr(), smsId);
// //        assertNull(smsx2);
// 
// // Mt response
// MtForwardShortMessageResponseImpl evt2 = new MtForwardShortMessageResponseImpl(null, null);
// evt2.setMAPDialog(dlg);
// DialogAccept daevt = new DialogAccept(dlg, null);
// this.mtSbb.onDialogAccept(daevt, null);
// this.mtSbb.onMtForwardShortMessageResponse(evt2, null);
// DialogClose dcl = new DialogClose(dlg);
// this.mtSbb.onDialogClose(dcl, null);
// //        smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(smsSet.getTargetId());
// //        assertNull(smsSetX);
// //        smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
// //        assertNull(smsX);
// 
// //        dlg = serviceSri.getLastMAPDialogSms();
// //        lstEvt = dlg.getEventList();
// //        assertEquals(lstEvt.size(), 2);
// //
// //        dlg = serviceMt.getLastMAPDialogSms();
// //        lstEvt = dlg.getEventList();
// //        assertEquals(lstEvt.size(), 2);
// //
// //        int b1 = this.pers.checkSmsExists(procDueSlot, smsSet.getTargetId());
// //        smsx2 = this.pers.obtainArchiveSms(procDueSlot, smsSet.getDestAddr(), smsId);
// //        assertNotNull(smsx2);
// //
// //        dlg = serviceRsds.getLastMAPDialogSms();
// //        assertNull(dlg);
}
Also used : SmsDeliverTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsDeliverTpdu) LocationInfoWithLMSI(org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI) MAPServiceSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy) SmsSetEvent(org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) IMSIImpl(org.restcomm.protocols.ss7.map.primitives.IMSIImpl) ArrayList(java.util.ArrayList) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) SM_RP_OA(org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_OA) LocationInfoWithLMSIImpl(org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl) MAPTestEvent(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy.MAPTestEvent) SendRoutingInfoForSMResponse(org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse) SendRoutingInfoForSMResponseImpl(org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMResponseImpl) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) SmsSignalInfo(org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) SmscPropertiesManagement(org.mobicents.smsc.domain.SmscPropertiesManagement) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI) MtForwardShortMessageRequestImpl(org.restcomm.protocols.ss7.map.service.sms.MtForwardShortMessageRequestImpl) SmsSet(org.mobicents.smsc.library.SmsSet) SM_RP_DA(org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA) Test(org.testng.annotations.Test)

Example 8 with IMSI

use of org.mobicents.protocols.ss7.map.api.primitives.IMSI in project smscgateway by RestComm.

the class MtSbb method setupMtForwardShortMessageRequest.

// *********
// Main service methods
public void setupMtForwardShortMessageRequest(ISDNAddressString networkNode, String imsiData, LMSI lmsi, int networkId) {
    if (this.logger.isFineEnabled()) {
        this.logger.fine("mperforming setupMtForwardShortMessageRequest ISDNAddressString= " + networkNode);
    }
    SmsSet smsSet = getSmsSet();
    if (smsSet == null) {
        markDeliveringIsEnded(true);
        logger.severe("MtSbb.setupMtForwardShortMessageRequest(): CMP smsSet is missed");
        return;
    }
    Sms sms0 = smsSet.getSms(0);
    Integer mtRemoteSccpTt = sms0.getMtRemoteSccpTt();
    SccpAddress networkNodeSccpAddress = this.getMSCSccpAddress(networkNode, mtRemoteSccpTt);
    IMSI imsi = this.mapParameterFactory.createIMSI(imsiData);
    SM_RP_DA sm_RP_DA = this.mapParameterFactory.createSM_RP_DA(imsi);
    AddressString scAddress = this.getServiceCenterAddressString(networkId);
    SM_RP_OA sm_RP_OA = this.mapParameterFactory.createSM_RP_OA_ServiceCentreAddressOA(scAddress);
    if (sms0 != null) {
        // we only set it for first sms in the list
        sms0.setMtServiceCenterAddress(scAddress.getAddress());
    }
    this.setNnn(networkNode);
    this.setNetworkNode(networkNodeSccpAddress);
    this.setSmRpDa(sm_RP_DA);
    this.setSmRpOa(sm_RP_OA);
    // Set cache with MAP version
    MAPApplicationContextVersion mapApplicationContextVersion = mapVersionCache.getMAPApplicationContextVersion(networkNode.getAddress());
    if (mapApplicationContextVersion == null) {
        mapApplicationContextVersion = MAPApplicationContextVersion.getInstance(smscPropertiesManagement.getMaxMapVersion());
    } else {
        this.setNegotiatedMapVersionUsing(true);
    }
    this.setMAPVersionTested(mapApplicationContextVersion);
    // dropaftersri mproc rules
    try {
        if (this.getTotalUnsentMessageCount() > 0) {
            ArrayList<Sms> lstPermFailured = new ArrayList<Sms>();
            ArrayList<Sms> lstRerouted = new ArrayList<Sms>();
            ArrayList<Integer> lstNewNetworkId = new ArrayList<Integer>();
            TargetAddress lock = persistence.obtainSynchroObject(new TargetAddress(smsSet));
            try {
                synchronized (lock) {
                    this.applyMprocRulesOnImsiResponse(smsSet, lstPermFailured, lstRerouted, lstNewNetworkId, networkNode, imsiData);
                    this.onImsiDrop(smsSet, lstPermFailured, lstRerouted, lstNewNetworkId, networkNode, imsiData);
                }
            } finally {
                persistence.releaseSynchroObject(lock);
            }
        }
    } catch (Throwable e) {
    }
    if (this.getTotalUnsentMessageCount() == 0) {
        setupReportSMDeliveryStatusRequestSuccess(smsSet, true);
        smsSet.setStatus(ErrorCode.SUCCESS);
        this.markDeliveringIsEnded(true);
    } else {
        try {
            this.sendMtSms(this.getMtFoSMSMAPApplicationContext(mapApplicationContextVersion), MessageProcessingState.firstMessageSending, null, smsSet.getNetworkId());
        } catch (SmscProcessingException e) {
            String reason = "SmscPocessingException when invoking sendMtSms() from setupMtForwardShortMessageRequest()-firstMessageSending: " + e.toString();
            this.logger.severe(reason, e);
            ErrorCode smStatus = ErrorCode.SC_SYSTEM_ERROR;
            try {
                smStatus = ErrorCode.fromInt(e.getSmppErrorCode());
            } catch (IllegalArgumentException e1) {
            }
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, smStatus, reason, true, null, false, ProcessingType.SS7_MT);
        } catch (Throwable e) {
            String reason = "Exception when invoking sendMtSms() from setupMtForwardShortMessageRequest()-firstMessageSending: " + e.toString();
            this.logger.severe(reason, e);
            ErrorCode smStatus = ErrorCode.SC_SYSTEM_ERROR;
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, smStatus, reason, true, null, false, ProcessingType.SS7_MT);
        }
    }
}
Also used : SccpAddress(org.restcomm.protocols.ss7.sccp.parameter.SccpAddress) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) SmscProcessingException(org.mobicents.smsc.library.SmscProcessingException) ArrayList(java.util.ArrayList) SM_RP_OA(org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_OA) TargetAddress(org.mobicents.smsc.library.TargetAddress) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) MAPApplicationContextVersion(org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPErrorMessageSubscriberBusyForMtSms(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms) Sms(org.mobicents.smsc.library.Sms) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI) ErrorCode(org.mobicents.smsc.library.ErrorCode) MAPErrorCode(org.restcomm.protocols.ss7.map.api.errors.MAPErrorCode) SmsSet(org.mobicents.smsc.library.SmsSet) SM_RP_DA(org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA)

Example 9 with IMSI

use of org.mobicents.protocols.ss7.map.api.primitives.IMSI in project smscgateway by RestComm.

the class MoSbb method processMtMessage.

// *********
// incoming message processing
private Sms processMtMessage(SM_RP_OA smRPOA, SM_RP_DA smRPDA, SmsSignalInfo smsSignalInfo, int networkId, String originatorSccpAddress, boolean isMoOperation, MAPDialogSms dialog, SmsMessage evt, long invokeId) throws SmscProcessingException {
    Sms sms = null;
    smsSignalInfo.setGsm8Charset(isoCharset);
    IMSI destinationImsi = smRPDA.getIMSI();
    if (destinationImsi == null) {
        throw new SmscProcessingException("Home routing: Mt DA IMSI is absent", SmppConstants.STATUS_SYSERR, MAPErrorCode.unexpectedDataValue, SmscProcessingException.HTTP_ERROR_CODE_NOT_SET, null);
    }
    // obtaining correlationId
    String correlationID = destinationImsi.getData();
    CorrelationIdValue civ;
    try {
        civ = SmsSetCache.getInstance().getCorrelationIdCacheElement(correlationID);
    } catch (Exception e) {
        throw new SmscProcessingException("Home routing: Error when getting of CorrelationIdCacheElement", SmppConstants.STATUS_SYSERR, MAPErrorCode.systemFailure, SmscProcessingException.HTTP_ERROR_CODE_NOT_SET, null, e);
    }
    if (civ == null) {
        smscStatAggregator.updateHomeRoutingCorrIdFail();
        throw new SmscProcessingException("Home routing: No data is found for: CorrelationId=" + correlationID, SmppConstants.STATUS_SYSERR, MAPErrorCode.systemFailure, SmscProcessingException.HTTP_ERROR_CODE_NOT_SET, null);
    }
    SmsTpdu smsTpdu = null;
    try {
        smsTpdu = smsSignalInfo.decodeTpdu(false);
        logger.fine("Home routing: The SmsTpduType is " + smsTpdu.getSmsTpduType());
        switch(smsTpdu.getSmsTpduType()) {
            case SMS_DELIVER:
                SmsDeliverTpdu smsDeliverTpdu = (SmsDeliverTpdu) smsTpdu;
                if (this.logger.isInfoEnabled()) {
                    this.logger.info("Home routing: Received SMS_DELIVER = " + smsDeliverTpdu);
                }
                // AddressField af = smsSubmitTpdu.getDestinationAddress();
                sms = this.handleSmsDeliverTpdu(smsDeliverTpdu, civ, networkId, originatorSccpAddress, isMoOperation, dialog, evt, invokeId);
                break;
            default:
                this.logger.severe("Home routing: Received non SMS_DELIVER = " + smsTpdu);
                break;
        }
    } catch (MAPException e1) {
        logger.severe("Home routing: Error while decoding SmsSignalInfo ", e1);
    }
    return sms;
}
Also used : SmsDeliverTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsDeliverTpdu) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) SmsTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsTpdu) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) MAPException(org.restcomm.protocols.ss7.map.api.MAPException)

Example 10 with IMSI

use of org.mobicents.protocols.ss7.map.api.primitives.IMSI in project smscgateway by RestComm.

the class HrSriServerSbb method doSendResponse.

private void doSendResponse(CorrelationIdValue correlationIdValue, MAPDialogSms dlg, String imsiValue, LocationInfoWithLMSI li) throws MAPException {
    long invokeId = this.getInvokeId();
    IMSI imsi = this.mapParameterFactory.createIMSI(imsiValue);
    MWStatus mwStatus = correlationIdValue.getMwStatus();
    Boolean mwdSet = null;
    if (dlg.getApplicationContext().getApplicationContextVersion() == MAPApplicationContextVersion.version1) {
        if (mwStatus != null) {
            if (mwStatus.getMnrfSet())
                mwdSet = true;
            mwStatus = null;
        }
    }
    dlg.addSendRoutingInfoForSMResponse(invokeId, imsi, li, null, mwdSet, null);
    InformServiceCentreRequest isc = correlationIdValue.getInformServiceCentreRequest();
    if (mwStatus != null && isc != null) {
        dlg.addInformServiceCentreRequest(isc.getStoredMSISDN(), isc.getMwStatus(), null, isc.getAbsentSubscriberDiagnosticSM(), isc.getAdditionalAbsentSubscriberDiagnosticSM());
    }
    dlg.close(false);
}
Also used : MWStatus(org.restcomm.protocols.ss7.map.api.service.sms.MWStatus) InformServiceCentreRequest(org.restcomm.protocols.ss7.map.api.service.sms.InformServiceCentreRequest) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI)

Aggregations

IMSI (org.restcomm.protocols.ss7.map.api.primitives.IMSI)20 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)19 ArrayList (java.util.ArrayList)17 SmsSet (org.mobicents.smsc.library.SmsSet)17 LocationInfoWithLMSI (org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI)17 IMSIImpl (org.restcomm.protocols.ss7.map.primitives.IMSIImpl)17 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)17 LocationInfoWithLMSIImpl (org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl)17 SmscPropertiesManagement (org.mobicents.smsc.domain.SmscPropertiesManagement)16 Sms (org.mobicents.smsc.library.Sms)16 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)16 MAPServiceSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy)16 SmsSetEvent (org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent)16 SendRoutingInfoForSMResponse (org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse)16 SendRoutingInfoForSMResponseImpl (org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMResponseImpl)16 Test (org.testng.annotations.Test)16 MAPApplicationContextVersion (org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion)15 UUID (java.util.UUID)14 SmsProxy (org.mobicents.smsc.slee.resources.persistence.SmsProxy)14 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)14