Search in sources :

Example 21 with LocationInfoWithLMSI

use of org.mobicents.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.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) SendMtEvent(org.mobicents.smsc.slee.services.smpp.server.events.SendMtEvent)

Example 22 with LocationInfoWithLMSI

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

the class MAPListener method onSendRoutingInfoForSMRequest.

@Override
public void onSendRoutingInfoForSMRequest(SendRoutingInfoForSMRequest event) {
    if (logger.isInfoEnabled()) {
        logger.info("Rx : SendRoutingInfoForSMRequestIndication=" + event);
    }
    IMSI imsi = new IMSIImpl("410035001692061");
    ISDNAddressString nnn = new ISDNAddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "923330052001");
    LocationInfoWithLMSI li = new LocationInfoWithLMSIImpl(nnn, null, null, false, null);
    MAPDialogSms mapDialogSms = event.getMAPDialog();
    try {
        mapDialogSms.addSendRoutingInfoForSMResponse(event.getInvokeId(), imsi, li, null, null);
    // mapDialogSms.close(false);
    } catch (MAPException e) {
        e.printStackTrace();
    }
    mapDialogSms.setUserObject(true);
}
Also used : LocationInfoWithLMSI(org.mobicents.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI) ISDNAddressStringImpl(org.mobicents.protocols.ss7.map.primitives.ISDNAddressStringImpl) IMSIImpl(org.mobicents.protocols.ss7.map.primitives.IMSIImpl) MAPDialogSms(org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.mobicents.protocols.ss7.map.api.MAPException) IMSI(org.mobicents.protocols.ss7.map.api.primitives.IMSI) ISDNAddressString(org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) LocationInfoWithLMSIImpl(org.mobicents.protocols.ss7.map.service.sms.LocationInfoWithLMSIImpl)

Example 23 with LocationInfoWithLMSI

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

the class SmsSetCasheTest method testSmppShellExecutor.

@Test(groups = { "SmsSet" })
public void testSmppShellExecutor() throws Exception {
    int correlationIdLiveTime = 2;
    int sriResponseLiveTime = 3;
    int deliveredMsgLiveTime = 3;
    SmsSetCache.start(correlationIdLiveTime, sriResponseLiveTime, deliveredMsgLiveTime);
    SmsSetCache ssc = SmsSetCache.getInstance();
    String remoteMessageId = "0000100001";
    String destId = "esme_33";
    Long messageId = 3000031L;
    String correlationID = "000000000011111";
    ISDNAddressString msisdn = new ISDNAddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "11111111");
    AddressString serviceCentreAddress = new AddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "22222222");
    CorrelationIdValue elem = new CorrelationIdValue(correlationID, msisdn, serviceCentreAddress, 0, null);
    ssc.putCorrelationIdCacheElement(elem, correlationIdLiveTime);
    Sms sms = new Sms();
    long mId = 222L;
    sms.setMessageId(mId);
    sms.setShortMessageText("textxxx");
    ssc.putDeliveredMsgValue(sms, deliveredMsgLiveTime);
    ssc.putDeliveredRemoteMsgIdValue(remoteMessageId, destId, messageId, deliveredMsgLiveTime);
    String targetID = "22222_1_1_2";
    LocationInfoWithLMSI locationInfoWithLMSI = null;
    SriResponseValue srv = new SriResponseValue(targetID, 2, "22222", 1, 1, locationInfoWithLMSI, "0000011111000000");
    ssc.putSriResponseValue(srv, sriResponseLiveTime);
    Thread.sleep(2500);
    CorrelationIdValue v1 = ssc.getCorrelationIdCacheElement(correlationID);
    assertNotNull(v1);
    SriResponseValue vv1 = ssc.getSriResponseValue(targetID);
    assertNotNull(vv1);
    Sms sms2 = ssc.getDeliveredMsgValue(mId);
    assertNotNull(sms2);
    Long msgId2 = ssc.getDeliveredRemoteMsgIdValue(remoteMessageId, destId);
    assertEquals((long) msgId2, (long) messageId);
    Thread.sleep(2500);
    CorrelationIdValue v2 = ssc.getCorrelationIdCacheElement(correlationID);
    assertNull(v2);
    SriResponseValue vv2 = ssc.getSriResponseValue(targetID);
    assertNotNull(vv2);
    sms2 = ssc.getDeliveredMsgValue(mId);
    assertNotNull(sms2);
    msgId2 = ssc.getDeliveredRemoteMsgIdValue(remoteMessageId, destId);
    assertEquals((long) msgId2, (long) messageId);
    Thread.sleep(2000);
    CorrelationIdValue v3 = ssc.getCorrelationIdCacheElement(correlationID);
    assertNull(v3);
    SriResponseValue vv3 = ssc.getSriResponseValue(targetID);
    assertNull(vv3);
    sms2 = ssc.getDeliveredMsgValue(mId);
    assertNull(sms2);
    msgId2 = ssc.getDeliveredRemoteMsgIdValue(remoteMessageId, destId);
    assertNull(msgId2);
    SmsSetCache.stop();
}
Also used : LocationInfoWithLMSI(org.mobicents.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI) ISDNAddressString(org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.mobicents.protocols.ss7.map.api.primitives.AddressString) ISDNAddressString(org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) ISDNAddressString(org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.mobicents.protocols.ss7.map.api.primitives.AddressString) ISDNAddressStringImpl(org.mobicents.protocols.ss7.map.primitives.ISDNAddressStringImpl) ISDNAddressStringImpl(org.mobicents.protocols.ss7.map.primitives.ISDNAddressStringImpl) AddressStringImpl(org.mobicents.protocols.ss7.map.primitives.AddressStringImpl) Test(org.testng.annotations.Test)

Aggregations

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