Search in sources :

Example 26 with MAPDialogSms

use of org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms 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

MAPDialogSms (org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms)25 MAPException (org.restcomm.protocols.ss7.map.api.MAPException)17 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)16 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)14 SccpAddress (org.restcomm.protocols.ss7.sccp.parameter.SccpAddress)8 MAPErrorMessage (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)6 ActivityContextInterface (javax.slee.ActivityContextInterface)4 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)4 Sms (org.mobicents.smsc.library.Sms)3 SmsSet (org.mobicents.smsc.library.SmsSet)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 GlobalTitle (org.restcomm.protocols.ss7.sccp.parameter.GlobalTitle)3 SmscProcessingException (org.mobicents.smsc.library.SmscProcessingException)2 MAPApplicationContext (org.restcomm.protocols.ss7.map.api.MAPApplicationContext)2 MAPErrorMessageSubscriberBusyForMtSms (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms)2 LocationInfoWithLMSI (org.restcomm.protocols.ss7.map.api.service.sms.LocationInfoWithLMSI)2 SM_RP_OA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_OA)2 SmsSubmitTpdu (org.restcomm.protocols.ss7.map.api.smstpdu.SmsSubmitTpdu)2