Exemple #1
0
    def PDURequestFailed(self, error, reqPDU):
        if error.check(SMPPProtocolError):
            # Get the original error
            try:
                error.raiseException()
            except SMPPProtocolError as validation_error:
                self.log.info(
                    "Application raised error '%s', forwarding to client. Inbound PDU was [%s], hex[%s]"
                    % (validation_error, reqPDU,
                       _safelylogOutPdu(self.encoder.encode(reqPDU))))
                # Jasmin update: validation_error have attribute named commandStatusName
                #return_cmd_status = validation_error.commandStatusName
                return_cmd_status = validation_error.status
                shutdown = False
        else:
            self.log.critical(
                'Exception raised handling inbound PDU [%s] hex[%s]: %s' %
                (reqPDU, _safelylogOutPdu(self.encoder.encode(reqPDU)), error))
            return_cmd_status = CommandStatus.ESME_RX_T_APPN
            shutdown = True

        if reqPDU.requireAck:
            self.sendResponse(reqPDU, return_cmd_status)

        if shutdown:
            self.shutdown()
Exemple #2
0
    def PDURequestFailed(self, error, reqPDU):
        if error.check(SMPPProtocolError):
            # Get the original error
            try:
                error.raiseException()
            except SMPPProtocolError as validation_error:
                self.log.info("Application raised error '%s', forwarding to client. Inbound PDU was [%s], hex[%s]" % (validation_error, reqPDU, _safelylogOutPdu(self.encoder.encode(reqPDU))))
                # Jasmin update: validation_error have attribute named commandStatusName
                #return_cmd_status = validation_error.commandStatusName
                return_cmd_status = validation_error.status
                shutdown = False
        else:
            self.log.critical('Exception raised handling inbound PDU [%s] hex[%s]: %s' % (reqPDU, _safelylogOutPdu(self.encoder.encode(reqPDU)), error))
            return_cmd_status = CommandStatus.ESME_RX_T_APPN
            shutdown = True

        if reqPDU.requireAck:
            self.sendResponse(reqPDU, return_cmd_status)

        if shutdown:
            self.shutdown()