Skip to content

[bug]: API GQL/Core: All VM secret are not sync with the table "users" #7

Open
@danardf

Description

@danardf

FreePBX Version

FreePBX 16

Issue Description

When an extension is created the VM secret is set in the "users" table, but if you use fetchAllExtensions or fetchExtension, the password is empty for the others extensions and not for the new extensions created with API.

That means, you need to synchronize all VM secret to the "users" table. Otherwise, the admin could not know the VM Secret throught fetchAllExtensions or fetchExtension

However, fetchVoiceMail works fine. VM secret is present.

BTW, I wondered if password is a good name. Indeed, there is much name discribing passwords.
Password for extension
Password for User Manager.
Password for VM.

As the VM password is named : password, it will make sens to rename it as vm-password. just for avoid to get confuse.

The most important for now is, to sync the vm-password into the "users" table on the key password or getting data from voicemail.conf.
I know the fact to parse the file, voicemail.conf is not the best way and it's not faster. The idea will be to put voicemails data into a table looks good though.

Operating Environment

framework: 16.0.40.7
api: 16.0.13

Relevant log output

MariaDB [asterisk]> select extension, password from users;
+-----------+----------+
| extension | password |
+-----------+----------+
| 1000      |          |
| 1001      |          |
| 1002      |          |
| 1003      |          |
| 101       |          |
| 102       |          |
| 103       |          |
| 104       |          |
| 106       |          |
| 107       |          |
| 108       |          |
| 110       |          |
| 111       |          |
| 112       |          |
| 114       |          |
| 9919988   |          |
| 200       |          |
| 201       |          |
| 113       |          |
| 105       |          |
| 122       |          |
| 121       |          |
| 123       |          |
| 100       |          |
| 109       |          |
| 120       |          |
| 1020      | test     |
| 1021      |          |
+-----------+----------+
28 rows in set (0.00 sec)

[root@freepbx ~]# more /etc/asterisk/voicemail.conf | grep test
1020=test,Room 20,[email protected],,attach=no|saycid=no|envelope=no|delete=no

Here we can expect to see any vm-password in the password key. But a single password is recorded. The one created throught API.

Additionally, the field allows all alphabetic characters. Need to filter it with a regex accepting 0-9 and empty (no vm secret)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions