Manual mergre from local code
This commit is contained in:
@@ -63,7 +63,6 @@ def main():
|
||||
insDict = {"client": srcJson['from'], "time": srcJson['time'], "status": 0,
|
||||
"recordUrl": srcJson["recordUrl"], "duration": srcJson["duration"], "important": tmpIncoming[srcJson['uuid']][2]}
|
||||
except Exception as e:
|
||||
# print(srcJson)
|
||||
print(e)
|
||||
insDict = {
|
||||
"client": srcJson['from'], "time": srcJson['time'], "status": 1, "important": tmpIncoming[srcJson['uuid']][2]}
|
||||
@@ -94,11 +93,11 @@ def main():
|
||||
#r = coll_phone.update_one({'$and': [{'client': {'$regex': srcJson['to']}}, {'status': 1}]}, {'$set': {'status': 2, 'callid': srcJson['uuid']}})
|
||||
r = coll_phone.update_one({'$and': [{'client': {'$regex': srcJson['to']}}, {'status': {'$in': [1,4]}}]}, {'$set': {'status': 2, 'callid': srcJson['uuid']}})
|
||||
if srcJson['state'] == 'HANGUP':
|
||||
try:
|
||||
try:
|
||||
# Проверяем заполнено ли поле recordURL, если нет то меняем статус на 4
|
||||
if len(srcJson['recordUrl']) > 4:
|
||||
coll_phone.update_one({'callid':srcJson['uuid']}, {'$set': {'recordUrl': srcJson['recordUrl']}})
|
||||
else:
|
||||
else:
|
||||
coll_phone.update_one({'callid':srcJson['uuid']}, {'$set': {'status': 4}})
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
Reference in New Issue
Block a user