Search in sources :

Example 11 with AddressField

use of org.restcomm.protocols.ss7.map.api.smstpdu.AddressField in project smscgateway by RestComm.

the class MAPListener method onMoForwardShortMessageRequest.

@Override
public void onMoForwardShortMessageRequest(MoForwardShortMessageRequest request) {
    if (logger.isDebugEnabled()) {
        logger.debug("Rx : MoForwardShortMessageRequestIndication=" + request);
    }
    MAPDialogSms dialog = request.getMAPDialog();
    try {
        // TODO Should we add PENDING SMS TPDU here itself?
        dialog.addMoForwardShortMessageResponse(request.getInvokeId(), null, null);
    // dialog.close(false);
    } catch (MAPException e) {
        logger.error("Error while sending MoForwardShortMessageResponse ", e);
    }
    dialog.setUserObject(true);
    try {
        SmsSignalInfo smsSignalInfo = request.getSM_RP_UI();
        SmsTpdu smsTpdu = smsSignalInfo.decodeTpdu(true);
        if (smsTpdu.getSmsTpduType() != SmsTpduType.SMS_SUBMIT) {
            // TODO : Error, we should always receive SMS_SUBMIT for
            // MoForwardShortMessageRequestIndication
            logger.error("Rx : MoForwardShortMessageRequestIndication, but SmsTpduType is not SMS_SUBMIT. SmsTpdu=" + smsTpdu);
            return;
        }
        SmsSubmitTpdu smsSubmitTpdu = (SmsSubmitTpdu) smsTpdu;
        AddressField destinationAddress = smsSubmitTpdu.getDestinationAddress();
    // TODO Normalize
    } catch (MAPException e1) {
        logger.error("Error while decoding SmsSignalInfo ", e1);
    }
}
Also used : AddressField(org.restcomm.protocols.ss7.map.api.smstpdu.AddressField) SmsSignalInfo(org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) SmsTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsTpdu) SmsSubmitTpdu(org.restcomm.protocols.ss7.map.api.smstpdu.SmsSubmitTpdu)

Aggregations

AddressField (org.restcomm.protocols.ss7.map.api.smstpdu.AddressField)9 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)8 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)8 ProtocolIdentifier (org.restcomm.protocols.ss7.map.api.smstpdu.ProtocolIdentifier)7 SmsTpdu (org.restcomm.protocols.ss7.map.api.smstpdu.SmsTpdu)7 SmsSignalInfoImpl (org.restcomm.protocols.ss7.map.service.sms.SmsSignalInfoImpl)7 AddressFieldImpl (org.restcomm.protocols.ss7.map.smstpdu.AddressFieldImpl)7 DataCodingSchemeImpl (org.restcomm.protocols.ss7.map.smstpdu.DataCodingSchemeImpl)7 ProtocolIdentifierImpl (org.restcomm.protocols.ss7.map.smstpdu.ProtocolIdentifierImpl)7 UserDataImpl (org.restcomm.protocols.ss7.map.smstpdu.UserDataImpl)7 Test (org.testng.annotations.Test)7 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)6 DataCodingScheme (org.restcomm.protocols.ss7.map.api.smstpdu.DataCodingScheme)6 UserData (org.restcomm.protocols.ss7.map.api.smstpdu.UserData)6 Date (java.util.Date)5 PreparedStatementCollection (org.mobicents.smsc.cassandra.PreparedStatementCollection)5 Sms (org.mobicents.smsc.library.Sms)5 SmsSet (org.mobicents.smsc.library.SmsSet)5 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)5 MAPProviderProxy (org.mobicents.smsc.slee.resources.persistence.MAPProviderProxy)5