def send(self, msg, *args, **kwargs):
        config = self.config
        params = {
            'id': config.account_id,
            'pw': config.password,
            'snr': config.sender_id,
            'dnr': msg.phone_number,
        }
        try:
            text = msg.text.encode('iso-8859-1')
            params['msg'] = text
        except UnicodeEncodeError:
            params['msg'] = msg.text.encode('utf-16-be').encode('hex')
            params['encoding'] = 'ucs'
        url = '%s?%s' % (MACH_URL, urllib.urlencode(params))
        resp = urllib2.urlopen(url, timeout=settings.SMS_GATEWAY_TIMEOUT).read()
        self.handle_response(msg, resp)
        return resp
dataset/ETHPy150Open dimagi/commcare-hq/corehq/messaging/smsbackends/mach/models.py/SQLMachBackend.send/original