Search in sources :

Example 11 with LocationInfoWithLMSI

use of org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI in project smscgateway by RestComm.

the class CassandraTest method archiveMessage.

public void archiveMessage(SmsSet smsSet, String[] remoteMessageId, String esmeId) throws Exception {
    for (int i1 = 0; i1 < 3; i1++) {
        Sms sms = smsSet.getSms(i1);
        sms.getSmsSet().setType(SmType.SMS_FOR_SS7);
        sms.getSmsSet().setImsi("12345678900000");
        ISDNAddressStringImpl networkNodeNumber = new ISDNAddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "2223334444");
        LocationInfoWithLMSIImpl locationInfoWithLMSI = new LocationInfoWithLMSIImpl(networkNodeNumber, null, null, false, null);
        sms.getSmsSet().setLocationInfoWithLMSI(locationInfoWithLMSI);
        sbb.c2_createRecordArchive(sms, remoteMessageId[i1], esmeId, true, true);
    }
    Sms sms = smsSet.getSms(0);
    SmsProxy smsx = sbb.obtainArchiveSms(sms.getDueSlot(), sms.getSmsSet().getDestAddr(), sms.getDbId());
    this.checkTestSms(1, smsx.sms, sms.getDbId(), true);
    Sms smsy = sbb.c2_getRecordArchiveForMessageId(sms.getMessageId());
    this.checkTestSms(1, smsy, sms.getDbId(), true);
    Long messageId = sbb.c2_getMessageIdByRemoteMessageId(remoteMessageId[0], esmeId);
    assertNotNull(messageId);
    assertEquals((long) messageId, sms.getMessageId());
}
Also used : ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) Sms(org.mobicents.smsc.library.Sms) LocationInfoWithLMSIImpl(org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl)

Example 12 with LocationInfoWithLMSI

use of org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI in project smscgateway by RestComm.

the class SriSbb method executeForwardSM.

private void executeForwardSM(SmsSet smsSet, LocationInfoWithLMSI locationInfoWithLMSI, String imsi, int networkId) {
    smsSet.setImsi(imsi);
    smsSet.setLocationInfoWithLMSI(locationInfoWithLMSI);
    ISDNAddressString networkNodeNumber = locationInfoWithLMSI.getNetworkNodeNumber();
    MtSbbLocalObject mtSbbLocalObject = this.getMtSbbObject();
    if (mtSbbLocalObject != null) {
        ActivityContextInterface schedulerActivityContextInterface = this.getSchedulerActivityContextInterface();
        schedulerActivityContextInterface.attach(mtSbbLocalObject);
        SendMtEvent event = new SendMtEvent();
        event.setSmsSet(smsSet);
        event.setImsiData(imsi);
        event.setLmsi(locationInfoWithLMSI.getLMSI());
        event.setNetworkNode(networkNodeNumber);
        event.setInformServiceCenterContainer(this.getInformServiceCenterContainer());
        event.setSriMapVersion(this.getSriMapVersion());
        event.setCurrentMsgNum(this.getCurrentMsgNumValue());
        event.setTimerID(this.getDeliveryTimerID());
        // event.setSendingPoolMsgCount(this.getSendingPoolMsgCountValue());
        this.fireSendMtEvent(event, schedulerActivityContextInterface, null);
    }
}
Also used : ActivityContextInterface(javax.slee.ActivityContextInterface) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) SendMtEvent(org.mobicents.smsc.slee.services.smpp.server.events.SendMtEvent)

Example 13 with LocationInfoWithLMSI

use of org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI 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)

Example 14 with LocationInfoWithLMSI

use of org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI in project smscgateway by RestComm.

the class MtTest method MapVersionNegotiationTest.

/**
 * MAP V3 -> MAP V3 -> MAP V1 (Reject - Alternative ANC)
 */
