SHARE
TWEET

Untitled

a guest Apr 19th, 2019 123 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def insert_status(event, actionid):
  2.     print('im here!')
  3.     print('Ive got {} and actiond id {}'.format(event, actionid))
  4.  
  5.  
  6.     connection = pymysql.connect(host='localhost', user='root', password='MDhiNDJhZD', db='asteriskcdrdb', charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor)
  7.     try:
  8.  
  9.         with connection.cursor() as cursor:
  10.             print('inside connection cursos, what is my response? - it is {}'.fromat(event['Response']))
  11.  
  12.                 # SQL
  13.             if event['Response'] == 'Success':
  14.                 is_active == 0
  15.             else:
  16.                 is_active == 1
  17.             sql = "update autodial set is_active = {} where uniqueid = '{}'".format(is_active, actionid)
  18.                # logging.info("getting numbers for dial: {}".format(sql))
  19.                 # Выполнить команду запроса (Execute Query).
  20.             cursor.execute(sql)
  21.             print('sql is {}'.format(sql))
  22.  
  23.     finally:
  24.             # Закрыть соединение (Close connection).
  25.         connection.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top