Search in sources :

Example 6 with MAPErrorMessage

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

the class HrSriServerSbb method onSriFailure.

@Override
public void onSriFailure(CorrelationIdValue correlationIdValue, MAPErrorMessage errorResponse, String cause) {
    MAPDialogSms dlg = this.getActivity();
    if (dlg == null) {
        this.logger.severe("Home routing: can not get MAPDialog for sending SRI negative Response");
        return;
    }
    smscStatAggregator.updateMsgInHrSriNegReq();
    StringBuilder sb = new StringBuilder();
    sb.append("Home routing: negative SRI response from HLR: transaction: ");
    sb.append(correlationIdValue);
    sb.append(", cause=");
    sb.append(cause);
    if (this.logger.isInfoEnabled())
        this.logger.info(sb.toString());
    // sending negative SRI response
    try {
        // processing of error response
        if (errorResponse == null) {
            // no errorResponse obtained - we need to create SysteFailure
            errorResponse = this.mapErrorMessageFactory.createMAPErrorMessageSystemFailure(dlg.getApplicationContext().getApplicationContextVersion().getVersion(), NetworkResource.hlr, null, null);
        } else {
        // we have errorResponse from HLR
        // TODO: we need to update values depending on MAP protocol version
        // not all versions support all messages
        }
        long invokeId = this.getInvokeId();
        dlg.sendErrorComponent(invokeId, errorResponse);
        dlg.close(false);
    } catch (MAPException e) {
        if (dlg != null) {
            dlg.release();
        }
        String reason = "Home routing: MAPException when sending SRI negative Response: " + e.toString();
        this.logger.severe(reason, e);
    }
}
Also used : MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString)

Example 7 with MAPErrorMessage

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

the class MtSbb method onErrorComponent.