@Test(groups = { "Mt" })
public void MapVersionNegotiationTest() 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();
    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);
    this.sriSbb.onSendRoutingInfoForSMResponse(evt1, 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);
    ApplicationContextNameImpl acn = new ApplicationContextNameImpl();
    acn.setOid(new long[] { 0, 4, 0, 0, 1, 0, 25, 2 });
    DialogReject evt5 = new DialogReject(dlg, MAPRefuseReason.ApplicationContextNotSupported, acn, null);
    this.mtSbb.onDialogReject(evt5, null);
    assertFalse(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version1));
    assertTrue(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version2));
    assertTrue(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version3));
    assertFalse(this.mtSbb.isNegotiatedMapVersionUsing());
    dlg = serviceMt.getLastMAPDialogSms();
    vers = dlg.getApplicationContext().getApplicationContextVersion();
    assertEquals(vers, MAPApplicationContextVersion.version2);
    acn = new ApplicationContextNameImpl();
    acn.setOid(new long[] { 0, 4, 0, 0, 1, 0, 25, 2 });
    evt5 = new DialogReject(dlg, MAPRefuseReason.ApplicationContextNotSupported, acn, null);
    this.mtSbb.onDialogReject(evt5, null);
    assertTrue(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version1));
    assertTrue(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version2));
    assertTrue(this.mtSbb.isMAPVersionTested(MAPApplicationContextVersion.version3));
    assertFalse(this.mtSbb.isNegotiatedMapVersionUsing());
    dlg = serviceMt.getLastMAPDialogSms();
    vers = dlg.getApplicationContext().getApplicationContextVersion();
    assertEquals(vers, MAPApplicationContextVersion.version1);
}
Also used : 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) IMSIImpl(org.restcomm.protocols.ss7.map.primitives.IMSIImpl) DialogReject(org.restcomm.slee.resource.map.events.DialogReject) ArrayList(java.util.ArrayList) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) LocationInfoWithLMSIImpl(org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl) SendRoutingInfoForSMResponse(org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse) MAPApplicationContextVersion(org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion) SendRoutingInfoForSMResponseImpl(org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMResponseImpl) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) SmscPropertiesManagement(org.mobicents.smsc.domain.SmscPropertiesManagement) SmsProxy(org.mobicents.smsc.slee.resources.persistence.SmsProxy) MAPServiceSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) Sms(org.mobicents.smsc.library.Sms) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI) ApplicationContextNameImpl(org.restcomm.protocols.ss7.tcap.asn.ApplicationContextNameImpl) UUID(java.util.UUID) SmsSet(org.mobicents.smsc.library.SmsSet) Test(org.testng.annotations.Test)

Example 15 with LocationInfoWithLMSI

use of org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI in project smscgateway by RestComm.

the class MtTest method SuccessDelivery3Test.

/**
 * MAP V1, 1 message, long message with 2 segments, GSM7
 * no TC-BEGIN message because of MAP V1
 * SRI response with MwdSet, but no ReportSMDeliveryStatusRequest because of MAP V1
 */
