Search in sources :

Example 26 with AddressString

use of org.restcomm.protocols.ss7.map.api.primitives.AddressString in project smscgateway by RestComm.

the class MAPDialogSmsProxy method addReportSMDeliveryStatusRequest.

@Override
public Long addReportSMDeliveryStatusRequest(ISDNAddressString msisdn, AddressString serviceCentreAddress, SMDeliveryOutcome sMDeliveryOutcome, Integer absentSubscriberDiagnosticSM, MAPExtensionContainer extensionContainer, boolean gprsSupportIndicator, boolean deliveryOutcomeIndicator, SMDeliveryOutcome additionalSMDeliveryOutcome, Integer additionalAbsentSubscriberDiagnosticSM) throws MAPException {
    ReportSMDeliveryStatusRequestImpl msg = new ReportSMDeliveryStatusRequestImpl(this.getApplicationContext().getApplicationContextVersion().getVersion(), msisdn, serviceCentreAddress, sMDeliveryOutcome, absentSubscriberDiagnosticSM, extensionContainer, gprsSupportIndicator, deliveryOutcomeIndicator, additionalSMDeliveryOutcome, additionalAbsentSubscriberDiagnosticSM);
    this.eventList.add(new MAPTestEvent(MAPTestEventType.componentAdded, msg));
    return 0L;
}
Also used : ReportSMDeliveryStatusRequestImpl(org.restcomm.protocols.ss7.map.service.sms.ReportSMDeliveryStatusRequestImpl)

Example 27 with AddressString

use of org.restcomm.protocols.ss7.map.api.primitives.AddressString in project smscgateway by RestComm.

the class MAPDialogSmsProxy method addSendRoutingInfoForSMRequest.

@Override
public Long addSendRoutingInfoForSMRequest(ISDNAddressString msisdn, boolean sm_RP_PRI, AddressString serviceCentreAddress, MAPExtensionContainer extensionContainer, boolean gprsSupportIndicator, SM_RP_MTI sM_RP_MTI, SM_RP_SMEA sM_RP_SMEA, SMDeliveryNotIntended smDeliveryNotIntended, boolean ipSmGwGuidanceIndicator, IMSI imsi, boolean t4TriggerIndicator, boolean singleAttemptDelivery, TeleserviceCode teleservice, CorrelationID correlationID) throws MAPException {
    SendRoutingInfoForSMRequestImpl msg = new SendRoutingInfoForSMRequestImpl(msisdn, sm_RP_PRI, serviceCentreAddress, extensionContainer, gprsSupportIndicator, sM_RP_MTI, sM_RP_SMEA, smDeliveryNotIntended, singleAttemptDelivery, imsi, singleAttemptDelivery, singleAttemptDelivery, teleservice, correlationID);
    this.eventList.add(new MAPTestEvent(MAPTestEventType.componentAdded, msg));
    return 0L;
}
Also used : SendRoutingInfoForSMRequestImpl(org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMRequestImpl)

Example 28 with AddressString

use of org.restcomm.protocols.ss7.map.api.primitives.AddressString in project smscgateway by RestComm.

the class AlertTest method testAlert1_Gsm1.

@Test(groups = { "Alert" })
public void testAlert1_Gsm1() throws Exception {
    if (!this.cassandraDbInited)
        return;
    this.prepareDatabase();
    SmsSet smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    assertNull(smsSetX);
    Sms smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId);
    assertEquals(smsX.getSmsSet().getInSystem(), 0);
    // boolean b1 = this.pers.checkSmsSetExists(ta1);
    // assertTrue(b1);
    // SmsSet smsSet = this.pers.obtainSmsSet(ta1);
    // assertEquals(smsSet.getInSystem(), 1);
    // assertEquals(smsSet.getDueDate(), farDate);
    Thread.sleep(1000);
    Date curDate = new Date();
    ISDNAddressString msisdn = new ISDNAddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "5555");
    AddressString serviceCentreAddress = new AddressStringImpl(AddressNature.international_number, NumberingPlan.ISDN, "1111");
    AlertServiceCentreRequest evt = new AlertServiceCentreRequestImpl(msisdn, serviceCentreAddress);
    MAPProviderProxy proxy = new MAPProviderProxy();
    MAPApplicationContext appCntx = MAPApplicationContext.getInstance(MAPApplicationContextName.shortMsgAlertContext, MAPApplicationContextVersion.version2);
    MAPDialogSmsProxy dialog = new MAPDialogSmsProxy(new MAPServiceSmsProxy(proxy), appCntx, null, null);
    evt.setMAPDialog(dialog);
    this.sbb.onAlertServiceCentreRequest(evt, null);
    smsSetX = SmsSetCache.getInstance().getProcessingSmsSet(procTargetId);
    // assertNotNull(smsSetX);  TODO: this will work after alert is with direct Activities sending
    smsX = this.pers.obtainLiveSms(procDueSlot, procTargetId, procId);
