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