code: def process_frame(self, f, frame_str):
          
          frame_type = f.cmd.lower()
  
          if frame_type in ['disconnect']:
              return
  
          if frame_type == 'send':
              frame_type = 'message'
              f.cmd = 'MESSAGE'
  
          if frame_type in ['connected', 'message', 'receipt', 'error', 'heartbeat']:
              if frame_type == 'message':
                  if f.headers['destination'] not in self.subscriptions.values():
                      return
                  (f.headers, f.body) = self.notify('before_message', f.headers, f.body)
              self.notify(frame_type, f.headers, f.body)
          if 'receipt' in f.headers:
              receipt_frame = Frame('RECEIPT', {'receipt-id': f.headers['receipt']})
              lines = convert_frame(receipt_frame)
              self.send(encode(pack(lines)))
          log.debug("Received frame: %r, headers=%r, body=%r", f.cmd, f.headers, f.body)
docs: :param Frame f: Frame object
          :param bytes frame_str: Raw frame content