|
|
@@ -417,10 +417,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:
|
|
|
@@ -441,7 +441,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'],
|
|
|
@@ -1321,7 +1321,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,
|