I;m working on extending the graphql API, and I’m hitting a bit of a wall.
Background:
the ADDUSER function is missing three things I would want:
(pjsip only) max_contacts
(all). voicemail to email on/off
(all) voicemail to email: delete after sending (on/off)
I want to add these.
it looks like I can likely get max_contacts in there easily enough…
but I can not for the life of me find where Freepbx stores the status of “email attachment” or “Delete voicemail”.
if anyone can point me in that direction, it would be greatly appreciated.
if I can successfully automate those above 3 items, I can get our tier-1 staff completely hands-off for creating new extensions that meet our needs.
While the settings are stored in voicemail.conf, you don’t want to parse it, use the native methods
<?php
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
$ext_vm=$FreePBX->Voicemail->getMailbox("6008");
print_r($ext_vm);
exit;
script output:
[root@freepbx tmp]# php voicemail.php
Array
(
[vmcontext] => default
[pwd] => 1234
[name] => D80
[email] =>
[pager] =>
[options] => Array
(
[attach] => no
[saycid] => no
[envelope] => no
[delete] => no
)
)
and thats why you’re my favorite, thank you @lgaetz
i guess I should likely ask you -
do you see value in extending the AddUser and UpdateUser API calls to include max_contacts and the 4 voicemail settings?
I should be able to do the needful, you’ve just been involved far longer, so Id like to ask