use of org.mobicents.protocols.ss7.map.api.smstpdu.SmsCommandTpdu in project smscgateway by RestComm.
the class MoSbb method processMoMessage.
private Sms processMoMessage(SM_RP_OA smRPOA, SM_RP_DA smRPDA, SmsSignalInfo smsSignalInfo, int networkId, String originatorSccpAddress, boolean isMoOperation, MAPDialogSms dialog, SmsMessage evt, long invokeId) throws SmscProcessingException {
// TODO: check if smRPDA contains local SMSC address and reject messages
// if not equal ???
Sms sms = null;
smsSignalInfo.setGsm8Charset(isoCharset);
ISDNAddressString callingPartyAddress = smRPOA.getMsisdn();
if (callingPartyAddress == null) {
throw new SmscProcessingException("MO callingPartyAddress is absent", SmppConstants.STATUS_SYSERR, MAPErrorCode.unexpectedDataValue, SmscProcessingException.HTTP_ERROR_CODE_NOT_SET, null);
}
SmsTpdu smsTpdu = null;
String origMoServiceCentreAddressDA = null;
if (smRPDA.getServiceCentreAddressDA() != null) {
origMoServiceCentreAddressDA = smRPDA.getServiceCentreAddressDA().getAddress();
}
try {
smsTpdu = smsSignalInfo.decodeTpdu(true);
switch(smsTpdu.getSmsTpduType()) {
case SMS_SUBMIT:
SmsSubmitTpdu smsSubmitTpdu = (SmsSubmitTpdu) smsTpdu;
if (this.logger.isInfoEnabled()) {
this.logger.info("Received SMS_SUBMIT = " + smsSubmitTpdu);
}
sms = this.handleSmsSubmitTpdu(smsSubmitTpdu, callingPartyAddress, networkId, originatorSccpAddress, isMoOperation, dialog, evt, invokeId, origMoServiceCentreAddressDA);
break;
case SMS_DELIVER_REPORT:
SmsDeliverReportTpdu smsDeliverReportTpdu = (SmsDeliverReportTpdu) smsTpdu;
if (this.logger.isInfoEnabled()) {
this.logger.info("Received SMS_DELIVER_REPORT = " + smsDeliverReportTpdu);
smscStatAggregator.updateMsgInFailedAll();
}
// callingPartyAddress);
break;
case SMS_COMMAND:
SmsCommandTpdu smsCommandTpdu = (SmsCommandTpdu) smsTpdu;
if (this.logger.isInfoEnabled()) {
this.logger.info("Received SMS_COMMAND = " + smsCommandTpdu);
smscStatAggregator.updateMsgInFailedAll();
}
// callingPartyAddress);
break;
// break;
default:
this.logger.severe("Received non SMS_SUBMIT or SMS_DELIVER_REPORT or SMS_COMMAND or SMS_DELIVER = " + smsTpdu);
smscStatAggregator.updateMsgInFailedAll();
break;
}
} catch (MAPException e1) {
logger.severe("Error while decoding SmsSignalInfo ", e1);
}
return sms;
}
Aggregations