diff --git a/incoming.php b/incoming.php index 12c36b1..5bd4d54 100755 --- a/incoming.php +++ b/incoming.php @@ -85,3 +85,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; +}