Search in sources :

Example 31 with MAPException

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

the class MAPListener method onForwardShortMessageRequest.

@Override
public void onForwardShortMessageRequest(ForwardShortMessageRequest event) {
    if (logger.isInfoEnabled()) {
        logger.info("Rx : onForwardShortMessageRequest=" + event);
    }
    // Lets first close the Dialog
    MAPDialogSms mapDialogSms = event.getMAPDialog();
    try {
        if (this.currentMapMessageCount % 7 == 0) {
            // Send back AbsentSubscriber for every 7th MtSMS
            MAPErrorMessage mapErrorMessage = mAPErrorMessageFactory.createMAPErrorMessageAbsentSubscriberSM(AbsentSubscriberDiagnosticSM.IMSIDetached, null, null);
            mapDialogSms.sendErrorComponent(event.getInvokeId(), mapErrorMessage);
        // mapDialogSms.close(false);
        } else {
            mapDialogSms.addForwardShortMessageResponse(event.getInvokeId());
        // mapDialogSms.close(false);
        }
    } catch (MAPException e) {
        logger.error("Error while sending MAPErrorMessageAbsentSubscriberSM ", e);
    }
    mapDialogSms.setUserObject(true);
}
Also used : MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)

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