use of org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString 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();
}
use of org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString 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, null);
// mapDialogSms.close(false);
} catch (MAPException e) {
e.printStackTrace();
}
mapDialogSms.setUserObject(true);
}
Aggregations