Search in sources :

Example 16 with MAPApplicationContext

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

the class HrSriClientSbb method setupRoutingInfoForSMRequestIndication.

private MAPDialogSms setupRoutingInfoForSMRequestIndication(String destinationAddress, int ton, int npi, MAPApplicationContext mapApplicationContext, int networkId) throws MAPException {
    // this.mapParameterFactory.creat
    String hlrAddress = destinationAddress;
    String hrHlrNumber = smscPropertiesManagement.getHrHlrNumber(networkId);
    if (hrHlrNumber != null && hrHlrNumber.length() > 0) {
        hlrAddress = hrHlrNumber;
    }
    SccpAddress destinationAddr = this.convertAddressFieldToSCCPAddress(hlrAddress, ton, npi);
    MAPDialogSms mapDialogSms = this.mapProvider.getMAPServiceSms().createNewDialog(mapApplicationContext, this.getServiceCenterSccpAddress(networkId), null, destinationAddr, null);
    mapDialogSms.setNetworkId(networkId);
    ISDNAddressString isdn = this.getCalledPartyISDNAddressString(destinationAddress, ton, npi);
    AddressString serviceCenterAddress = this.getServiceCenterAddressString(networkId);
    boolean sm_RP_PRI = true;
    mapDialogSms.addSendRoutingInfoForSMRequest(isdn, sm_RP_PRI, serviceCenterAddress, null, false, null, null, null, false, null, false, false, null, null);
    if (this.logger.isInfoEnabled())
        this.logger.info("Home routing: HrSriClientSbb: Sending: SendRoutingInfoForSMRequest: isdn=" + isdn + ", serviceCenterAddress=" + serviceCenterAddress + ", sm_RP_PRI=" + sm_RP_PRI);
    return mapDialogSms;
}
Also used : SccpAddress(org.restcomm.protocols.ss7.sccp.parameter.SccpAddress) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString) MAPDialogSms(org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) ISDNAddressString(org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString) AddressString(org.restcomm.protocols.ss7.map.api.primitives.AddressString)

Example 17 with MAPApplicationContext

use of org.restcomm.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 18 with MAPApplicationContext

use of org.restcomm.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 AddressString (org.restcomm.protocols.ss7.map.api.primitives.AddressString)12 ISDNAddressString (org.restcomm.protocols.ss7.map.api.primitives.ISDNAddressString)12 SmsSet (org.mobicents.smsc.library.SmsSet)8 MAPDialogSms (org.restcomm.protocols.ss7.map.api.service.sms.MAPDialogSms)8 Sms (org.mobicents.smsc.library.Sms)7 Date (java.util.Date)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 SM_RP_DA (org.restcomm.protocols.ss7.map.api.service.sms.SM_RP_DA)5 SmsSignalInfo (org.restcomm.protocols.ss7.map.api.service.sms.SmsSignalInfo)5 AddressStringImpl (org.restcomm.protocols.ss7.map.primitives.AddressStringImpl)5 ISDNAddressStringImpl (org.restcomm.protocols.ss7.map.primitives.ISDNAddressStringImpl)5 SccpAddress (org.restcomm.protocols.ss7.sccp.parameter.SccpAddress)5 ActivityContextInterface (javax.slee.ActivityContextInterface)4 PreparedStatementCollection (org.mobicents.smsc.cassandra.PreparedStatementCollection)4 MAPException (org.restcomm.protocols.ss7.map.api.MAPException)4 AddressField (org.restcomm.protocols.ss7.map.api.smstpdu.AddressField)4 DataCodingScheme (org.restcomm.protocols.ss7.map.api.smstpdu.DataCodingScheme)4