浏览代码

Merge branch 'master' of https://gogs.halsbox.ru/RRT/pbx

Hal De 3 年之前
父节点
当前提交
9a083492c8
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      app/app.py

+ 4 - 4
app/app.py

@@ -427,10 +427,10 @@ async def getUserCDR(user,
     _q += f''' dst="{user}"'''
   elif direction in ('out', False, '0', 'outgoing', 'outbound'):
     direction = 'outbound'
-    _q += f''' src="{user}"'''
+    _q += f''' cnum="{user}"'''
   else:
     direction = None
-    _q += f''' (src="{user}" or dst="{user}")'''
+    _q += f''' (cnum="{user}" or dst="{user}")'''
   if end is None:
     end = dt.now()
   if start is None:
@@ -451,7 +451,7 @@ async def getUserCDR(user,
   cdr = []
   for _id in sorted(_cdr.keys(), reverse = True if (order.lower() == 'desc') else False):
     record = _cdr[_id].simple
-    if (direction is not None) and (record['src'] == record['dst']) and (record['direction'] != direction):
+    if (direction is not None) and (record['cnum'] == record['dst']) and (record['direction'] != direction):
       record['direction'] = direction
     if record['file'] is not None:
       record['file'] = '/static/records/{d.year}/{d.month:02}/{d.day:02}/{filename}'.format(d=record['start'],
@@ -1356,7 +1356,7 @@ class Calls(Resource):
       _call = {'id':c.linkedid,
                'start':c.start,
                'type': c.direction,
-               'numberA': c.src,
+               'numberA': c.cnum,
                'numberB': c.dst,
                'line': c.did,
                'duration': c.duration,