use of org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriberSM in project smscgateway by RestComm.
the class MAPListener method onMtForwardShortMessageRequest.
@Override
public void onMtForwardShortMessageRequest(MtForwardShortMessageRequest event) {
if (logger.isInfoEnabled()) {
logger.info("Rx : onMtForwardShortMessageIndication=" + event);
}
// Lets first close the Dialog
MAPDialogSms mapDialogSms = event.getMAPDialog();
// boolean sendError = true;
try {
if (this.currentMapMessageCount % 7 == 0) {
// if (sendError) {
// 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.addMtForwardShortMessageResponse(event.getInvokeId(), null, null);
// mapDialogSms.close(false);
}
} catch (MAPException e) {
logger.error("Error while sending MAPErrorMessageAbsentSubscriberSM ", e);
}
mapDialogSms.setUserObject(true);
}
use of org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriberSM in project smscgateway by RestComm.
the class MtSbb method onErrorComponent.
// *********
// MAP Component events
@Override
public void onErrorComponent(ErrorComponent event, ActivityContextInterface aci) {
try {
super.onErrorComponent(event, aci);
SmsSet smsSet = getSmsSet();
if (smsSet == null) {
logger.severe("MtSbb.onErrorComponent(): CMP smsSet is missed");
return;
}
MAPErrorMessage mapErrorMessage = event.getMAPErrorMessage();
if (mapErrorMessage.isEmSubscriberBusyForMtSms()) {
MAPErrorMessageSubscriberBusyForMtSms subscriberBusyForMtSms = mapErrorMessage.getEmSubscriberBusyForMtSms();
this.onDeliveryError(smsSet, ErrorAction.subscriberBusy, ErrorCode.USER_BUSY, "Error subscriberBusyForMtSms after MtForwardSM Request: " + subscriberBusyForMtSms.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
} else if (mapErrorMessage.isEmAbsentSubscriber()) {
MAPErrorMessageAbsentSubscriber absentSubscriber = mapErrorMessage.getEmAbsentSubscriber();
this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "Error absentSubscriber after MtForwardSM Request: " + absentSubscriber.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
} else if (mapErrorMessage.isEmAbsentSubscriberSM()) {
MAPErrorMessageAbsentSubscriberSM absentSubscriber = mapErrorMessage.getEmAbsentSubscriberSM();
this.onDeliveryError(smsSet, ErrorAction.mobileNotReachableFlag, ErrorCode.ABSENT_SUBSCRIBER, "Error absentSubscriberSM after MtForwardSM Request: " + absentSubscriber.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
} else if (mapErrorMessage.isEmSMDeliveryFailure()) {
MAPErrorMessageSMDeliveryFailure smDeliveryFailure = mapErrorMessage.getEmSMDeliveryFailure();
SmsDeliverReportTpdu tpdu = null;
try {
tpdu = smDeliveryFailure.getSmsDeliverReportTpdu();
} catch (MAPException e) {
// we skip any possible Exception here
}
ErrorAction errAction;
// checking firstly a case of FailureCause existence in tpdu
if (tpdu != null && tpdu.getFailureCause() != null) {
int tpduCauseCode = tpdu.getFailureCause().getCode();
PermanentTemporaryFailure tpFailureCauseStatus = SmscPropertiesManagement.getInstance().getSmDeliveryFailureTpCause(tpduCauseCode);
if (tpFailureCauseStatus == PermanentTemporaryFailure.temporary) {
errAction = ErrorAction.temporaryFailure;
} else {
errAction = ErrorAction.permanentFailure;
}
this.onDeliveryError(smsSet, errAction, ErrorCode.SENDING_SM_FAILED, "Error smDeliveryFailure after MtForwardSM Request: " + smDeliveryFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
} else {
// no FailureCause existence in tpdu - then checking DeliveryFailureCause code
PermanentTemporaryFailure smDlrStatus = SmscPropertiesManagement.getInstance().getSmDeliveryFailure(smDeliveryFailure.getSMEnumeratedDeliveryFailureCause().getCode());
if (smDeliveryFailure.getSMEnumeratedDeliveryFailureCause() == SMEnumeratedDeliveryFailureCause.memoryCapacityExceeded) {
if (smDlrStatus == PermanentTemporaryFailure.permanent)
errAction = ErrorAction.permanentFailure;
else
errAction = ErrorAction.memoryCapacityExceededFlag;
this.onDeliveryError(smsSet, errAction, ErrorCode.MESSAGE_QUEUE_FULL, "Error smDeliveryFailure after MtForwardSM Request: " + smDeliveryFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
} else {
if (smDlrStatus == PermanentTemporaryFailure.temporary)
errAction = ErrorAction.temporaryFailure;
else
errAction = ErrorAction.permanentFailure;
this.onDeliveryError(smsSet, errAction, ErrorCode.SENDING_SM_FAILED, "Error smDeliveryFailure after MtForwardSM Request: " + smDeliveryFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
}
}
} else if (mapErrorMessage.isEmSystemFailure()) {
// TODO: may be it is not a permanent case ???
MAPErrorMessageSystemFailure systemFailure = mapErrorMessage.getEmSystemFailure();
this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SYSTEM_FAILURE, "Error systemFailure after MtForwardSM Request: " + systemFailure.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
} else if (mapErrorMessage.isEmFacilityNotSup()) {
MAPErrorMessageFacilityNotSup facilityNotSup = mapErrorMessage.getEmFacilityNotSup();
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.FACILITY_NOT_SUPPORTED, "Error facilityNotSup after MtForwardSM Request: " + facilityNotSup.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
} else if (mapErrorMessage.isEmExtensionContainer()) {
MAPErrorMessageExtensionContainer extensionContainer = mapErrorMessage.getEmExtensionContainer();
switch((int) (long) extensionContainer.getErrorCode()) {
case MAPErrorCode.dataMissing:
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.DATA_MISSING, "Error dataMissing after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
break;
case MAPErrorCode.unexpectedDataValue:
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNEXPECTED_DATA, "Error unexpectedDataValue after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
break;
// break;
case MAPErrorCode.unidentifiedSubscriber:
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.UNDEFINED_SUBSCRIBER, "Error unidentifiedSubscriber after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
break;
case MAPErrorCode.illegalSubscriber:
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.ILLEGAL_SUBSCRIBER, "Error illegalSubscriber after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
break;
case MAPErrorCode.illegalEquipment:
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.ILLEGAL_EQUIPMENT, "Error illegalEquipment after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
break;
default:
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.SYSTEM_FAILURE, "Error after MtForwardSM Request: " + extensionContainer.toString(), true, mapErrorMessage, false, ProcessingType.SS7_MT);
break;
}
} else {
this.onDeliveryError(smsSet, ErrorAction.permanentFailure, ErrorCode.SYSTEM_FAILURE, "Error after MtForwardSM Request: " + mapErrorMessage, true, mapErrorMessage, false, ProcessingType.SS7_MT);
}
} catch (Throwable e1) {
logger.severe("Exception in MtSbb.onErrorComponent() when fetching records and issuing events: " + e1.getMessage(), e1);
markDeliveringIsEnded(true);
}
}
use of org.restcomm.protocols.ss7.map.api.errors.MAPErrorMessageAbsentSubscriberSM 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