Manual mergre from local code

This commit is contained in:
2024-01-19 15:51:06 +07:00
parent ccd5d6874d
commit c103fd34a3
4 changed files with 15 additions and 4 deletions

View File

@@ -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)