Implement .env configuration

This commit is contained in:
Jason Thistlethwaite
2026-04-27 22:52:27 +00:00
parent 16feb51b12
commit 324084d419
8 changed files with 259 additions and 9 deletions
+5 -1
View File
@@ -3,10 +3,14 @@
declare(strict_types=1);
require_once __DIR__ . '/../src/VoipMsClient.php';
require_once __DIR__ . '/../src/EnvLoader.php';
use VoipMs\EnvLoader;
use VoipMs\VoipMsClient;
use VoipMs\VoipMsResponse;
EnvLoader::load(__DIR__ . '/../.env');
const MCP_PROTOCOL_VERSION = '2025-06-18';
const MCP_SESSION_ID = 'voipms-test-session';
@@ -229,7 +233,7 @@ function callTool(string $name, array $arguments): array
'voipms_get_recent_cdr' => responsePayload($client->getCdr(
requiredStringArg($arguments, 'date_from'),
requiredStringArg($arguments, 'date_to'),
stringArg($arguments, 'timezone', getenv('VOIPMS_TIMEZONE') ?: '-4'),
stringArg($arguments, 'timezone', getenv('VOIPMS_TIMEZONE') ?: getenv('DEFAULT_TIMEZONE') ?: '-4'),
cdrFilters($arguments),
)),
'voipms_add_number_to_phonebook_group' => addNumberToPhonebookGroupTool($client, $arguments),