Search in sources :

Example 16 with MAPErrorMessage

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

the class HrSriServerSbb method onSendRoutingInfoForSMRequest.

/**
 * MAP SMS Events
 */
/**
 * Received SRI request. But this is error, we should never receive this
 * request
 *
 * @param evt
 * @param aci
 */
public void onSendRoutingInfoForSMRequest(SendRoutingInfoForSMRequest evt, ActivityContextInterface aci) {
    if (this.logger.isInfoEnabled()) {
        this.logger.info("Home routing: HrSriServerSbb: Received SEND_ROUTING_INFO_FOR_SM_REQUEST = " + evt + " Dialog=" + evt.getMAPDialog());
    }
    this.setInvokeId(evt.getInvokeId());
    MAPDialogSms dialog = evt.getMAPDialog();
    // we are changing here SSN in CallingPartyAddress of a SRI response to HLR SSN
    // because it is possible that this address has been updated inside SCCP routing procedure
    // when a message came to SMSC
    // TODO: check if it is a proper solution ?
    SccpAddress locAddr = dialog.getLocalAddress();
    SccpAddress locAddr2 = sccpParameterFact.createSccpAddress(locAddr.getAddressIndicator().getRoutingIndicator(), locAddr.getGlobalTitle(), locAddr.getSignalingPointCode(), smscPropertiesManagement.getHlrSsn());
    dialog.setLocalAddress(locAddr2);
    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("Home routing: Sent ErrorComponent = " + errorMessage);
            }
            if (smscPropertiesManagement.isGenerateRejectionCdr()) {
                generateCDR(dialog.getNetworkId(), CdrGenerator.CDR_SUBMIT_FAILED_HR, errorMessage.toString(), true);
            }
            dialog.close(false);
            return;
        } catch (Throwable e) {
            logger.severe("Home routing: Error while sending Error message", e);
            return;
        }
    }
    setupSriRequest(evt.getMsisdn(), evt.getServiceCentreAddress(), dialog.getNetworkId(), dialog.getRemoteAddress());
}
Also used : SccpAddress(org.restcomm.protocols.ss7.sccp.parameter.SccpAddress) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) MAPErrorMessage(org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)

Example 17 with MAPErrorMessage

use of org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage 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

MAPErrorMessage (org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessage)17 SmsSet (org.mobicents.smsc.library.SmsSet)7 MAPDialogSms (org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms)6 ArrayList (java.util.ArrayList)5 SmscPropertiesManagement (org.mobicents.smsc.domain.SmscPropertiesManagement)5 Sms (org.mobicents.smsc.library.Sms)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 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)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 MAPException (org.restcomm.protocols.ss7.map.api.MAPException)4 SendRoutingInfoForSMResponse (org.restcomm.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse)4 ReportSMDeliveryStatusResponseImpl (org.restcomm.protocols.ss7.map.service.sms.ReportSMDeliveryStatusResponseImpl)4 SccpAddress (org.restcomm.protocols.ss7.sccp.parameter.SccpAddress)4