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(
|
||||
'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) {
|
||||
|
|
Loading…
Reference in New Issue