// *********
// MAP Component events
@Override
public void onErrorComponent(ErrorComponent event, ActivityContextInterface aci) {
    try {
        super.onErrorComponent(event, aci);
        SmsSet smsSet = getSmsSet();
        if (smsSet == null) {
            logger.severe("MtSbb.onErrorComponent(): CMP smsSet is missed");
            return;
        }
        MAPErrorMessage mapErrorMessage = event.getMAPErrorMessage();
        if (mapErrorMessage.isEmSubscriberBusyForMtSms()) {
            MAPErrorMessageSubscriberBusyForMtSms subscriberBusyForMtSms = mapErrorMessage.getEmSubscriberBusyForMtSms();
            this.onDeliveryError(smsSet, ErrorAction.subscriberBusy, ErrorCode.USER_BUSY, "Error subscriberBusyForMtSms after MtForwardSM Request: " + subscriberBusyForMtSms.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
        } else if (mapErrorMessage.isEmAbsentSubscriber()) {
            MAPErrorMessageAbsentSubscriber absentSubscriber = mapErrorMessage.getEmAbsentSubscriber();
            this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "Error absentSubscriber after MtForwardSM Request: " + absentSubscriber.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
        } else if (mapErrorMessage.isEmAbsentSubscriberSM()) {
            MAPErrorMessageAbsentSubscriberSM absentSubscriber = mapErrorMessage.getEmAbsentSubscriberSM();
            this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "Error absentSubscriberSM after MtForwardSM Request: " + absentSubscriber.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
        } else if (mapErrorMessage.isEmSMDeliveryFailure()) {
            MAPErrorMessageSMDeliveryFailure smDeliveryFailure = mapErrorMessage.getEmSMDeliveryFailure();
            SmsDeliverReportTpdu tpdu = null;
            try {
                tpdu = smDeliveryFailure.getSmsDeliverReportTpdu();
            } catch (MAPException e) {
            // we skip any possible Exception here
            }
            ErrorAction errAction;
            // checking firstly a case of FailureCause existence in tpdu
            if (tpdu != null && tpdu.getFailureCause() != null) {
                int tpduCauseCode = tpdu.getFailureCause().getCode();
                PermanentTemporaryFailure tpFailureCauseStatus = SmscPropertiesManagement.getInstance().getSmDeliveryFailureTpCause(tpduCauseCode);
                if (tpFailureCauseStatus == PermanentTemporaryFailure.temporary) {
                    errAction = ErrorAction.temporaryFailure;
                } else {
                    errAction = ErrorAction.permanentFailure;
                }
                this.onDeliveryError(smsSet, errAction, ErrorCode.SENDING_SM_FAILED, "Error smDeliveryFailure after MtForwardSM Request: " + smDeliveryFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
            } else {
                // no FailureCause existence in tpdu - then checking DeliveryFailureCause code
                PermanentTemporaryFailure smDlrStatus = SmscPropertiesManagement.getInstance().getSmDeliveryFailure(smDeliveryFailure.getSMEnumeratedDeliveryFailureCause().getCode());
                if (smDeliveryFailure.getSMEnumeratedDeliveryFailureCause() == SMEnumeratedDeliveryFailureCause.memoryCapacityExceeded) {
                    if (smDlrStatus == PermanentTemporaryFailure.permanent)
                        errAction = ErrorAction.permanentFailure;
                    else
                        errAction = ErrorAction.memoryCapacityExceededFlag;
                    this.onDeliveryError(smsSet, errAction, ErrorCode.MESSAGE_QUEUE_FULL, "Error smDeliveryFailure after MtForwardSM Request: " + smDeliveryFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                } else {
                    if (smDlrStatus == PermanentTemporaryFailure.temporary)
                        errAction = ErrorAction.temporaryFailure;
                    else
                        errAction = ErrorAction.permanentFailure;
                    this.onDeliveryError(smsSet, errAction, ErrorCode.SENDING_SM_FAILED, "Error smDeliveryFailure after MtForwardSM Request: " + smDeliveryFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                }
            }
        } else if (mapErrorMessage.isEmSystemFailure()) {
            // TODO: may be it is not a permanent case ???
            MAPErrorMessageSystemFailure systemFailure = mapErrorMessage.getEmSystemFailure();
            this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SYSTEM_FAILURE, "Error systemFailure after MtForwardSM Request: " + systemFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
        } else if (mapErrorMessage.isEmFacilityNotSup()) {
            MAPErrorMessageFacilityNotSup facilityNotSup = mapErrorMessage.getEmFacilityNotSup();
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.FACILITY_NOT_SUPPORTED, "Error facilityNotSup after MtForwardSM Request: " + facilityNotSup.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
        } else if (mapErrorMessage.isEmExtensionContainer()) {
            MAPErrorMessageExtensionContainer extensionContainer = mapErrorMessage.getEmExtensionContainer();
            switch((int) (long) extensionContainer.getErrorCode()) {
                case MAPErrorCode.dataMissing:
                    this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.DATA_MISSING, "Error dataMissing after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                    break;
                case MAPErrorCode.unexpectedDataValue:
                    this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA, "Error unexpectedDataValue after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                    break;
                // break;
                case MAPErrorCode.unidentifiedSubscriber:
                    this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNDEFINED_SUBSCRIBER, "Error unidentifiedSubscriber after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                    break;
                case MAPErrorCode.illegalSubscriber:
                    this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.ILLEGAL_SUBSCRIBER, "Error illegalSubscriber after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                    break;
                case MAPErrorCode.illegalEquipment:
                    this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.ILLEGAL_EQUIPMENT, "Error illegalEquipment after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                    break;
                default:
                    this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.SYSTEM_FAILURE, "Error after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
                    break;
            }
        } else {
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.SYSTEM_FAILURE, "Error after MtForwardSM Request: " + mapErrorMessage, true, mapErrorMessage, false, ProcessingType.SS7_MT);
        }
    } catch (Throwable e1) {
        logger.severe("Exception in MtSbb.onErrorComponent() when fetching records and issuing events: " + e1.getMessage(), e1);
        markDeliveringIsEnded(true);
    }
}
Also used : MAPErrorMessageSubscriberBusyForMtSms(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms) MAPErrorMessageAbsentSubscriberSM(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriberSM) MAPErrorMessageExtensionContainer(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageExtensionContainer) MAPErrorMessageAbsentSubscriber(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriber) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) MAPErrorMessageSMDeliveryFailure(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSMDeliveryFailure) MAPErrorMessageFacilityNotSup(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageFacilityNotSup) ErrorAction(org.mobicents.smsc.library.ErrorAction) MAPErrorMessageSystemFailure(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSystemFailure) SmsSet(org.mobicents.smsc.library.SmsSet) PermanentTemporaryFailure(org.mobicents.smsc.library.PermanentTemporaryFailure) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)

Example 8 with MAPErrorMessage

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

the class SriSbb method onSriFullResponse.

private void onSriFullResponse() {
    SendRoutingInfoForSMResponse sendRoutingInfoForSMResponse = this.getSendRoutingInfoForSMResponse();
    MAPErrorMessage errorMessage = this.getErrorResponse();
    SmsSet smsSet = getSmsSet();
    if (smsSet == null) {
        logger.severe("SriSbb.onSriFullResponse(): CMP smsSet is missed");
        markDeliveringIsEnded(true);
        return;
    }
    if (sendRoutingInfoForSMResponse != null) {
        // we have positive response to SRI request -
        // we will try to send messages
        // storing SRI response results into a cache firstly
        SriResponseValue sriResponseValue = new SriResponseValue(smsSet.getTargetId(), smsSet.getNetworkId(), smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), sendRoutingInfoForSMResponse.getLocationInfoWithLMSI(), sendRoutingInfoForSMResponse.getIMSI().getData());
        try {
            SmsSetCache.getInstance().putSriResponseValue(sriResponseValue, smscPropertiesManagement.getSriResponseLiveTime());
        } catch (Exception e1) {
        // no actions in failure
        }
        executeForwardSM(smsSet, sendRoutingInfoForSMResponse.getLocationInfoWithLMSI(), sendRoutingInfoForSMResponse.getIMSI().getData(), smsSet.getNetworkId());
        return;
    }
    if (errorMessage != null) {
        // we have a negative response
        if (errorMessage.isEmAbsentSubscriber()) {
            this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "AbsentSubscriber response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
        } else if (errorMessage.isEmAbsentSubscriberSM()) {
            this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "AbsentSubscriberSM response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
        } else if (errorMessage.isEmCallBarred()) {
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.CALL_BARRED, "CallBarred response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
        } else if (errorMessage.isEmFacilityNotSup()) {
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.FACILITY_NOT_SUPPORTED, "FacilityNotSuppored response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
        } else if (errorMessage.isEmSystemFailure()) {
            // TODO: may be systemFailure is not a permanent error case ?
            this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SYSTEM_FAILURE, "SystemFailure response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
        } else if (errorMessage.isEmUnknownSubscriber()) {
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNKNOWN_SUBSCRIBER, "UnknownSubscriber response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
        } else if (errorMessage.isEmExtensionContainer()) {
            if (errorMessage.getEmExtensionContainer().getErrorCode() == MAPErrorCode.dataMissing) {
                this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.DATA_MISSING, "DataMissing response from HLR", true, errorMessage, false, ProcessingType.SS7_SRI);
            } else if (errorMessage.getEmExtensionContainer().getErrorCode() == MAPErrorCode.unexpectedDataValue) {
                this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA, "UnexpectedDataValue response from HLR", true, errorMessage, false, ProcessingType.SS7_SRI);
            } else if (errorMessage.getEmExtensionContainer().getErrorCode() == MAPErrorCode.teleserviceNotProvisioned) {
                this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.TELESERVICE_NOT_PROVISIONED, "TeleserviceNotProvisioned response from HLR", true, errorMessage, false, ProcessingType.SS7_SRI);
            } else {
                this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA_FROM_HLR, "Error response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
            }
        } else {
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA_FROM_HLR, "Error response from HLR: " + errorMessage.toString(), true, errorMessage, false, ProcessingType.SS7_SRI);
        }
    } else {
        // we have no responses - this is an error behaviour
        this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.HLR_REJECT_AFTER_ROUTING_INFO, "Empty response after SRI Request", false, null, false, ProcessingType.SS7_SRI);
    }
}
Also used : SriResponseValue(org.mobicents.smsc.library.SriResponseValue) SendRoutingInfoForSMResponse(org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse) SmsSet(org.mobicents.smsc.library.SmsSet) MAPException(org.restcomm.protocols.ss7.map.api.MAPException) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)

