Skip to content

Instantly share code, notes, and snippets.

@lgaetz
Last active August 3, 2021 22:06
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/2f0a19e79f968f9aa832dd7ec74d57dd to your computer and use it in GitHub Desktop.
Save lgaetz/2f0a19e79f968f9aa832dd7ec74d57dd to your computer and use it in GitHub Desktop.
php script to use freepbx methods to get/set voicemail params
<?php
/***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *****
*
* Script: lgaetz-voicemial.php
*
* FreePBX script to work with device presence states
*
* Latest version: https://gist.github.com/lgaetz/2f0a19e79f968f9aa832dd7ec74d57dd
*
* Usage:
*
*
* License: GNU/GPL3+
*
* History:
* 2021-08-03 Bare minimum proof of concept
*
*
***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *****/
include '/etc/freepbx.conf';
$FreePBX = FreePBX::Create();
// get vm settings for all extensions
$allext_vm=$FreePBX->Voicemail->getVoicemail();
//print_r($allext_vm);
// get vm settings for single extension_loaded
$ext_vm=$FreePBX->Voicemail->getMailbox("6008");
print_r($ext_vm);
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment