Search in sources :

Example 1 with InformServiceCenterContainer

use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.

the class MtSbb method setupReportSMDeliveryStatusRequestSuccess.

private void setupReportSMDeliveryStatusRequestSuccess(SmsSet smsSet, boolean versionMore1) {
    InformServiceCenterContainer informServiceCenterContainer = this.getInformServiceCenterContainer();
    if (informServiceCenterContainer != null && informServiceCenterContainer.getMwStatus() != null && informServiceCenterContainer.getMwStatus().getScAddressNotIncluded() == false && versionMore1) {
        // sending a report to HLR of a success delivery
        Sms sms0 = smsSet.getSms(0);
        String mtLocalSccpGt = null;
        Integer mtRemoteSccpTt = null;
        if (sms0 != null) {
            mtLocalSccpGt = sms0.getMtLocalSccpGt();
            mtRemoteSccpTt = sms0.getMtRemoteSccpTt();
        }
        this.setupReportSMDeliveryStatusRequest(smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), SMDeliveryOutcome.successfulTransfer, smsSet.getTargetId(), smsSet.getNetworkId(), mtLocalSccpGt, mtRemoteSccpTt);
    }
}
Also used : InformServiceCenterContainer(org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer) MAPDialogSms(org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms) Sms(org.mobicents.smsc.library.Sms) MAPErrorMessageSubscriberBusyForMtSms(org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms) ISDNAddressString(org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.mobicents.protocols.ss7.map.api.primitives.AddressString)

Example 2 with InformServiceCenterContainer

use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.

the class SriSbb method onInformServiceCentreRequest.

public void onInformServiceCentreRequest(InformServiceCentreRequest evt, ActivityContextInterface aci) {
    if (this.logger.isInfoEnabled()) {
        this.logger.info("\nReceived INFORM_SERVICE_CENTER_REQUEST = " + evt + " Dialog=" + evt.getMAPDialog());
    }
    InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
    informServiceCenterContainer.setMwStatus(evt.getMwStatus());
    this.setInformServiceCenterContainer(informServiceCenterContainer);
}
Also used : InformServiceCenterContainer(org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer)

Example 3 with InformServiceCenterContainer

use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.

the class SriSbb method onSms.

// *********
// initial event
public void onSms(SmsSetEvent event, ActivityContextInterface aci, EventContext eventContext) {
    SmsSet smsSet = event.getSmsSet();
    this.addInitialMessageSet(smsSet);
    try {
        if (this.logger.isFineEnabled()) {
            this.logger.fine("\nReceived Submit SMS. event= " + event + "this=" + this);
        }
        smscStatAggregator.updateMsgOutTryAll();
        smscStatAggregator.updateMsgOutTrySs7();
        if (smsSet.getDestAddrTon() == SmppConstants.TON_ALPHANUMERIC) {
            // bad TON at the destination address: alphanumerical is not supported
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.BAD_TYPE_OF_NUMBER, "TON \"alhpanumerical\" is not supported for as a destination address", true, null, false, ProcessingType.SS7_SRI);
            return;
        }
        if (smsSet.getDestAddrTon() != SmppConstants.TON_UNKNOWN && smsSet.getDestAddrTon() != SmppConstants.TON_INTERNATIONAL && smsSet.getDestAddrTon() != SmppConstants.TON_NATIONAL && smsSet.getDestAddrTon() != SmppConstants.TON_SUBSCRIBER) {
            // we support only following TON for a dest address
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.BAD_TYPE_OF_NUMBER, "TON " + smsSet.getDestAddrTon() + " is not supported for as a destination address", true, null, false, ProcessingType.SS7_SRI);
            return;
        }
        if (smsSet.getDestAddrNpi() != SmppConstants.NPI_UNKNOWN && smsSet.getDestAddrNpi() != SmppConstants.NPI_E164 && smsSet.getDestAddrNpi() != SmppConstants.NPI_X121 && smsSet.getDestAddrNpi() != SmppConstants.NPI_TELEX && smsSet.getDestAddrNpi() != SmppConstants.NPI_LAND_MOBILE) {
            // we support only following TON for a dest address
            this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.BAD_NPI, "NPI " + smsSet.getDestAddrNpi() + " is not supported for as a destination address", true, null, false, ProcessingType.SS7_SRI);
            return;
        }
        Sms sms = this.obtainNextMessage(ProcessingType.SS7_SRI);
        if (sms == null) {
            // this means that no messages with good ScheduleDeliveryTime or
            // no messages at all we have to reschedule
            this.markDeliveringIsEnded(true);
            return;
        }
        // checking for correlationId - may be we do not need SRI
        String correlationID = smsSet.getCorrelationId();
        CorrelationIdValue civ = null;
        if (correlationID != null) {
            civ = SmsSetCache.getInstance().getCorrelationIdCacheElement(correlationID);
            if (this.logger.isFineEnabled()) {
                this.logger.fine("HomeRouting: correlationID=" + correlationID + ", found CorrelationIdValue=" + civ);
            }
        }
        if (civ != null && civ.getLocationInfoWithLMSI() != null && civ.getImsi() != null) {
            // preloaded routing info is found - skip SRI request
            MWStatus mwStatus = civ.getMwStatus();
            if (mwStatus != null) {
                InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
                informServiceCenterContainer.setMwStatus(mwStatus);
                this.setInformServiceCenterContainer(informServiceCenterContainer);
            }
            this.setSriMapVersion(civ.getSriMapVersion());
            this.executeForwardSM(smsSet, civ.getLocationInfoWithLMSI(), civ.getImsi(), smsSet.getNetworkId());
            return;
        }
        // checking for cached - may be we do not need SRI
        String targetID = smsSet.getTargetId();
        SriResponseValue srv = null;
        srv = SmsSetCache.getInstance().getSriResponseValue(targetID);
        if (this.logger.isFineEnabled()) {
            this.logger.fine("SRI requesting: targetID=" + targetID + ", found cached SriResponseValue=" + srv);
        }
        if (srv != null) {
            // preloaded routing info is found - skip SRI request
            this.setSriMapVersion(3);
            this.executeForwardSM(smsSet, srv.getLocationInfoWithLMSI(), srv.getImsi(), smsSet.getNetworkId());
            return;
        }
        // no preloaded routing info
        this.sendSRI(smsSet, smsSet.getDestAddr(), smsSet.getDestAddrTon(), smsSet.getDestAddrNpi(), this.getSRIMAPApplicationContext(this.maxMAPApplicationContextVersion));
    } catch (Throwable e1) {
        String s = "Exception in SriSbb.onSms when fetching records and issuing events: " + e1.getMessage();
        logger.severe(s, e1);
        markDeliveringIsEnded(true);
    // this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SC_SYSTEM_ERROR, s, true, null, false);
    }
}
Also used : InformServiceCenterContainer(org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer) MWStatus(org.mobicents.protocols.ss7.map.api.service.sms.MWStatus) SriResponseValue(org.mobicents.smsc.library.SriResponseValue) MAPDialogSms(org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms) Sms(org.mobicents.smsc.library.Sms) ISDNAddressString(org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.mobicents.protocols.ss7.map.api.primitives.AddressString) CorrelationIdValue(org.mobicents.smsc.library.CorrelationIdValue) SmsSet(org.mobicents.smsc.library.SmsSet)

