def METHOD_NAME(self, msg_obj):
    config = self.config
    try:
        message = msg_obj.text
        message.encode('ascii')
        message_type = LONG_TEXT_MSG_TYPE
    except UnicodeEncodeError:
        message = codecs.encode(codecs.encode(msg_obj.text, 'utf_16_be'), 'hex').decode('utf-8').upper()
        message_type = LONG_UNICODE_MSG_TYPE
    return {
        'usr': config.username,
        'pass': config.password,
        'msisdn': strip_plus(msg_obj.phone_number),
        'sid': config.sender_id,
        'mt': message_type,
        'msg': message,
    }