This commit is contained in:
Dev PC
2025-08-05 10:12:20 +03:00
parent 74a2c850fb
commit 8867063c7b
+8 -1
View File
@@ -42,7 +42,6 @@ class CallHandler:
self.calls = {} self.calls = {}
try: try:
logging.info(event.get("Linkedid", "Not Linkedid"))
if check_linkedid(event): if check_linkedid(event):
linkedid = event.get("Linkedid") linkedid = event.get("Linkedid")
@@ -51,11 +50,15 @@ class CallHandler:
return return
if linkedid not in self.calls.keys(): if linkedid not in self.calls.keys():
if config.DEBUG:
logging.info(f"New call: ID={linkedid}")
check_date() check_date()
context = event.get("Context") context = event.get("Context")
if context != "from-trunk": if context != "from-trunk":
if context == "from-internal": if context == "from-internal":
if config.DEBUG:
logging.info(f"Internal call: ID={linkedid}")
self.finished.append(linkedid) self.finished.append(linkedid)
return return
event_channel = event.get("Channel") event_channel = event.get("Channel")
@@ -64,6 +67,8 @@ class CallHandler:
and "LocalAddress" not in event.keys() and "LocalAddress" not in event.keys()
and "CID-CallingPres" not in event.keys() and "CID-CallingPres" not in event.keys()
): ):
if config.DEBUG:
logging.info(f"Skipped event: ID={linkedid}")
return return
for filter in config.AMI_CHANNEL_FILTER: for filter in config.AMI_CHANNEL_FILTER:
if event_channel.startswith(filter) or ( if event_channel.startswith(filter) or (
@@ -71,6 +76,8 @@ class CallHandler:
or event.get("Extension") == filter.split("/")[1] or event.get("Extension") == filter.split("/")[1]
or event.get("Exten") == 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) await self.incoming_call(event, linkedid)
return return
self.finished.append(linkedid) self.finished.append(linkedid)