use of org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage in project smscgateway by RestComm.
the class HrSriServerSbb method onSendRoutingInfoForSMRequest.
/**
* MAP SMS Events
*/
/**
* Received SRI request. But this is error, we should never receive this
* request
*
* @param evt
* @param aci
*/
public void onSendRoutingInfoForSMRequest(SendRoutingInfoForSMRequest evt, ActivityContextInterface aci) {
if (this.logger.isInfoEnabled()) {
this.logger.info("Home routing: HrSriServerSbb: Received SEND_ROUTING_INFO_FOR_SM_REQUEST = " + evt + " Dialog=" + evt.getMAPDialog());
}
this.setInvokeId(evt.getInvokeId());
MAPDialogSms dialog = evt.getMAPDialog();
// we are changing here SSN in CallingPartyAddress of a SRI response to HLR SSN
// because it is possible that this address has been updated inside SCCP routing procedure
// when a message came to SMSC
// TODO: check if it is a proper solution ?
SccpAddress locAddr = dialog.getLocalAddress();
SccpAddress locAddr2 = sccpParameterFact.createSccpAddress(locAddr.getAddressIndicator().getRoutingIndicator(), locAddr.getGlobalTitle(), locAddr.getSignalingPointCode(), smscPropertiesManagement.getHlrSsn());
dialog.setLocalAddress(locAddr2);
if (smscPropertiesManagement.getHrCharging() == MoChargingType.reject) {
try {
MAPErrorMessage errorMessage = this.mapProvider.getMAPErrorMessageFactory().createMAPErrorMessageFacilityNotSup(null, null, null);
dialog.sendErrorComponent(evt.getInvokeId(), errorMessage);
if (this.logger.isInfoEnabled()) {
this.logger.info("Home routing: Sent ErrorComponent = " + errorMessage);
}
if (smscPropertiesManagement.isGenerateRejectionCdr()) {
generateCDR(dialog.getNetworkId(), CdrGenerator.CDR_SUBMIT_FAILED_HR, errorMessage.toString(), true);
}
dialog.close(false);
return;
} catch (Throwable e) {
logger.severe("Home routing: Error while sending Error message", e);
return;
}
}
setupSriRequest(evt.getMsisdn(), evt.getServiceCentreAddress(), dialog.getNetworkId(), dialog.getRemoteAddress());
}
use of org.mobicents.protocols.ss7.map.api.errors.MAPErrorMessage in project smscgateway by RestComm.
the class MAPListener method onForwardShortMessageRequest.
@Override
public void onForwardShortMessageRequest(ForwardShortMessageRequest event) {
if (logger.isInfoEnabled()) {
logger.info("Rx : onForwardShortMessageRequest=" + event);
}
// Lets first close the Dialog
MAPDialogSms mapDialogSms = event.getMAPDialog();
try {
if (this.currentMapMessageCount % 7 == 0) {
// Send back AbsentSubscriber for every 7th MtSMS
MAPErrorMessage mapErrorMessage = mAPErrorMessageFactory.createMAPErrorMessageAbsentSubscriberSM(AbsentSubscriberDiagnosticSM.IMSIDetached, null, null);
mapDialogSms.sendErrorComponent(event.getInvokeId(), mapErrorMessage);
// mapDialogSms.close(false);
} else {
mapDialogSms.addForwardShortMessageResponse(event.getInvokeId());
// mapDialogSms.close(false);
}
} catch (MAPException e) {
logger.error("Error while sending MAPErrorMessageAbsentSubscriberSM ", e);
}
mapDialogSms.setUserObject(true);
}
Aggregations