Skip to content

Instantly share code, notes, and snippets.

@lgaetz
Forked from jfinstrom/ariendpoints.php
Created October 8, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgaetz/07de9ced3d02beeaed37a519f4ce1752 to your computer and use it in GitHub Desktop.
Save lgaetz/07de9ced3d02beeaed37a519f4ce1752 to your computer and use it in GitHub Desktop.
Dump endpoints with ARI and FreePBX
#!/usr/bin/env php
<?php
if((@include '/etc/freepbx.conf') === false){
echo "Failed to include configuration\r\n";
return;
}
$ariuser = \FreePBX::Config()->get('FPBX_ARI_USER');
$aripass = \FreePBX::Config()->get('FPBX_ARI_PASSWORD');
$ari = new Pest('http://localhost:8088/ari');
$ari->setupAuth($ariuser,$aripass);
$return = json_decode($ari->get('/endpoints'),true);
print_r($return);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment