Update incoming.php
gitea/vn-asterisk/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Juan Ferrer 2025-03-07 13:01:39 +00:00
parent bce6df9e0e
commit 9e09ce6afc
1 changed files with 48 additions and 53 deletions

View File

@ -35,11 +35,13 @@ $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
@ -90,10 +92,3 @@ 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;
}