Search in sources :

Example 21 with MAPException

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;
}
Also used : SmsSignalInfo(org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo) Date(java.util.Date) NationalLanguageIdentifier(org.restcomm.protocols.ss7.map.api.datacoding.NationalLanguageIdentifier)

Example 22 with MAPException

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;
}
Also used : MtForwardShortMessageRequestImpl(org.restcomm.protocols.ss7.map.service.sms.MtForwardShortMessageRequestImpl)

Example 23 with MAPException

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;
}
Also used : ReportSMDeliveryStatusRequestImpl(org.restcomm.protocols.ss7.map.service.sms.ReportSMDeliveryStatusRequestImpl)

Example 24 with MAPException

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;
}
Also used : SendRoutingInfoForSMRequestImpl(org.restcomm.protocols.ss7.map.service.sms.SendRoutingInfoForSMRequestImpl)

Example 25 with MAPException

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;
}
Also used : MtForwardShortMessageRequestImpl(org.restcomm.protocols.ss7.map.service.sms.MtForwardShortMessageRequestImpl) ForwardShortMessageRequestImpl(org.restcomm.protocols.ss7.map.service.sms.ForwardShortMessageRequestImpl)

Aggregations

MAPException (org.restcomm.protocols.ss7.map.api.MAPException)22 MAPDialogSms (org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms)21 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)16 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)14 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)6 Date (java.util.Date)4 ActivityContextInterface (javax.slee.ActivityContextInterface)4 Sms (org.mobicents.smsc.library.Sms)4 SmsSet (org.mobicents.smsc.library.SmsSet)4 SccpAddress (org.restcomm.protocols.ss7.sccp.parameter.SccpAddress)4 MAPErrorMessage (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)3 MAPErrorMessageSubscriberBusyForMtSms (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms)3 IMSI (org.restcomm.protocols.ss7.map.api.primitives.IMSI)3 SM_RP_DA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA)3 SmsTpdu (org.restcomm.protocols.ss7.map.api.smstpdu.SmsTpdu)3 UserData (org.restcomm.protocols.ss7.map.api.smstpdu.UserData)3 Timestamp (java.sql.Timestamp)2 ArrayList (java.util.ArrayList)2 SmscProcessingException (org.mobicents.smsc.library.SmscProcessingException)2 TargetAddress (org.mobicents.smsc.library.TargetAddress)2