use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.
the class MProcUtility method createNewEmptyMessage.
public static MProcNewMessage createNewEmptyMessage(int defaultValidityPeriodHours, int maxValidityPeriodHours, OriginationType originationType) {
Sms sms = new Sms();
sms.setDbId(UUID.randomUUID());
sms.setOrigNetworkId(0);
sms.setSourceAddr("111");
sms.setSourceAddrNpi(1);
sms.setSourceAddrTon(1);
sms.setMessageId(0);
sms.setShortMessageText("???");
sms.setShortMessageBin(null);
Date now = new Date();
sms.setSubmitDate(now);
sms.setValidityPeriod(addHours(now, defaultValidityPeriodHours));
sms.setScheduleDeliveryTime(null);
sms.setDataCoding(0);
sms.setNationalLanguageLockingShift(0);
sms.setNationalLanguageSingleShift(0);
// datagram mode, normal message, no UDH
sms.setEsmClass(1);
sms.setPriority(0);
sms.setRegisteredDelivery(0);
sms.setOrigSystemId(null);
sms.setOrigEsmeName(null);
sms.setOriginationType(originationType);
sms.setMoMessageRef(0);
sms.setServiceType(null);
sms.setProtocolId(0);
sms.setReplaceIfPresent(0);
sms.setDefaultMsgId(0);
SmsSet smsSet = new SmsSet();
smsSet.setDestAddr("222");
smsSet.setDestAddrNpi(1);
smsSet.setDestAddrTon(1);
smsSet.setNetworkId(0);
smsSet.setCorrelationId(null);
smsSet.addSms(sms);
return new MProcNewMessageImpl(sms, defaultValidityPeriodHours, maxValidityPeriodHours);
}
use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.
the class PostArrivalProcessorImpl method updateMessageSourceAddrTon.
@Override
public void updateMessageSourceAddrTon(MProcMessage message, int newSourceTon) throws MProcRuleException {
MProcUtility.checkSourceAddrTon(newSourceTon);
MProcMessageImpl msg = (MProcMessageImpl) message;
Sms sms = msg.getSmsContent();
sms.setSourceAddrTon(newSourceTon);
}
use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.
the class PostArrivalProcessorImpl method updateMessageDestAddr.
@Override
public void updateMessageDestAddr(MProcMessage message, String newDigits) throws MProcRuleException {
MProcUtility.checkDestAddr(newDigits);
MProcMessageImpl msg = (MProcMessageImpl) message;
Sms sms = msg.getSmsContent();
sms.getSmsSet().setDestAddr(newDigits);
sms.getSmsSet().setCorrelationId(null);
}
use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.
the class PostArrivalProcessorImpl method updateNationalLanguageLockingShift.
@Override
public void updateNationalLanguageLockingShift(MProcMessage message, int newNationalLanguageLockingShift) {
MProcMessageImpl msg = (MProcMessageImpl) message;
Sms sms = msg.getSmsContent();
sms.setNationalLanguageLockingShift(newNationalLanguageLockingShift);
}
use of org.mobicents.smsc.library.Sms in project smscgateway by RestComm.
the class PostArrivalProcessorImpl method removeTlvParameter.
@Override
public void removeTlvParameter(MProcMessage message, short tag) {
MProcMessageImpl msg = (MProcMessageImpl) message;
Sms sms = msg.getSmsContent();
TlvSet ts = sms.getTlvSet();
ts.removeOptionalParameter(tag);
}
Aggregations