@Test(groups = { "Mt" })
public void SuccessDelivery3Test() 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();
    lst.add(sd1);
    StringBuilder sb = new StringBuilder();
    for (int i1 = 0; i1 < 18; i1++) {
        // msg len = 180
        sb.append("0123456789");
    }
    String totalMsg = sb.toString();
    int segmlen = MessageUtil.getMaxSegmentedMessageBytesLength(new DataCodingSchemeImpl(0));
    String msga1 = totalMsg.substring(0, segmlen);
    String msga2 = totalMsg.substring(segmlen);
    sd1.msg = totalMsg;
    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();
    MAPApplicationContextVersion acv = dlg.getApplicationContext().getApplicationContextVersion();
    assertEquals(acv, MAPApplicationContextVersion.version3);
    ArrayList<MAPTestEvent> lstEvt = dlg.getEventList();
    assertEquals(lstEvt.size(), 2);
    assertNull(serviceMt.getLastMAPDialogSms());
    // SRI "MAP only V1 supported" response
    DialogReject evt11 = new DialogReject(dlg, MAPRefuseReason.PotentialVersionIncompatibility, null, null);
    this.sriSbb.onDialogReject(evt11, null);
    dlg = serviceSri.getLastMAPDialogSms();
    acv = dlg.getApplicationContext().getApplicationContextVersion();
    assertEquals(acv, MAPApplicationContextVersion.version1);
    assertNull(serviceMt.getLastMAPDialogSms());
    lstEvt = dlg.getEventList();
    assertEquals(lstEvt.size(), 2);
    assertEquals(dlg.getLocalAddress().getGlobalTitle().getDigits(), smscPropertiesManagement.getServiceCenterGt());
    assertEquals(dlg.getRemoteAddress().getGlobalTitle().getDigits(), msdnDig);
    MAPTestEvent evt = lstEvt.get(0);
    assertEquals(evt.testEventType, MAPTestEventType.componentAdded);
    SendRoutingInfoForSMRequest sriReq = (SendRoutingInfoForSMRequest) evt.event;
    assertEquals(sriReq.getMsisdn().getAddress(), msdnDig);
    assertEquals(sriReq.getServiceCentreAddress().getAddress(), smscPropertiesManagement.getServiceCenterGt());
    evt = lstEvt.get(1);
    assertEquals(evt.testEventType, MAPTestEventType.send);
    // 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, true, 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();
    // Empty TC-BEGIN for MAP V3
    assertEquals(lstEvt.size(), 3);
    // SRI "MAP only V1 supported" response
    DialogReject evt12 = new DialogReject(dlg, MAPRefuseReason.PotentialVersionIncompatibility, null, null);
    this.mtSbb.onDialogReject(evt12, null);
    dlg = serviceMt.getLastMAPDialogSms();
    acv = dlg.getApplicationContext().getApplicationContextVersion();
    assertEquals(acv, MAPApplicationContextVersion.version1);
    lstEvt = dlg.getEventList();
    assertEquals(lstEvt.size(), 2);
    evt = lstEvt.get(0);
    assertEquals(evt.testEventType, MAPTestEventType.componentAdded);
    ForwardShortMessageRequestImpl mtFsmReq = (ForwardShortMessageRequestImpl) evt.event;
    assertTrue(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());
    SmsSignalInfo ssi = mtFsmReq.getSM_RP_UI();
    SmsDeliverTpdu tpdu = (SmsDeliverTpdu) ssi.decodeTpdu(false);
    assertEquals(tpdu.getDataCodingScheme().getCode(), 0);
    assertFalse(tpdu.getForwardedOrSpawned());
    assertTrue(tpdu.getMoreMessagesToSend());
    assertEquals(tpdu.getOriginatingAddress().getAddressValue(), origDig);
    assertFalse(tpdu.getReplyPathExists());
    assertEquals(tpdu.getSmsTpduType(), SmsTpduType.SMS_DELIVER);
    assertFalse(tpdu.getStatusReportIndication());
    assertTrue(tpdu.getUserDataHeaderIndicator());
    UserData ud = tpdu.getUserData();
    ud.decode();
    UserDataHeader udh = ud.getDecodedUserDataHeader();
    ConcatenatedShortMessagesIdentifier csm = udh.getConcatenatedShortMessagesIdentifier();
    assertEquals(csm.getReference(), 1);
    assertEquals(csm.getMesageSegmentCount(), 2);
    assertEquals(csm.getMesageSegmentNumber(), 1);
    String msg1 = ud.getDecodedMessage();
    assertEquals(msg1, msga1);
    evt = lstEvt.get(1);
    assertEquals(evt.testEventType, MAPTestEventType.send);
    smsId = sms1.getDbId();
    smsx1 = this.pers.obtainArchiveSms(procDueSlot, smsSet.getDestAddr(), smsId);
    assertNull(smsx1);
    smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    assertNotNull(smsSetX);
    smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
    assertEquals(smsX.getSmsSet().getInSystem(), 0);
    assertEquals(SmsSetCache.getInstance().getProcessingSmsSetSize(), 1);
    // Mt response 1
    ForwardShortMessageResponseImpl evt2 = new ForwardShortMessageResponseImpl();
    evt2.setMAPDialog(dlg);
    DialogAccept daevt = new DialogAccept(dlg, null);
    this.mtSbb.onDialogAccept(daevt, null);
    this.mtSbb.onForwardShortMessageResponse(evt2, null);
    DialogClose dcl = new DialogClose(dlg);
    this.mtSbb.onDialogClose(dcl, null);
    dlg = serviceMt.getLastMAPDialogSms();
    acv = dlg.getApplicationContext().getApplicationContextVersion();
    assertEquals(acv, MAPApplicationContextVersion.version1);
    lstEvt = dlg.getEventList();
    assertEquals(lstEvt.size(), 2);
    evt = lstEvt.get(0);
    assertEquals(evt.testEventType, MAPTestEventType.componentAdded);
    mtFsmReq = (ForwardShortMessageRequestImpl) evt.event;
    assertFalse(mtFsmReq.getMoreMessagesToSend());
    sm_RP_DA = mtFsmReq.getSM_RP_DA();
    daImsi = sm_RP_DA.getIMSI();
    assertEquals(daImsi.getData(), imsiDig);
    sm_RP_OA = mtFsmReq.getSM_RP_OA();
    scas = sm_RP_OA.getServiceCentreAddressOA();
    assertEquals(scas.getAddress(), smscPropertiesManagement.getServiceCenterGt());
    ssi = mtFsmReq.getSM_RP_UI();
    tpdu = (SmsDeliverTpdu) ssi.decodeTpdu(false);
    assertEquals(tpdu.getDataCodingScheme().getCode(), 0);
    assertFalse(tpdu.getForwardedOrSpawned());
    assertFalse(tpdu.getMoreMessagesToSend());
    assertEquals(tpdu.getOriginatingAddress().getAddressValue(), origDig);
    assertFalse(tpdu.getReplyPathExists());
    assertEquals(tpdu.getSmsTpduType(), SmsTpduType.SMS_DELIVER);
    assertFalse(tpdu.getStatusReportIndication());
    assertTrue(tpdu.getUserDataHeaderIndicator());
    ud = tpdu.getUserData();
    ud.decode();
    udh = ud.getDecodedUserDataHeader();
    csm = udh.getConcatenatedShortMessagesIdentifier();
    assertEquals(csm.getReference(), 1);
    assertEquals(csm.getMesageSegmentCount(), 2);
    assertEquals(csm.getMesageSegmentNumber(), 2);
    String msg2 = ud.getDecodedMessage();
    assertEquals(msg2, msga2);
    evt = lstEvt.get(1);
    assertEquals(evt.testEventType, MAPTestEventType.send);
    smsId = sms1.getDbId();
    smsx1 = this.pers.obtainArchiveSms(procDueSlot, smsSet.getDestAddr(), smsId);
    assertNull(smsx1);
    smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    assertNotNull(smsSetX);
    smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
    assertEquals(smsX.getSmsSet().getInSystem(), 0);
    assertEquals(SmsSetCache.getInstance().getProcessingSmsSetSize(), 1);
    // Mt response 2
    evt2 = new ForwardShortMessageResponseImpl();
    evt2.setMAPDialog(dlg);
    daevt = new DialogAccept(dlg, null);
    this.mtSbb.onDialogAccept(daevt, null);
    this.mtSbb.onForwardShortMessageResponse(evt2, null);
    dcl = new DialogClose(dlg);
    this.mtSbb.onDialogClose(dcl, null);
    dlg = serviceRsds.getLastMAPDialogSms();
    assertNull(dlg);
    dlg = serviceSri.getLastMAPDialogSms();
    lstEvt = dlg.getEventList();
    assertEquals(lstEvt.size(), 2);
    dlg = serviceMt.getLastMAPDialogSms();
    lstEvt = dlg.getEventList();
    assertEquals(lstEvt.size(), 2);
    smsId = sms1.getDbId();
    smsx1 = this.pers.obtainArchiveSms(procDueSlot, smsSet.getDestAddr(), smsId);
    assertNotNull(smsx1);
    smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    assertNull(smsSetX);
    smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId[0]);
    assertNull(smsX);
    assertEquals(SmsSetCache.getInstance().getProcessingSmsSetSize(), 0);
}
Also used : SmsDeliverTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsDeliverTpdu) SendRoutingInfoForSMRequest(org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMRequest) 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) DialogReject(org.restcomm.slee.resource.map.events.DialogReject) IMSIImpl(org.restcomm.protocols.ss7.map.primitives.IMSIImpl) UserData(org.restcomm.protocols.ss7.map.api.smstpdu.UserData) 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) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) DataCodingSchemeImpl(org.restcomm.protocols.ss7.map.smstpdu.DataCodingSchemeImpl) SendRoutingInfoForSMResponse(org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse) MAPApplicationContextVersion(org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion) SendRoutingInfoForSMResponseImpl(org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMResponseImpl) DialogAccept(org.restcomm.slee.resource.map.events.DialogAccept) SmsSignalInfo(org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo) SmsProxy(org.mobicents.smsc.slee.resources.persistence.SmsProxy) MAPServiceSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) IMSI(org.restcomm.protocols.ss7.map.api.primitives.IMSI) UUID(java.util.UUID) UserDataHeader(org.restcomm.protocols.ss7.map.api.smstpdu.UserDataHeader) ForwardShortMessageRequestImpl(org.restcomm.protocols.ss7.map.service.sms.ForwardShortMessageRequestImpl) MtForwardShortMessageRequestImpl(org.restcomm.protocols.ss7.map.service.sms.MtForwardShortMessageRequestImpl) ConcatenatedShortMessagesIdentifier(org.restcomm.protocols.ss7.map.api.smstpdu.ConcatenatedShortMessagesIdentifier) ForwardShortMessageResponseImpl(org.restcomm.protocols.ss7.map.service.sms.ForwardShortMessageResponseImpl) MtForwardShortMessageResponseImpl(org.restcomm.protocols.ss7.map.service.sms.MtForwardShortMessageResponseImpl) LocationInfoWithLMSIImpl(org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl) MAPTestEvent(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy.MAPTestEvent) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) DialogClose(org.restcomm.slee.resource.map.events.DialogClose) SmscPropertiesManagement(org.mobicents.smsc.domain.SmscPropertiesManagement) Sms(org.mobicents.smsc.library.Sms) 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)

Aggregations

ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)20 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)20 LocationInfoWithLMSI (org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI)19 LocationInfoWithLMSIImpl (org.restcomm.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl)19 IMSI (org.restcomm.protocols.ss7.map.api.primitives.IMSI)18 Test (org.testng.annotations.Test)18 Sms (org.mobicents.smsc.library.Sms)17 IMSIImpl (org.restcomm.protocols.ss7.map.primitives.IMSIImpl)17 ArrayList (java.util.ArrayList)16 SmscPropertiesManagement (org.mobicents.smsc.domain.SmscPropertiesManagement)16 SmsSet (org.mobicents.smsc.library.SmsSet)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 UUID (java.util.UUID)14 SmsProxy (org.mobicents.smsc.slee.resources.persistence.SmsProxy)14 MAPApplicationContextVersion (org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion)14 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)14