feat: department queues refs #6387
gitea/vn-asterisk/pipeline/head There was a failure building this commit Details

This commit is contained in:
Carlos Andrés 2024-03-06 17:50:38 +01:00
parent aa96214cf3
commit 2bbfed2d0c
1 changed files with 10 additions and 10 deletions

View File

@ -45,7 +45,7 @@ if (date('N') == 7 && $sundayFestive) {
$scheduledQueue = $db->getValue(
'SELECT `queue` FROM pbx.schedule
WHERE `weekDay` = WEEKDAY(CURDATE())
AND CURTIME() BETWEEN timeStart AND timeEnd
AND util.VN_CURTIME() BETWEEN timeStart AND timeEnd
LIMIT 1'
);
@ -55,19 +55,19 @@ if ($scheduledQueue) {
exit;
}
// Gets the customer from the phone number
// Gets the client from the phone number
$customer = $db->getValue('SELECT clientFromPhone(#)', [$callerId]);
$client = $db->getValue('SELECT clientFromPhone(#)', [$callerId]);
if ($customer) {
// Gets the customer salesperson extension
if ($client) {
// Gets the client salesperson extension
$extension = $db->getValue(
'SELECT s.extension
FROM sip s
JOIN vn2008.Trabajadores t ON t.user_id = s.user_id
WHERE t.id_trabajador = vn2008.Averiguar_ComercialCliente_Id(#, CURDATE())'
,[$customer]
'SELECT d.pbxQueue
FROM vn.worker w
JOIN vn.business b ON b.id = w.businessFk
JOIN vn.department d ON d.id = b.departmentFk
WHERE w.id = #',[$client]
);
if ($extension) {