Searching for table with option "Do not show extension in 3CX company phonebook"

Status
Not open for further replies.

Tm99

Free User
Basic Certified
Joined
Aug 29, 2017
Messages
28
Reaction score
4
Hi all,

we are running own bash scripts for creating all our phonebooks for different models and ran into a small problem. Our scripts do not check for the option “Do not show extension in 3CX company phonebook” and so all numbers are in the phonebooks, no matter if this option is activated.

I just need to know in which table I can find this option. Thought about the table “extension” but there is only the option “enabled” which is not what I want/need to use.

I hope someone can help me here.

Cheers, Timo
 
It's in the dnprop table, iddnprop = 84.

The problem is that with a new extension, there is no property created. If you tick the option the property is created and is value set to 1. If you untick the option then the property value is changed to 0. This means that a simple multi-table query won't work.

The best I came up with is:

SQL:
SELECT firstname, lastname, value
FROM dn, users
WHERE dn.iddn = users.fkidextension
    and not exists (
            SELECT iddnprop
            FROM dnprop p1
            WHERE p1.iddnprop = '84' and p1.fkiddn = dn.iddn and not p1.value='0'
    )

(but, I'm no SQL expert, so please don't mock the ignorant!)
 
Last edited:
Are you aware that accessing the PostgreSQL database directly (rather than using the 3CX Call Control API) is not supported and can get your PBX flagged as unsupported?

You should NOT be doing this.
 
  • Like
Reactions: YiannisH_3CX
Are you aware that accessing the PostgreSQL database directly (rather than using the 3CX Call Control API) is not supported and can get your PBX flagged as unsupported?

You should NOT be doing this.

Are you aware that the API is only intended for 3CX and is not documented?

You should NOT be doing this.

For reference see this this forum (https://www.3cx.com/community/threads/3cx-call-control-api.64664/#post-275206):

edossantos, Staff member 3CX Support: "No, the API is still fully functional, and it's used internally by 3CX. But the management decided that the API should only be used by 3CX, so the documentation has been removed."
 
I have been given multiple reasons by 3CX regarding why the documentation is not currently available. Ernesto is certainly more connected within 3CX than I am. However, what I know for sure is that using the Call Control API will NOT get your PBX flagged as unsupported and interacting with the PostgreSQL database certainly can.
 
I have been given multiple reasons by 3CX regarding why the documentation is not currently available. Ernesto is certainly more connected within 3CX than I am. However, what I know for sure is that using the Call Control API will NOT get your PBX flagged as unsupported and interacting with the PostgreSQL database certainly can.

The company phone books in the provisioning folder are all but unusable, they are incomplete and some cases the entries completely empty. This is true for both Yealink models and Gigaset models which are on the supported list. There are a number of posts on the forum regarding this issue, so it appears that 3CX have no interest in addressing this issue.

I do not believe that paying for a support case would actually resolve this issue, but I would however, be happy to receive some help and examples from yourself on how I could achieve the same via the Call Control API. What I would need to be able to do is:
  • Iterate all extensions
    • Determine if the extensions should be in the company phone book
  • Iterate all ring groups
  • Iterate all contacts
 
I would google something like "3CX Call Control API documentation" and see if there is still someone (other than 3CX) that has a link to the documentation in an old historical post. 3CX staff apparently have instructions not to share the documentation. If you can get your hands on the documentation, that will give you some guidance on how to query and make changes to objects in 3CX.

Making an initial connection to the 3CX Call Control API is not at all straightforward, so without the documentation you probably won't get very far. Also, keep in mind that the Call Control API only responds to requests from localhost, so if your 3CX is running on Linux, your application will need to be compatible with Linux. The Call Control API is a .Net Core application, so your application will also need to be written in .Net Core. If you can get your hands on the documentation, I can offer some guidance privately.

Now, I freely acknowledge that this whole conversation could be interpreted as an effort on my part to sell our tools and services. That is not the case. I used to work for 3CX Support and I can assure you that they do not support people accessing the database directly. Although the forums are full of discussions about 3CX's policy, it seems many people are unaware. That was my intent, to make sure you and others are aware of the policy.

Having said that, I always try to offer suggestions on how you can accomplish a task yourself, in a supported way, without using our tools (in this cause using the Call Control API). However, you may also want to consider looking at our VoIPTools REST API. Our API includes documentation and developer support. And if we don't currently have the exact method you need, we can build it for you.
 
  • Like
Reactions: Mark Kingston
Thanks for the hint, I found the old documentation and now have Debian 9 VM with:
  • Manually installed 3CX Test instance
  • dotnet-sdk-3.1
  • aspnetcore-runtime-3.1
  • Visual Studio Code setup for C# Dev
  • C# Framework that can:
    • Connect to the server
    • Retrieve DN list, Extension List & Phonebook Entry List
For the sake of the original post, the Extension objects in the extension list include a properties list with access to relevant property:

{Wdnprop.84: DONT_SHOW_EXT_IN_PHBK - Do not show extension in 3CX company phonebook}
 
Wow, this thread got more attention than I thought.

Thank you very Much Mark!

I found the table and will check if I can integrate it in my script, should not be a big problem. You are correct, the 3CX pbooks in the provisioning folder are just crap since years. And I can just agree that 3CX seems to have no intention to make them better but this is okay for me. I like this product so much, because I can change so much to me needs, templates and also create own phonebooks. I know it is not supported but I just read from the tables so this shouldn’t lead to any problems.
 
Status
Not open for further replies.

Forum statistics

Threads
111,955
Messages
589,926
Members
164,855
Latest member
parik24pro