Search in sources :

Example 11 with MAPApplicationContext

use of org.mobicents.protocols.ss7.map.api.MAPApplicationContext 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 : MAPApplicationContextName(org.restcomm.protocols.ss7.map.api.MAPApplicationContextName) ApplicationContextName(org.restcomm.protocols.ss7.tcap.asn.ApplicationContextName) MAPRefuseReason(org.restcomm.protocols.ss7.map.api.dialog.MAPRefuseReason) CorrelationIdValue(org.mobicents.smsc.library.CorrelationIdValue) MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext)

Example 12 with MAPApplicationContext

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

the class HrSriClientSbb method getSRIMAPApplicationContext.

private MAPApplicationContext getSRIMAPApplicationContext(MAPApplicationContextVersion applicationContextVersion) {
    MAPApplicationContext mapApplicationContext = MAPApplicationContext.getInstance(MAPApplicationContextName.shortMsgGatewayContext, applicationContextVersion);
    this.setSriMapVersion(applicationContextVersion.getVersion());
    return mapApplicationContext;
}
Also used : MAPApplicationContext(org.restcomm.protocols.ss7.map.api.MAPApplicationContext)

Aggregations

MAPApplicationContext (org.restcomm.protocols.ss7.map.api.MAPApplicationContext)12 SmsSet (org.mobicents.smsc.library.SmsSet)7 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)7 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)7 Date (java.util.Date)5 Sms (org.mobicents.smsc.library.Sms)5 MAPDialogSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPDialogSmsProxy)5 MAPProviderProxy (org.mobicents.smsc.slee.resources.persistence.MAPProviderProxy)5 MAPServiceSmsProxy (org.mobicents.smsc.slee.resources.persistence.MAPServiceSmsProxy)5 AddressStringImpl (org.restcomm.protocols.ss7.map.primitives.AddressStringImpl)5 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)5 PreparedStatementCollection (org.mobicents.smsc.cassandra.PreparedStatementCollection)4 SM_RP_DA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA)4 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)4 AddressField (org.restcomm.protocols.ss7.map.api.smstpdu.AddressField)4 DataCodingScheme (org.restcomm.protocols.ss7.map.api.smstpdu.DataCodingScheme)4 ProtocolIdentifier (org.restcomm.protocols.ss7.map.api.smstpdu.ProtocolIdentifier)4 SmsTpdu (org.restcomm.protocols.ss7.map.api.smstpdu.SmsTpdu)4 UserData (org.restcomm.protocols.ss7.map.api.smstpdu.UserData)4 ForwardShortMessageRequestImpl (org.restcomm.protocols.ss7.map.service.sms.ForwardShortMessageRequestImpl)4