feat: department queues refs #6387
gitea/vn-asterisk/pipeline/head There was a failure building this commit
Details
gitea/vn-asterisk/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
aa96214cf3
commit
2bbfed2d0c
20
incoming.php
20
incoming.php
|
@ -45,7 +45,7 @@ if (date('N') == 7 && $sundayFestive) {
|
||||||
$scheduledQueue = $db->getValue(
|
$scheduledQueue = $db->getValue(
|
||||||
'SELECT `queue` FROM pbx.schedule
|
'SELECT `queue` FROM pbx.schedule
|
||||||
WHERE `weekDay` = WEEKDAY(CURDATE())
|
WHERE `weekDay` = WEEKDAY(CURDATE())
|
||||||
AND CURTIME() BETWEEN timeStart AND timeEnd
|
AND util.VN_CURTIME() BETWEEN timeStart AND timeEnd
|
||||||
LIMIT 1'
|
LIMIT 1'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -55,19 +55,19 @@ if ($scheduledQueue) {
|
||||||
exit;
|
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) {
|
if ($client) {
|
||||||
// Gets the customer salesperson extension
|
// Gets the client salesperson extension
|
||||||
|
|
||||||
$extension = $db->getValue(
|
$extension = $db->getValue(
|
||||||
'SELECT s.extension
|
'SELECT d.pbxQueue
|
||||||
FROM sip s
|
FROM vn.worker w
|
||||||
JOIN vn2008.Trabajadores t ON t.user_id = s.user_id
|
JOIN vn.business b ON b.id = w.businessFk
|
||||||
WHERE t.id_trabajador = vn2008.Averiguar_ComercialCliente_Id(#, CURDATE())'
|
JOIN vn.department d ON d.id = b.departmentFk
|
||||||
,[$customer]
|
WHERE w.id = #',[$client]
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($extension) {
|
if ($extension) {
|
||||||
|
|
Loading…
Reference in New Issue