From 2e92a91c8f8d77eb9763bb471a41b72de9635002 Mon Sep 17 00:00:00 2001 From: Sabron Date: Thu, 15 May 2025 16:30:35 +0700 Subject: [PATCH] update : 15.05.2025 16:30:35,51 --- apps/pla/views/views_asterisk.py | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/apps/pla/views/views_asterisk.py b/apps/pla/views/views_asterisk.py index 75c4fe2..9338d2c 100644 --- a/apps/pla/views/views_asterisk.py +++ b/apps/pla/views/views_asterisk.py @@ -484,24 +484,20 @@ def alarm_play(request): os.makedirs(path_alarm.value, exist_ok=True) shutil.copy(file_src, path_alarm.value + "/1.mp3") - notifier_list = Notifier.objects.order_by("pla_groups", "name").all() os.makedirs(path_outgoing.value, exist_ok=True) - for notifier in notifier_list: - file = open(path_outgoing.value + "/" + notifier.sip_number, "a") - my_file = File(file) - my_file.write( - "Channel: Local/%s@alarm-dialer\n" % (str(notifier.sip_number)) - ) - my_file.write("MaxRetries: 0\n") - my_file.write("RetryTime: 5\n") - my_file.write("WaitTime: 30\n") - my_file.write("Context: alarm-informer\n") - my_file.write("Extension: 222\n") - my_file.write("Callerid: 222\n") - my_file.write("Account: autodialer\n") - my_file.write("Priority: 1\n") - my_file.close() - file.close() + file = open(path_outgoing.value + "/pla_alarm", "a") + my_file = File(file) + my_file.write("Channel: Local/555@internal\n") + my_file.write("MaxRetries: 0\n") + my_file.write("RetryTime: 5\n") + my_file.write("WaitTime: 30\n") + my_file.write("Context: alarm-informer\n") + my_file.write("Extension: 222\n") + my_file.write("Callerid: 222\n") + my_file.write("Account: autodialer\n") + my_file.write("Priority: 1\n") + my_file.close() + file.close() data.update(status=0) return generalmodule.ReturnJson(200, data)