コード例 #1
0
ファイル: Bot_old.py プロジェクト: zhuzhuxia480/callcenter
 def record_chat_run(self, who, text, record_fpath, create_at, call_id,
                     jsonStr):
     record_fpath = conf.server_url + record_fpath
     logger.error('record_fpath:.....%s....' % record_fpath)
     # sql = 'INSERT INTO fs_call_replay(who, text, record_fpath, create_at, call_id,resp_param)VALUES (\'{0}\', \'{1}\', \'{2}\', \'{3}\', \'{4}\',\'{5}\')'.format(
     #     who, text, record_fpath, create_at, call_id, jsonStr)
     # try:
     #     conn = db_pool.getConn()
     #     cursor = conn.cursor()
     #     result = cursor.execute(sql)
     #     conn.commit()
     #     db_pool.close(cursor, conn)
     #     logger.info("record_chat_run  %s" % str(result))  # 最后插入行的主键ID
     # except Exception as e:
     #     logger.error('record_chat_run except error is %s'% e.message )
     objdata = {}
     objdata['mark'] = 'insert'
     objdata['who'] = who
     objdata['text'] = text
     objdata['record_fpath'] = record_fpath
     objdata['create_at'] = create_at
     objdata['call_id'] = call_id
     objdata['jsonStr'] = jsonStr
     jsonStr = json.dumps(objdata)
     logger.info('------jsonstr-----%s' % jsonStr)
     rabbitmq.rabbitmqClint(jsonStr)
コード例 #2
0
 def user_analysis(self, user_label):
     print '-----user_analysis -------user_label  %s' % user_label
     objdata = {}
     objdata['mark'] = 'user_label'
     objdata['user_label'] = user_label
     objdata['channal_uuid'] = self.channal_uuid
     jsonStr = json.dumps(objdata)
     # logger.info('------jsonstr-----%s'%jsonStr)
     rabbitmq.rabbitmqClint(jsonStr)
コード例 #3
0
 def update_full_path(self, record_fpath, channal_uuid):
     print 'record_fpath:(update).....%s....' % record_fpath
     objdata = {}
     objdata['mark'] = 'update'
     objdata['record_fpath'] = conf.server + record_fpath
     objdata['channal_uuid'] = channal_uuid
     jsonStr = json.dumps(objdata)
     # logger.info('------jsonstr-----%s'%jsonStr)
     rabbitmq.rabbitmqClint(jsonStr)
コード例 #4
0
def statistical(call_id, user_id, flow_id, number, task_id):
    print 'statistical:(func).....user_id: %s..flow_id: %s...number: %s..' % (
        user_id, flow_id, number)
    objdata = {}
    objdata['mark'] = 'statistical'
    objdata['call_id'] = call_id
    objdata['user_id'] = user_id
    objdata['flow_id'] = flow_id
    objdata['number'] = number
    objdata['task_id'] = task_id
    jsonStr = json.dumps(objdata)
    # logger.info('------jsonstr-----%s'%jsonStr)
    rabbitmq.rabbitmqClint(jsonStr)
コード例 #5
0
ファイル: Bot.py プロジェクト: zhuzhuxia480/callcenter
 def record_chat_run(self, who, text, record_fpath, create_at, call_id, jsonStr):
     record_fpath = record_fpath
     logger.error('record_fpath:.....%s....'%record_fpath)
     objdata = {}
     objdata['mark'] = 'insert'
     objdata['who'] =who
     objdata['text'] =text
     objdata['record_fpath'] =record_fpath
     objdata['create_at'] =create_at
     objdata['call_id'] =call_id
     objdata['jsonStr'] =jsonStr
     jsonStr = json.dumps(objdata)
     # logger.info('------jsonstr-----%s' % jsonStr)
     rabbitmq.rabbitmqClint(jsonStr)
コード例 #6
0
ファイル: Bot_old.py プロジェクト: zhuzhuxia480/callcenter
 def update_full_path(self, path, channal_uuid):
     record_fpath = conf.server_url + path
     print 'record_fpath:.....%s....' % record_fpath
     # sql = "update fs_call set full_record_fpath ='{0}' where channal_uuid ='{1}'".format(record_fpath, channal_uuid)
     # try:
     #     conn = db_pool.getConn()
     #     cursor = conn.cursor()
     #     result = cursor.execute(sql)
     #     conn.commit()
     #     db_pool.close(cursor, conn)
     #     logger.info("update full_path result  %s" % str(result))  # 最后插入行的主键ID
     # except Exception as e:
     #     logger.error('update_full_path except error is %s'% e.message )
     objdata = {}
     objdata['mark'] = 'update'
     objdata['record_fpath'] = record_fpath
     objdata['channal_uuid'] = channal_uuid
     jsonStr = json.dumps(objdata)
     logger.info('------jsonstr-----%s' % jsonStr)
     rabbitmq.rabbitmqClint(jsonStr)
コード例 #7
0
# -*- encoding: utf-8 -*-

import rabbitMQ_produce as rabbitmq
import json
sql = 'INSERT INTO fs_call_replay(who, text, record_fpath,  call_id,resp_param)VALUES (\'{0}\', \'{1}\', \'{2}\', \'{3}\', \'{4}\')'.format(
            45, 454, 454, 454, 4545, 4545)
print '.....0......%s'%sql

objdata = {}
objdata['mark'] = 'update'
objdata['record_fpath'] = '78978'
objdata['channal_uuid'] = 'a6d24d2d-cebe-4113-9f89-9ce80012d6fc'
jsonStr = json.dumps(objdata)
print '------jsonStr-uu-----', jsonStr
rabbitmq.rabbitmqClint(jsonStr)