def handle_event(event, manager, call):
   if event.name == 'Hangup':
      call.disposition = event.get_header('Cause-txt')
      call.cause = event.get_header('Cause')
      call.duration = (datetime.datetime.now() - call.start).seconds
      call.save()
      with manager.lock:
          manager.lock.notifyAll()
dataset/ETHPy150Open maxiberta/django-asterisk/django_asterisk/engine.py/handle_event/original