diff --git a/incoming.php b/incoming.php index 5bd4d54..44e88dd 100755 --- a/incoming.php +++ b/incoming.php @@ -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; -}