Compare commits

...

1 Commits

Author SHA1 Message Date
David Domenech 96059705d1 update-incoming 2025-03-25 08:35:43 +00:00
1 changed files with 48 additions and 50 deletions

View File

@ -36,13 +36,6 @@ $prefixLen = strlen($countryPrefix);
if (substr($callerId, 0, $prefixLen) === $countryPrefix)
$callerId = substr($callerId, $prefixLen);
// Checks if phone number is on the blacklist
if ($db->getValue('SELECT COUNT(*) > 0 FROM blacklist WHERE phone = #', [$callerId])) {
Agi::exec('HANGUP');
exit;
}
// Checks schedules
if ($countryCode) {
@ -78,10 +71,8 @@ if ($clientId) {
$client = $db->getObject(
'SELECT d.pbxQueue, c.id, d.notificationEmail
FROM vn.client c
JOIN vn.worker w ON w.id = c.salesPersonFk
JOIN vn.business b ON b.id = w.businessFk
JOIN vn.department d ON d.id = b.departmentFk
WHERE c.id= #',[$clientId]
JOIN vn.department d ON d.id = c.departmentFk
WHERE c.id= 22178',[$clientId]
);
if ($client) {
@ -92,3 +83,10 @@ if ($clientId) {
Agi::exec("SET VARIABLE ARG4 \"{$client->notificationEmail}\"");
}
}
// Checks if phone number is on the blacklist
if ($db->getValue('SELECT COUNT(*) > 0 FROM blacklist WHERE phone = #', [$callerId])) {
Agi::exec('HANGUP');
exit;
}