use of org.restcomm.protocols.ss7.map.api.MAPException 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;
}
use of org.restcomm.protocols.ss7.map.api.MAPException in project smscgateway by RestComm.
the class MAPDialogSmsProxy method addMtForwardShortMessageRequest.
@Override
public Long addMtForwardShortMessageRequest(SM_RP_DA sm_RP_DA, SM_RP_OA sm_RP_OA, SmsSignalInfo sm_RP_UI, boolean moreMessagesToSend, MAPExtensionContainer extensionContainer) throws MAPException {
// TODO Auto-generated method stub
byte[] data = sm_RP_UI.getData();
setForwardSMLen(data.length);
MtForwardShortMessageRequestImpl msg = new MtForwardShortMessageRequestImpl(sm_RP_DA, sm_RP_OA, sm_RP_UI, moreMessagesToSend, extensionContainer);
this.eventList.add(new MAPTestEvent(MAPTestEventType.componentAdded, msg));
return 0L;
}
use of org.restcomm.protocols.ss7.map.api.MAPException in project smscgateway by RestComm.
the class MAPDialogSmsProxy method addReportSMDeliveryStatusRequest.
@Override
public Long addReportSMDeliveryStatusRequest(ISDNAddressString msisdn, AddressString serviceCentreAddress, SMDeliveryOutcome sMDeliveryOutcome, Integer absentSubscriberDiagnosticSM, MAPExtensionContainer extensionContainer, boolean gprsSupportIndicator, boolean deliveryOutcomeIndicator, SMDeliveryOutcome additionalSMDeliveryOutcome, Integer additionalAbsentSubscriberDiagnosticSM) throws MAPException {
ReportSMDeliveryStatusRequestImpl msg = new ReportSMDeliveryStatusRequestImpl(this.getApplicationContext().getApplicationContextVersion().getVersion(), msisdn, serviceCentreAddress, sMDeliveryOutcome, absentSubscriberDiagnosticSM, extensionContainer, gprsSupportIndicator, deliveryOutcomeIndicator, additionalSMDeliveryOutcome, additionalAbsentSubscriberDiagnosticSM);
this.eventList.add(new MAPTestEvent(MAPTestEventType.componentAdded, msg));
return 0L;
}
use of org.restcomm.protocols.ss7.map.api.MAPException in project smscgateway by RestComm.
the class MAPDialogSmsProxy method addSendRoutingInfoForSMRequest.
@Override
public Long addSendRoutingInfoForSMRequest(ISDNAddressString msisdn, boolean sm_RP_PRI, AddressString serviceCentreAddress, MAPExtensionContainer extensionContainer, boolean gprsSupportIndicator, SM_RP_MTI sM_RP_MTI, SM_RP_SMEA sM_RP_SMEA, SMDeliveryNotIntended smDeliveryNotIntended, boolean ipSmGwGuidanceIndicator, IMSI imsi, boolean t4TriggerIndicator, boolean singleAttemptDelivery, TeleserviceCode teleservice, CorrelationID correlationID) throws MAPException {
SendRoutingInfoForSMRequestImpl msg = new SendRoutingInfoForSMRequestImpl(msisdn, sm_RP_PRI, serviceCentreAddress, extensionContainer, gprsSupportIndicator, sM_RP_MTI, sM_RP_SMEA, smDeliveryNotIntended, singleAttemptDelivery, imsi, singleAttemptDelivery, singleAttemptDelivery, teleservice, correlationID);
this.eventList.add(new MAPTestEvent(MAPTestEventType.componentAdded, msg));
return 0L;
}
use of org.restcomm.protocols.ss7.map.api.MAPException in project smscgateway by RestComm.
the class MAPDialogSmsProxy method addForwardShortMessageRequest.
@Override
public Long addForwardShortMessageRequest(SM_RP_DA sm_RP_DA, SM_RP_OA sm_RP_OA, SmsSignalInfo sm_RP_UI, boolean moreMessagesToSend) throws MAPException {
// TODO Auto-generated method stub
byte[] data = sm_RP_UI.getData();
setForwardSMLen(data.length);
ForwardShortMessageRequestImpl msg = new ForwardShortMessageRequestImpl(sm_RP_DA, sm_RP_OA, sm_RP_UI, moreMessagesToSend);
this.eventList.add(new MAPTestEvent(MAPTestEventType.componentAdded, msg));
return 0L;
}
Aggregations