Search in sources :

Example 1 with SmsStatusReportTpdu

use of org.mobicents.protocols.ss7.map.api.smstpdu.SmsStatusReportTpdu in project smscgateway by RestComm.

the class MtTest3 method ReportTest.

@Test(groups = { "Mt" })
public void ReportTest() throws Exception {
    MtSbbProxy3 proxy = new MtSbbProxy3();
    Date submitDate = new Date(2015, 1, 2, 12, 30);
    Date deliveryDate = new Date(2015, 1, 2, 12, 40);
    Sms sms = new Sms();
    sms.setSourceAddr("111199990000");
    sms.setSourceAddrNpi(1);
    sms.setSourceAddrTon(1);
    sms.setShortMessageText("Hello 111");
    sms.setSubmitDate(submitDate);
    sms.setMoMessageRef(34);
    SmsSet smsSet = new SmsSet();
    smsSet.setDestAddr("888899990000");
    smsSet.setDestAddrNpi(1);
    smsSet.setDestAddrTon(1);
    smsSet.setNetworkId(0);
    smsSet.addSms(sms);
    SmsDeliveryReportData smsDeliveryReportData = new SmsDeliveryReportData();
    smsDeliveryReportData.setDeliveryDate(deliveryDate);
    smsDeliveryReportData.setStatusReportQualifier(StatusReportQualifier.SmsSubmitResult);
    smsDeliveryReportData.setStatusVal(64);
    SmsSignalInfo smsSignalInfo = proxy.createSignalInfoStatusReport(sms, true, smsDeliveryReportData);
    String s1 = smsSignalInfo.toString();
    assertNotNull(smsSignalInfo);
    SmsStatusReportTpdu si = (SmsStatusReportTpdu) smsSignalInfo.decodeTpdu(false);
    assertEquals(si.getDischargeTime().getMinute(), 40);
    assertEquals(si.getServiceCentreTimeStamp().getMinute(), 30);
    assertFalse(si.getForwardedOrSpawned());
    assertEquals(si.getMessageReference(), 34);
    assertTrue(si.getMoreMessagesToSend());
    // assertNull(si.getParameterIndicator());
    assertEquals(si.getProtocolIdentifier().getCode(), 0);
    assertEquals(si.getRecipientAddress().getAddressValue(), "888899990000");
    assertEquals(si.getRecipientAddress().getNumberingPlanIdentification(), NumberingPlanIdentification.ISDNTelephoneNumberingPlan);
    assertEquals(si.getRecipientAddress().getTypeOfNumber(), TypeOfNumber.InternationalNumber);
    assertEquals(si.getStatus().getCode(), Status.REMOTE_PROCEDURE_ERROR);
    assertEquals(si.getStatusReportQualifier(), StatusReportQualifier.SmsSubmitResult);
}
Also used : SmsSignalInfo(org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo) Sms(org.mobicents.smsc.library.Sms) SmsStatusReportTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsStatusReportTpdu) SmsDeliveryReportData(org.mobicents.smsc.library.SmsDeliveryReportData) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) Date(java.util.Date) SmsSet(org.mobicents.smsc.library.SmsSet) Test(org.testng.annotations.Test)

Aggregations

Date (java.util.Date)1 Sms (org.mobicents.smsc.library.Sms)1 SmsDeliveryReportData (org.mobicents.smsc.library.SmsDeliveryReportData)1 SmsSet (org.mobicents.smsc.library.SmsSet)1 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)1 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)1 SmsStatusReportTpdu (org.restcomm.protocols.ss7.map.api.smstpdu.SmsStatusReportTpdu)1 Test (org.testng.annotations.Test)1