Example 9 with MAPErrorMessage

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

the class MoSbb method onMtForwardShortMessageRequest.

/**
 * @param evt
 * @param aci
 */
public void onMtForwardShortMessageRequest(MtForwardShortMessageRequest evt, ActivityContextInterface aci) {
    if (this.logger.isFineEnabled()) {
        this.logger.fine("Received MT_FORWARD_SHORT_MESSAGE_REQUEST = " + evt);
    }
    this.setProcessingState(MoProcessingState.OtherDataRecieved);
    MAPDialogSms dialog = evt.getMAPDialog();
    if (smscPropertiesManagement.getHrCharging() == MoChargingType.reject) {
        try {
            MAPErrorMessage errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageFacilityNotSup(null, null, null);
            dialog.sendErrorComponent(evt.getInvokeId(), errorMessage);
            if (this.logger.isInfoEnabled()) {
                this.logger.info("Sent ErrorComponent = " + errorMessage);
            }
            if (smscPropertiesManagement.isGenerateRejectionCdr()) {
                generateCDR(dialog.getNetworkId(), null, dialog.getLocalAddress(), CdrGenerator.CDR_SUBMIT_FAILED_HR, errorMessage.toString(), true);
            }
            dialog.close(false);
            return;
        } catch (Throwable e) {
            logger.severe("Error while sending Error message", e);
            return;
        }
    }
    Sms sms = null;
    try {
        String originatorSccpAddress = null;
        SccpAddress sccpAddress = dialog.getRemoteAddress();
        if (sccpAddress != null) {
            GlobalTitle gt = sccpAddress.getGlobalTitle();
            if (gt != null)
                originatorSccpAddress = gt.getDigits();
        }
        sms = this.processMtMessage(evt.getSM_RP_OA(), evt.getSM_RP_DA(), evt.getSM_RP_UI(), dialog.getNetworkId(), originatorSccpAddress, false, evt.getMAPDialog(), evt, evt.getInvokeId());
        if (sms != null) {
            this.processSms(sms, persistence, smscPropertiesManagement.getHrCharging(), false, dialog, evt, evt.getInvokeId());
        }
    } catch (SmscProcessingException e1) {
        this.logger.severe(e1.getMessage(), e1);
        try {
            MAPErrorMessage errorMessage;
            switch(e1.getMapErrorCode()) {
                case MAPErrorCode.unexpectedDataValue:
                    errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageExtensionContainer((long) MAPErrorCode.unexpectedDataValue, null);
                    break;
                case MAPErrorCode.systemFailure:
                    errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageSystemFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), null, null, null);
                    break;
                case MAPErrorCode.resourceLimitation:
                    errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageExtensionContainer((long) MAPErrorCode.resourceLimitation, null);
                    break;
                case MAPErrorCode.facilityNotSupported:
                    errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageFacilityNotSup(null, null, null);
                    break;
                default:
                    errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageSystemFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), null, null, null);
                    break;
            }
            dialog.sendErrorComponent(evt.getInvokeId(), errorMessage);
            if (this.logger.isInfoEnabled()) {
                this.logger.info("Sent ErrorComponent = " + errorMessage);
            }
            if (smscPropertiesManagement.isGenerateRejectionCdr() && !e1.isMessageRejectCdrCreated()) {
                if (sms != null) {
                    generateCDR(sms, CdrGenerator.CDR_SUBMIT_FAILED_HR, e1.getMessage(), false, true);
                } else {
                    generateCDR(dialog.getNetworkId(), null, dialog.getLocalAddress(), CdrGenerator.CDR_SUBMIT_FAILED_HR, errorMessage.toString(), true);
                }
            }
            dialog.close(false);
        } catch (Throwable e) {
            logger.severe("Error while sending Error message", e);
            return;
        }
        return;
    } catch (Throwable e1) {
        this.logger.severe("Exception while processing MO message: " + e1.getMessage(), e1);
        try {
            MAPErrorMessage errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageSystemFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), null, null, null);
            dialog.sendErrorComponent(evt.getInvokeId(), errorMessage);
            dialog.close(false);
            if (smscPropertiesManagement.isGenerateRejectionCdr()) {
                generateCDR(dialog.getNetworkId(), null, dialog.getLocalAddress(), CdrGenerator.CDR_SUBMIT_FAILED_HR, errorMessage.toString(), true);
            }
        } catch (Throwable e) {
            logger.severe("Error while sending Error message", e);
            return;
        }
        return;
    }
    if (sms == null || sms.getMessageDeliveryResultResponse() == null) {
        try {
            dialog.addMtForwardShortMessageResponse(evt.getInvokeId(), null, null);
            if (this.logger.isFineEnabled()) {
                this.logger.fine("Sent MtForwardShortMessageResponse = " + evt);
            }
            dialog.close(false);
        } catch (Throwable e) {
            logger.severe("Error while sending MoForwardShortMessageResponse ", e);
        }
    }
}
Also used : SccpAddress(org.restcomm.protocols.ss7.sccp.parameter.SccpAddress) GlobalTitle(org.restcomm.protocols.ss7.sccp.parameter.GlobalTitle) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)