// assertNull(smsX);
// b1 = this.pers.checkSmsSetExists(ta1);
// assertTrue(b1);
// smsSet = this.pers.obtainSmsSet(ta1);
// assertEquals(smsSet.getInSystem(), 1);
// this.testDateEq(smsSet.getDueDate(), curDate);
}
Also used : AlertServiceCentreRequestImpl(org.restcomm.protocols.ss7.map.service.sms.AlertServiceCentreRequestImpl) MAPServiceSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) Date(java.util.Date) MAPDialogSmsProxy(org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) MAPProviderProxy(org.mobicents.smsc.slee.resources.persistence.MAPProviderProxy) Sms(org.mobicents.smsc.library.Sms) AlertServiceCentreRequest(org.restcomm.protocols.ss7.map.api.service.sms.AlertServiceCentreRequest) SmsSet(org.mobicents.smsc.library.SmsSet) MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext) AddressStringImpl(org.restcomm.protocols.ss7.map.primitives.AddressStringImpl) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) Test(org.testng.annotations.Test)

Example 29 with AddressString

use of org.restcomm.protocols.ss7.map.api.primitives.AddressString in project smscgateway by RestComm.

the class HrSriClientSbb method setupRoutingInfoForSMRequestIndication.

private MAPDialogSms setupRoutingInfoForSMRequestIndication(String destinationAddress, int ton, int npi, MAPApplicationContext mapApplicationContext, int networkId) throws MAPException {
    // this.mapParameterFactory.creat
    String hlrAddress = destinationAddress;
    String hrHlrNumber = smscPropertiesManagement.getHrHlrNumber(networkId);
    if (hrHlrNumber != null && hrHlrNumber.length() > 0) {
        hlrAddress = hrHlrNumber;
    }
    SccpAddress destinationAddr = this.convertAddressFieldToSCCPAddress(hlrAddress, ton, npi);
    MAPDialogSms mapDialogSms = this.mapProvider.getMAPServiceSms().createNewDialog(mapApplicationContext, this.getServiceCenterSccpAddress(networkId), null, destinationAddr, null);
    mapDialogSms.setNetworkId(networkId);
    ISDNAddressString isdn = this.getCalledPartyISDNAddressString(destinationAddress, ton, npi);
    AddressString serviceCenterAddress = this.getServiceCenterAddressString(networkId);
    boolean sm_RP_PRI = true;
    mapDialogSms.addSendRoutingInfoForSMRequest(isdn, sm_RP_PRI, serviceCenterAddress, null, false, null, null, null, false, null, false, false, null, null);
    if (this.logger.isInfoEnabled())
        this.logger.info("Home routing: HrSriClientSbb: Sending: SendRoutingInfoForSMRequest: isdn=" + isdn + ", serviceCenterAddress=" + serviceCenterAddress + ", sm_RP_PRI=" + sm_RP_PRI);
    return mapDialogSms;
}
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) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString)

Example 30 with AddressString

use of org.restcomm.protocols.ss7.map.api.primitives.AddressString in project smscgateway by RestComm.

the class SmsSetCacheTest 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.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) AddressStringImpl(org.restcomm.protocols.ss7.map.primitives.AddressStringImpl) ISDNAddressStringImpl(org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl) Test(org.testng.annotations.Test)

Aggregations

AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)25 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)25 SmsSet (org.mobicents.smsc.library.SmsSet)20 Test (org.testng.annotations.Test)20 Sms (org.mobicents.smsc.library.Sms)19 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)19 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)18 MAPServiceSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy)18 SM_RP_DA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA)18 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)17 UserData (org.restcomm.protocols.ss7.map.api.smstpdu.UserData)17 ArrayList (java.util.ArrayList)14 SmscPropertiesManagement (org.mobicents.smsc.domain.SmscPropertiesManagement)13 IMSI (org.restcomm.protocols.ss7.map.api.primitives.IMSI)13 LocationInfoWithLMSI (org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI)13 SM_RP_OA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_OA)13 MAPTestEvent (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy.MAPTestEvent)12 SmsSetEvent (org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent)12 MAPApplicationContextVersion (org.restcomm.protocols.ss7.map.api.MAPApplicationContextVersion)12 SendRoutingInfoForSMResponse (org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse)12