Merge pull request 'davidl-asterisk2' (!5) from davidl-asterisk2 into master
gitea/vn-asterisk/pipeline/head There was a failure building this commit Details

Reviewed-on: #5
This commit is contained in:
Juan Ferrer 2025-03-07 13:02:06 +00:00
commit 3207ec1ea7
1 changed files with 7 additions and 7 deletions

View File

@ -36,6 +36,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
if ($countryCode) {
@ -85,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;
}