Example 10 with MAPErrorMessage

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

the class MessageDeliveryResultResponseMo method responseDeliveryFailure.

@Override
public void responseDeliveryFailure(DeliveryFailureReason reason, MAPErrorMessage errMessage) {
    try {
        MAPErrorMessage errorMessage;
        if (errMessage != null && errMessage.isEmSMDeliveryFailure()) {
            MAPErrorMessageSMDeliveryFailure smDeliveryFailure = errMessage.getEmSMDeliveryFailure();
            errorMessage = this.provider.getMAPErrorMessageFactory().createMAPErrorMessageSMDeliveryFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), smDeliveryFailure.getSMEnumeratedDeliveryFailureCause(), null, null);
        } else {
            switch(reason) {
                case destinationUnavalable:
                    errorMessage = this.provider.getMAPErrorMessageFactory().createMAPErrorMessageSystemFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), NetworkResource.vlr, null, null);
                    break;
                case invalidDestinationAddress:
                    errorMessage = this.provider.getMAPErrorMessageFactory().createMAPErrorMessageSMDeliveryFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), SMEnumeratedDeliveryFailureCause.subscriberNotSCSubscriber, null, null);
                    break;
                case permanentNetworkError:
                    errorMessage = this.provider.getMAPErrorMessageFactory().createMAPErrorMessageSystemFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), NetworkResource.vlr, null, null);
                    break;
                case temporaryNetworkError:
                    errorMessage = this.provider.getMAPErrorMessageFactory().createMAPErrorMessageSystemFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), NetworkResource.vlr, null, null);
                    break;
                default:
                    errorMessage = this.provider.getMAPErrorMessageFactory().createMAPErrorMessageSystemFailure(dialog.getApplicationContext().getApplicationContextVersion().getVersion(), NetworkResource.vlr, null, null);
                    break;
            }
        }
        dialog.sendErrorComponent(evt.getInvokeId(), errorMessage);
        if (this.logger.isInfoEnabled()) {
            this.logger.info("Sent ErrorComponent = " + errorMessage);
        }
        dialog.close(false);
    } catch (Throwable e) {
        logger.severe("Error while sending Error message", e);
        return;
    }
}
Also used : MAPErrorMessageSMDeliveryFailure(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageSMDeliveryFailure) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)

Aggregations

MAPErrorMessage (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)17 SmsSet (org.mobicents.smsc.library.SmsSet)7 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)7 MAPDialogSms (org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms)7 ArrayList (java.util.ArrayList)6 Sms (org.mobicents.smsc.library.Sms)6 MAPException (org.restcomm.protocols.ss7.map.api.MAPException)6 SmscPropertiesManagement (org.mobicents.smsc.domain.SmscPropertiesManagement)5 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)5 MAPServiceSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy)5 SmsSetEvent (org.mobicents.smsc.slee.services.smpp.server.events.SmsSetEvent)5 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)5 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)5 ErrorComponent (org.restcomm.slee.resource.map.events.ErrorComponent)5 Test (org.testng.annotations.Test)5 UUID (java.util.UUID)4 PreparedStatementCollection (org.mobicents.smsc.cassandra.PreparedStatementCollection)4 SmsProxy (org.mobicents.smsc.slee.resources.persistence.SmsProxy)4 SendRoutingInfoForSMResponse (org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse)4 ReportSMDeliveryStatusResponseImpl (org.restcomm.protocols.ss7.map.service.sms.ReportSMDeliveryStatusResponseImpl)4