def on_message(self, client, userdata, msg):
    info('mqtt', ((('on_message:' + msg.topic) + ': ') + str(msg.payload)))
    try:
        if self.queue:
            m = Message(msg.topic, msg.payload)
            if m.is_valid():
                if (m.for_device() and (not (m.get_name() in ['CONNECTED', 'REGISTERED', 'TX']))):
                    self.queue.put(m)
                    publish(m, channel='inbound')
                else:
                    publish(m, channel='inbound')
    except Exception as ex:
        error('mqtt', ('on_message: ' + str(ex)))
def on_message(self, client, userdata, msg):
    info('mqtt', ((('on_message:' + msg.topic) + ': ') + str(msg.payload)))
    try:
        if self.queue:
            m = Message(msg.topic, msg.payload)
            if m.is_valid():
                if (m.for_device() and (not (m.get_name() in ['CONNECTED', 'REGISTERED', 'TX']))):
                    self.queue.put(m)
                    publish(m, channel='inbound')
                else:
                    publish(m, channel='inbound')
    except Exception as ex:
        error('mqtt', ('on_message: ' + str(ex)))