Example 4 with InformServiceCenterContainer

use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.

the class SriSbb method onErrorComponent.

// *********
// MAP Component events
@Override
public void onErrorComponent(ErrorComponent event, ActivityContextInterface aci) {
    super.onErrorComponent(event, aci);
    try {
        // we store error into CMP
        MAPErrorMessage mapErrorMessage = event.getMAPErrorMessage();
        this.setErrorResponse(mapErrorMessage);
        if (mapErrorMessage.isEmAbsentSubscriber()) {
            MAPErrorMessageAbsentSubscriber errAs = mapErrorMessage.getEmAbsentSubscriber();
            Boolean mwdSet = errAs.getMwdSet();
            if (mwdSet != null && mwdSet) {
                InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
                MWStatus mwStatus = event.getMAPDialog().getService().getMAPProvider().getMAPParameterFactory().createMWStatus(false, true, false, false);
                informServiceCenterContainer.setMwStatus(mwStatus);
                this.setInformServiceCenterContainer(informServiceCenterContainer);
            }
        }
    } catch (Throwable e1) {
        logger.severe("Exception in SriSbb.onErrorComponent when fetching records and issuing events: " + e1.getMessage(), e1);
    }
}
Also used : MAPErrorMessageAbsentSubscriber(org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriber) InformServiceCenterContainer(org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer) MWStatus(org.mobicents.protocols.ss7.map.api.service.sms.MWStatus) MAPErrorMessage(org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage)

Example 5 with InformServiceCenterContainer

use of org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer in project smscgateway by RestComm.

the class SriSbb method onSendRoutingInfoForSMResponse.

/**
 * Received response for SRI sent earlier
 *
 * @param evt
 * @param aci
 */
public void onSendRoutingInfoForSMResponse(SendRoutingInfoForSMResponse evt, ActivityContextInterface aci) {
    if (this.logger.isFineEnabled()) {
        this.logger.fine("\nReceived SEND_ROUTING_INFO_FOR_SM_RESPONSE = " + evt + " Dialog=" + evt.getMAPDialog());
    }
    if (evt.getMAPDialog().getApplicationContext().getApplicationContextVersion() == MAPApplicationContextVersion.version1 && evt.getMwdSet() != null && evt.getMwdSet()) {
        InformServiceCenterContainer informServiceCenterContainer = new InformServiceCenterContainer();
        MWStatus mwStatus = evt.getMAPDialog().getService().getMAPProvider().getMAPParameterFactory().createMWStatus(false, true, false, false);
        informServiceCenterContainer.setMwStatus(mwStatus);
        this.setInformServiceCenterContainer(informServiceCenterContainer);
    }
    this.setSendRoutingInfoForSMResponse(evt);
}
Also used : InformServiceCenterContainer(org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer) MWStatus(org.mobicents.protocols.ss7.map.api.service.sms.MWStatus)

Aggregations

InformServiceCenterContainer (org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer)5 MWStatus (org.mobicents.protocols.ss7.map.api.service.sms.MWStatus)3 AddressString (org.mobicents.protocols.ss7.map.api.primitives.AddressString)2 ISDNAddressString (org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString)2 MAPDialogSms (org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms)2 Sms (org.mobicents.smsc.library.Sms)2 MAPErrorMessage (org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage)1 MAPErrorMessageAbsentSubscriber (org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriber)1 MAPErrorMessageSubscriberBusyForMtSms (org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessageSubscriberBusyForMtSms)1 CorrelationIdValue (org.mobicents.smsc.library.CorrelationIdValue)1 SmsSet (org.mobicents.smsc.library.SmsSet)1 SriResponseValue (org.mobicents.smsc.library.SriResponseValue)1