Svetlana hace 3 años
padre
commit
67104cff24
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      app/cel.py

+ 3 - 3
app/cel.py

@@ -53,7 +53,7 @@ class CdrEvents:
       event.lastapp='Dial'
       event.duration=event.billsec
       event.cnum = event.src
-    if (event.channel.id not in self._channels):
+    if (event.channel and event.channel.id not in self._channels):
         self._channels[event.channel.id] = event
     if (event.dstchannel and event.dstchannel.id not in self._dstchannels):
         self._dstchannels[event.dstchannel.id] = event.dst
@@ -83,9 +83,9 @@ class CdrEvents:
           queueevent.duration = (event.calldate-queueevent.calldate).total_seconds() +  event.duration
       if (event != queueevent):
         return; # add only forst queue event
-    if (event.lastapp == 'Dial' and event.dstchannel.id in self._dstchannels):
+    if (event.lastapp == 'Dial' and event.dstchannel and event.dstchannel.id in self._dstchannels):
         event.dst = self._dstchannels[event.dstchannel.id] #get dst from fisrt event with rthis channel. for transfer
-    if (event.lastapp == 'Dial' and event.dstchannel.id in self._channels):
+    if (event.lastapp == 'Dial' and event.dstchannel and event.dstchannel.id in self._channels):
         event.dst = self._channels[event.dstchannel.id].dst #for transfer to queue
     self.end = event.calldate + td(seconds=event.duration)
     self._events.append(event)