Search in sources :

Example 6 with CorrelationIdValue

use of org.mobicents.smsc.library.CorrelationIdValue in project smscgateway by RestComm.

the class HrSriClientSbb method onDialogProviderAbort.

public void onDialogProviderAbort(DialogProviderAbort evt, ActivityContextInterface aci) {
    try {
        super.onDialogProviderAbort(evt, aci);
        MAPAbortProviderReason abortProviderReason = evt.getAbortProviderReason();
        CorrelationIdValue correlationIdValue = this.getCorrelationIdValue();
        if (correlationIdValue == null) {
            this.logger.severe("HrSriClientSbb.onDialogProviderAbort(): CorrelationIdValue CMP missed");
            return;
        }
        this.returnSriFailure(correlationIdValue, null, "(home routing) onDialogProviderAbort after SRI Request: " + abortProviderReason != null ? abortProviderReason.toString() : "");
    } catch (Throwable e1) {
        logger.severe("Exception in HrSriClientSbb.onDialogProviderAbort() (home routing) when fetching records and issuing events: " + e1.getMessage(), e1);
    }
}
Also used : MAPAbortProviderReason(org.mobicents.protocols.ss7.map.api.dialog.MAPAbortProviderReason) CorrelationIdValue(org.mobicents.smsc.library.CorrelationIdValue)

Example 7 with CorrelationIdValue

use of org.mobicents.smsc.library.CorrelationIdValue in project smscgateway by RestComm.

the class HrSriClientSbb method onDialogReject.

public void onDialogReject(DialogReject evt, ActivityContextInterface aci) {
    super.onDialogReject(evt, aci);
    try {
        MAPRefuseReason mapRefuseReason = evt.getRefuseReason();
        CorrelationIdValue correlationIdValue = this.getCorrelationIdValue();
        if (correlationIdValue == null) {
            this.logger.severe("HrSriClientSbb.onDialogReject(): CorrelationIdValue CMP missed");
            return;
        }
        if (mapRefuseReason == MAPRefuseReason.PotentialVersionIncompatibility && evt.getMAPDialog().getApplicationContext().getApplicationContextVersion() != MAPApplicationContextVersion.version1) {
            if (logger.isWarningEnabled()) {
                this.logger.warning("Home routing: Rx : Sri (home routing) onDialogReject / PotentialVersionIncompatibility=" + evt);
            }
            // possible a peer supports only MAP V1
            // Now send new SRI with supported ACN (MAP V1)
            this.sendSRI(correlationIdValue.getMsisdn().getAddress(), correlationIdValue.getMsisdn().getAddressNature().getIndicator(), correlationIdValue.getMsisdn().getNumberingPlan().getIndicator(), this.getSRIMAPApplicationContext(MAPApplicationContextVersion.version1), correlationIdValue);
            return;
        }
        // If ACN not supported, lets use the new one suggested
        if (mapRefuseReason == MAPRefuseReason.ApplicationContextNotSupported) {
            if (logger.isWarningEnabled()) {
                this.logger.warning("Home routing: Rx : Sri (home routing) onDialogReject / ApplicationContextNotSupported=" + evt);
            }
            // Now send new SRI with supported ACN
            ApplicationContextName tcapApplicationContextName = evt.getAlternativeApplicationContext();
            MAPApplicationContext supportedMAPApplicationContext = MAPApplicationContext.getInstance(tcapApplicationContextName.getOid());
            this.sendSRI(correlationIdValue.getMsisdn().getAddress(), correlationIdValue.getMsisdn().getAddressNature().getIndicator(), correlationIdValue.getMsisdn().getNumberingPlan().getIndicator(), this.getSRIMAPApplicationContext(supportedMAPApplicationContext.getApplicationContextVersion()), correlationIdValue);
            return;
        }
        this.returnSriFailure(correlationIdValue, null, "Home routing: onDialogReject after SRI Request: " + mapRefuseReason != null ? mapRefuseReason.toString() : "");
    } catch (Throwable e1) {
        logger.severe("Exception in SriSbb.onDialogReject() (home routing) when fetching records and issuing events: " + e1.getMessage(), e1);
    }
}
Also used : ApplicationContextName(org.mobicents.protocols.ss7.tcap.asn.ApplicationContextName) MAPApplicationContextName(org.mobicents.protocols.ss7.map.api.MAPApplicationContextName) MAPRefuseReason(org.mobicents.protocols.ss7.map.api.dialog.MAPRefuseReason) CorrelationIdValue(org.mobicents.smsc.library.CorrelationIdValue) MAPApplicationContext(org.mobicents.protocols.ss7.map.api.MAPApplicationContext)

