use of org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.
the class MoSbb method handleSmsDeliverTpdu.
private Sms handleSmsDeliverTpdu(SmsDeliverTpdu smsDeliverTpdu, CorrelationIdValue civ, int networkId, String originatorSccpAddress, boolean isMoOperation, MAPDialogSms dialog, SmsMessage evt, long invokeId) throws SmscProcessingException {
TargetAddress ta = createDestTargetAddress(civ.getMsisdn(), networkId);
Sms sms = this.createSmsEvent(smsDeliverTpdu, ta, persistence, civ, networkId, originatorSccpAddress);
return sms;
// return this.processSms(sms, persistence, smscPropertiesManagement.getHrCharging(), isMoOperation, dialog, evt, invokeId);
}
use of org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms in project smscgateway by RestComm.
the class MoSbb method handleSmsSubmitTpdu.
private Sms handleSmsSubmitTpdu(SmsSubmitTpdu smsSubmitTpdu, AddressString callingPartyAddress, int networkId, String originatorSccpAddress, boolean isMoOperation, MAPDialogSms dialog, SmsMessage evt, long invokeId, String origMoServiceCentreAddressDA) throws SmscProcessingException {
TargetAddress ta = createDestTargetAddress(smsSubmitTpdu.getDestinationAddress(), networkId);
Sms sms = this.createSmsEvent(smsSubmitTpdu, ta, persistence, callingPartyAddress, networkId, originatorSccpAddress);
sms.setOrigMoServiceCentreAddressDA(origMoServiceCentreAddressDA);
return sms;
// return this.processSms(sms, persistence, smscPropertiesManagement.getMoCharging(), isMoOperation, dialog, evt, invokeId);
}
use of org.mobicents.protocols.ss7.map.api.service.sms.MAPDialogSms 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.service.sms.MAPDialogSms 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.service.sms.MAPDialogSms 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