From 2eeeefb26f5bcd53d8dfd64c62f6443572b95048 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Mon, 21 Apr 2025 16:49:38 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=B2=D1=8F=D0=B7=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB=D0=BE=D0=B2=20=D0=BA=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/pla/models/model_voice_call.py | 2 ++ apps/pla/views/views_radiusip.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/pla/models/model_voice_call.py b/apps/pla/models/model_voice_call.py index 73c0564..2062f5d 100644 --- a/apps/pla/models/model_voice_call.py +++ b/apps/pla/models/model_voice_call.py @@ -1,6 +1,7 @@ from django.db import models from apps.pla.models.model_alarm import Alarm +from apps.pla.models.model_channel import PlaChannel class VoiceCall(models.Model): @@ -8,6 +9,7 @@ class VoiceCall(models.Model): created_at = models.DateTimeField(auto_now_add=True) sent = models.BooleanField(default=False) alarm_file = models.ForeignKey(Alarm, on_delete=models.CASCADE) + channels = models.ManyToManyField(PlaChannel) def __str__(self): return f"{self.created_at}" diff --git a/apps/pla/views/views_radiusip.py b/apps/pla/views/views_radiusip.py index a906f4e..4850b0f 100644 --- a/apps/pla/views/views_radiusip.py +++ b/apps/pla/views/views_radiusip.py @@ -21,6 +21,8 @@ from sabron.util import logging def start_call(request, alarm): call = VoiceCall.objects.create(alarm_file=alarm) + active_channels = PlaChannel.objects.filter(active=True) + call.channels.add(*active_channels) return redirect("/pla/")