Example 8 with CorrelationIdValue

use of org.mobicents.smsc.library.CorrelationIdValue in project smscgateway by RestComm.

the class HrSriClientSbb method onDialogUserAbort.

public void onDialogUserAbort(DialogUserAbort evt, ActivityContextInterface aci) {
    try {
        super.onDialogUserAbort(evt, aci);
        String reason = getUserAbortReason(evt);
        CorrelationIdValue correlationIdValue = this.getCorrelationIdValue();
        if (correlationIdValue == null) {
            this.logger.severe("HrSriClientSbb.onDialogUserAbort(): CorrelationIdValue CMP missed");
            return;
        }
        this.returnSriFailure(correlationIdValue, null, "(home routing) onDialogUserAbort after SRI Request: " + reason != null ? reason.toString() : "");
    } catch (Throwable e1) {
        logger.severe("Exception in SriSbb.onDialogUserAbort() (home routing) when fetching records and issuing events: " + e1.getMessage(), e1);
    }
}
Also used : ISDNAddressString(org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.mobicents.protocols.ss7.map.api.primitives.AddressString) CorrelationIdValue(org.mobicents.smsc.library.CorrelationIdValue)

Example 9 with CorrelationIdValue

use of org.mobicents.smsc.library.CorrelationIdValue in project smscgateway by RestComm.

the class HrSriClientSbb method onInformServiceCentreRequest.

public void onInformServiceCentreRequest(InformServiceCentreRequest evt, ActivityContextInterface aci) {
    if (this.logger.isInfoEnabled()) {
        this.logger.info("\nHome routing: HrSriClientSbb: Received INFORM_SERVICE_CENTER_REQUEST = " + evt + " Dialog=" + evt.getMAPDialog());
    }
    CorrelationIdValue correlationIdValue = this.getCorrelationIdValue();
    if (correlationIdValue != null) {
        correlationIdValue.setMwStatus(evt.getMwStatus());
        correlationIdValue.setInformServiceCentreRequest(evt);
        this.setCorrelationIdValue(correlationIdValue);
    }
}
Also used : CorrelationIdValue(org.mobicents.smsc.library.CorrelationIdValue)

Example 10 with CorrelationIdValue

use of org.mobicents.smsc.library.CorrelationIdValue 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)

Aggregations

CorrelationIdValue (org.mobicents.smsc.library.CorrelationIdValue)10 AddressString (org.mobicents.protocols.ss7.map.api.primitives.AddressString)3 ISDNAddressString (org.mobicents.protocols.ss7.map.api.primitives.ISDNAddressString)3 MWStatus (org.mobicents.protocols.ss7.map.api.service.sms.MWStatus)3 MAPErrorMessage (org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage)2 MAPApplicationContext (org.mobicents.protocols.ss7.map.api.MAPApplicationContext)1 MAPApplicationContextName (org.mobicents.protocols.ss7.map.api.MAPApplicationContextName)1 MAPAbortProviderReason (org.mobicents.protocols.ss7.map.api.dialog.MAPAbortProviderReason)1 MAPRefuseReason (org.mobicents.protocols.ss7.map.api.dialog.MAPRefuseReason)1 MAPErrorMessageAbsentSubscriber (org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriber)1 MAPDialogSms (org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms)1 SendRoutingInfoForSMResponse (org.mobicents.protocols.ss7.map.api.service.sms.SendRoutingInfoForSMResponse)1 ApplicationContextName (org.mobicents.protocols.ss7.tcap.asn.ApplicationContextName)1 Sms (org.mobicents.smsc.library.Sms)1 SmsSet (org.mobicents.smsc.library.SmsSet)1 SriResponseValue (org.mobicents.smsc.library.SriResponseValue)1 MProcResult (org.mobicents.smsc.mproc.impl.MProcResult)1 InformServiceCenterContainer (org.mobicents.smsc.slee.services.smpp.server.events.InformServiceCenterContainer)1