Svetlana 3 سال پیش
والد
کامیت
293ba47b62
2فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 3 0
      app/app.py
  2. 3 1
      app/cel.py

+ 3 - 0
app/app.py

@@ -265,6 +265,7 @@ async def celCallback(mngr: Manager, msg: Message):
              'state': 'ringing',
              'callerId': cid,
              'did': did,
+             'queue': app.cache['cel_calls'][lid]['queueName'],  
              'callId': uid} 
            if ('WebCallId' in app.cache['cel_calls'][msg.linkedid]):
              _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
@@ -276,10 +277,12 @@ async def celCallback(mngr: Manager, msg: Message):
         (firstMessage.Context == 'from-internal') and 
         (cid is not None) and (len(cid) < 7)):
       app.cache['cel_calls'][lid]['groupCall'] = True
+      app.cache['cel_calls'][lid]['queueName'] = msg.Exten
     if ((msg.Application == 'Queue') and
         (msg.EventName == 'APP_END') and 
         (firstMessage.get('groupCall',False))):
       app.cache['cel_calls'][lid]['groupCall'] = False
+      app.cache['cel_calls'][lid]['queueName'] = False
     if (firstMessage.get('groupCall',False)):                         #for local calls only
       if msg.Channel.startswith('PJSIP/'):
         called = msg.CallerIDnum

+ 3 - 1
app/cel.py

@@ -47,7 +47,9 @@ class CdrEvents:
       event = CdrEvent(event)
     if not self.start:
         self.start = event.calldate
-    if (event.lastapp == 'Return' and event.billsec==0):
+    if (event.lastapp == 'ExecIf'):
+      return
+    if (event.lastapp == 'Return' and (event.billsec==0 or not event.dstchannel)):
       return
     if (event.lastapp == 'Return'):
       event.lastapp='Dial'