From 7456bda3ffc1ae89fde40e3ea19a1dfeca865cfa Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 12 Dec 2016 10:21:44 +0100 Subject: [PATCH] =?UTF-8?q?Programaci=C3=B3n=20de=20horarios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 2 +- incoming.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a50c277..83d277f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -vn-asterisk (1.008-deb7) stable; urgency=low +vn-asterisk (1.009-deb7) stable; urgency=low * Initial Release. diff --git a/incoming.php b/incoming.php index 713f098..9bcf872 100755 --- a/incoming.php +++ b/incoming.php @@ -40,6 +40,21 @@ if (date ('N') == 7 && $sundayFestive) exit (); } +// Checks schedules + +$hasSchedule = $db->getValue ( + 'SELECT COUNT(*) > 0 FROM pbx.schedule + WHERE weekDay = WEEKDAY(CURDATE()) + AND CURTIME() BETWEEN timeStart AND timeEnd' +); + +if ($hasSchedule) +{ + Agi::exec ('SET VARIABLE MACRO queue'); + Agi::exec ('SET VARIABLE ARG1 1200'); + exit (); +} + // Gets the customer from the phone number $customer = $db->getValue ('SELECT clientFromPhone(#)', [$callerId]);