diff --git a/call_handler.py b/call_handler.py index 893e7f0..945cc77 100644 --- a/call_handler.py +++ b/call_handler.py @@ -42,7 +42,6 @@ class CallHandler: self.calls = {} try: - logging.info(event.get("Linkedid", "Not Linkedid")) if check_linkedid(event): linkedid = event.get("Linkedid") @@ -51,11 +50,15 @@ class CallHandler: return if linkedid not in self.calls.keys(): + if config.DEBUG: + logging.info(f"New call: ID={linkedid}") check_date() context = event.get("Context") if context != "from-trunk": if context == "from-internal": + if config.DEBUG: + logging.info(f"Internal call: ID={linkedid}") self.finished.append(linkedid) return event_channel = event.get("Channel") @@ -64,6 +67,8 @@ class CallHandler: and "LocalAddress" not in event.keys() and "CID-CallingPres" not in event.keys() ): + if config.DEBUG: + logging.info(f"Skipped event: ID={linkedid}") return for filter in config.AMI_CHANNEL_FILTER: if event_channel.startswith(filter) or ( @@ -71,6 +76,8 @@ class CallHandler: or event.get("Extension") == filter.split("/")[1] or event.get("Exten") == filter.split("/")[1] ): + if config.DEBUG: + logging.info(f"Incoming NEW call: ID={linkedid}") await self.incoming_call(event, linkedid) return self.finished.append(linkedid)