use of org.restcomm.protocols.ss7.map.api.smstpdu.AbsoluteTimeStamp in project smscgateway by RestComm.
the class MtSbb method createSignalInfo.
protected SmsSignalInfo createSignalInfo(Sms sms, String msg, byte[] udhData, boolean moreMessagesToSend, int messageReferenceNumber, int messageSegmentCount, int messageSegmentNumber, DataCodingScheme dataCodingScheme, int nationalLanguageLockingShift, int nationalLanguageSingleShift, int sourceAddrTon, int sourceAddrNpi) throws MAPException {
UserDataHeader userDataHeader;
if (udhData != null) {
userDataHeader = this.mapSmsTpduParameterFactory.createUserDataHeader(udhData);
} else {
userDataHeader = this.mapSmsTpduParameterFactory.createUserDataHeader();
if (messageSegmentCount > 1) {
UserDataHeaderElement concatenatedShortMessagesIdentifier = this.mapSmsTpduParameterFactory.createConcatenatedShortMessagesIdentifier(messageReferenceNumber > 255, messageReferenceNumber, messageSegmentCount, messageSegmentNumber);
userDataHeader.addInformationElement(concatenatedShortMessagesIdentifier);
}
if (nationalLanguageLockingShift > 0) {
NationalLanguageIdentifier nationalLanguageIdentifier = NationalLanguageIdentifier.getInstance(nationalLanguageLockingShift);
if (nationalLanguageIdentifier != null) {
UserDataHeaderElement nationalLanguageLockingShiftEl = this.mapSmsTpduParameterFactory.createNationalLanguageLockingShiftIdentifier(nationalLanguageIdentifier);
userDataHeader.addInformationElement(nationalLanguageLockingShiftEl);
}
}
if (nationalLanguageSingleShift > 0) {
NationalLanguageIdentifier nationalLanguageIdentifier = NationalLanguageIdentifier.getInstance(nationalLanguageSingleShift);
if (nationalLanguageIdentifier != null) {
UserDataHeaderElement nationalLanguageSingleShiftEl = this.mapSmsTpduParameterFactory.createNationalLanguageSingleShiftIdentifier(nationalLanguageIdentifier);
userDataHeader.addInformationElement(nationalLanguageSingleShiftEl);
}
}
}
UserData ud = this.mapSmsTpduParameterFactory.createUserData(msg, dataCodingScheme, userDataHeader, isoCharset);
Date submitDate = sms.getSubmitDate();
// TODO : TimeZone should be configurable
AbsoluteTimeStamp serviceCentreTimeStamp = this.mapSmsTpduParameterFactory.createAbsoluteTimeStamp((submitDate.getYear() % 100), (submitDate.getMonth() + 1), submitDate.getDate(), submitDate.getHours(), submitDate.getMinutes(), submitDate.getSeconds(), -(submitDate.getTimezoneOffset() / 15));
SmsDeliverTpdu smsDeliverTpdu = this.mapSmsTpduParameterFactory.createSmsDeliverTpdu(moreMessagesToSend, false, ((sms.getEsmClass() & SmppConstants.ESM_CLASS_REPLY_PATH_MASK) != 0), false, this.getSmsTpduOriginatingAddress(sourceAddrTon, sourceAddrNpi, sms.getSourceAddr()), this.mapSmsTpduParameterFactory.createProtocolIdentifier(sms.getProtocolId()), serviceCentreTimeStamp, ud);
SmsSignalInfo smsSignalInfo = this.mapParameterFactory.createSmsSignalInfo(smsDeliverTpdu, isoCharset);
return smsSignalInfo;
}
Aggregations