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);
}
Aggregations