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);
}
}
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;
}
Aggregations