use of org.mobicents.protocols.ss7.map.api.MAPException in project smscgateway by RestComm.
the class MAPListener method onMoForwardShortMessageRequest.
@Override
public void onMoForwardShortMessageRequest(MoForwardShortMessageRequest request) {
if (logger.isDebugEnabled()) {
logger.debug("Rx : MoForwardShortMessageRequestIndication=" + request);
}
MAPDialogSms dialog = request.getMAPDialog();
try {
// TODO Should we add PENDING SMS TPDU here itself?
dialog.addMoForwardShortMessageResponse(request.getInvokeId(), null, null);
// dialog.close(false);
} catch (MAPException e) {
logger.error("Error while sending MoForwardShortMessageResponse ", e);
}
dialog.setUserObject(true);
try {
SmsSignalInfo smsSignalInfo = request.getSM_RP_UI();
SmsTpdu smsTpdu = smsSignalInfo.decodeTpdu(true);
if (smsTpdu.getSmsTpduType() != SmsTpduType.SMS_SUBMIT) {
// TODO : Error, we should always receive SMS_SUBMIT for
// MoForwardShortMessageRequestIndication
logger.error("Rx : MoForwardShortMessageRequestIndication, but SmsTpduType is not SMS_SUBMIT. SmsTpdu=" + smsTpdu);
return;
}
SmsSubmitTpdu smsSubmitTpdu = (SmsSubmitTpdu) smsTpdu;
AddressField destinationAddress = smsSubmitTpdu.getDestinationAddress();
// TODO Normalize
} catch (MAPException e1) {
logger.error("Error while decoding SmsSignalInfo ", e1);
}
}
use of org.mobicents.protocols.ss7.map.api.MAPException in project smscgateway by RestComm.
the class MAPListener method onReportSMDeliveryStatusRequest.
@Override
public void onReportSMDeliveryStatusRequest(ReportSMDeliveryStatusRequest event) {
if (logger.isInfoEnabled()) {
logger.info("Rx : ReportSMDeliveryStatusRequest=" + event);
}
MAPDialogSms dialog = event.getMAPDialog();
try {
dialog.addReportSMDeliveryStatusResponse(event.getInvokeId(), event.getMsisdn(), null);
// dialog.close(false);
} catch (MAPException e) {
e.printStackTrace();
}
dialog.setUserObject(true);
}
use of org.mobicents.protocols.ss7.map.api.MAPException 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