Programación de horarios

This commit is contained in:
Juan Ferrer Toribio 2016-12-12 10:21:44 +01:00
parent 8a85fef499
commit 7456bda3ff
2 changed files with 16 additions and 1 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
vn-asterisk (1.008-deb7) stable; urgency=low
vn-asterisk (1.009-deb7) stable; urgency=low
* Initial Release.

View File

@ -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]);