'Send a URL request to Tropo to pick a message up'

def send_sms_via_tropo(self, row_id, message_id, recipient, message, network='SMS', channel_id=None):

    db = current.db
    s3db = current.s3db
    table = s3db.msg_tropo_channel
    base_url = 'http://api.tropo.com/1.0/sessions'
    action = 'create'
    if channel_id:
        query = (table.channel_id == channel_id)
    else:
        query = (table.enabled == True)
    tropo_settings = db(query).select(table.token_messaging, limitby=(0, 1)).first()
    if tropo_settings:
        tropo_token_messaging = tropo_settings.token_messaging
    else:
        return
    if (network == 'SMS'):
        recipient = self.sanitise_phone(recipient, channel_id)
    try:
        s3db.msg_tropo_scratch.insert(row_id=row_id, message_id=message_id, recipient=recipient, message=message, network=network)
        params = urllib.urlencode([('action', action), ('token', tropo_token_messaging), ('outgoing', '1'), ('row_id', row_id)])
        xml = urllib2.urlopen(('%s?%s' % (base_url, params))).read()
    except:
        pass
    return False
