Change Extension Status in database

Status
Not open for further replies.

Togadude

Joined
Jun 5, 2018
Messages
11
Reaction score
4
Hi all,

We are setting up a new installation of 3CX.
One of the requirements is being able to set the extension status (e.g. 'Available' , 'Away') from an external attendance application.
So far we managed to change the value of the 'currentprofile' and/or 'overrideprofile' of the 'extension' table in the 3CX database, according to the correct values in the 'fwdprofile' table.
We can see the values being change with pgadmin or just a query.
However, these value changes are not reflected in the 3CX application.
Restarting the database does somehow 'apply' or 'commit' the changes so they show up in the webclient.
So it looks like we're missing something to trigger the application to update the values in the webclient.

Any help would be greatly appreciated.

Thanks!
T.
 
Additional info: the is the spell I use to update the 'extension' table...

Code:
Set Conn3CX = CreateObject("ADODB.Connection")
Conn3CX.Open "Driver={PostgreSQL Unicode}; Database=database_single; Server=<3CXserverName>; Port=5480; Uid=<SomeUsername>; Pwd=<SomePassword>"
Conn3CX.Execute "UPDATE public.extension SET currentprofile=18065 WHERE authid='1234'"

This does work correctly, as far as the database transaction is considered.
 
Hello @Togadude

Please note that any intervention to the 3CX database renders the installation as not supported so i would strongly recommend not making any changes to the database as 3CX support will not be able to assist you if you face any future issues.
 
@YiannisH_3CX

I am fully aware of this. We are trying a POC with external attendance sources.
My question remains the same though :-)

Thanks!
T.
 
Togadude, the ONLY acceptable approach to making changes to 3CX is using the Call Control API. Directly manipulating the data in the PostgreSQL database is a HUGE no-no. You should never, ever, do this. We have always been able to do everything we need using the API.
 
Hmmmm came here for some ‘community’ help, all I got this far is slapped around with Terms and Conditions and warnings from someone who has a potential commercial interest in me not succeeding hehehehe :)

With all due respect ofcourse.....

Still open for suggestions tho....
 
Last edited:
Togadude,

I am trying to help by offering the only acceptable way to accomplish what you are trying to do that will (1) have the desired affect and (2) keep your PBX supported. Keep in mind that part of the purpose of the forums is to assist you with your current request for help, but also to offer guidance to others who may be considering the same course of action. I can't understate just how seriously 3CX frowns on directly manipulating the data in PostgreSQL. So to dispel any suggestion that my advice is somehow self-serving, let me offer a more precise explanation of how this should be done.

1. Because the Call Control API only supports connections from localhost, you will need to either create some type of relay that accepts remote connections and passes the requests on to the 3CX call control API, or you will need to create a HTTP/REST API that you can call. This will need to be installed directly on the 3CX server.

2. You can get documentation and examples of how to use the call control API to update properties here: https://www.3cx.com/docs/call-control-api/

3. There are two API examples that you may find instructive: DNPropertySaveDelete.cs and UpdateExtensions.cs
 
No worries Matthew, I was just kidding.

So, basically one would have to become a C# programmer to accomplish something simple and minor like changing an extensions status (or anything else, for that matter).
That's really disappointing and could even be a red flag for the project.
I expected the platform to be much more 'open', and at least having a webservice/rest api or some other connection point to do stuff like this.
I have sysadmins that are really good at vb(script), powershell, json, java etc., but apparently none of these skills will help me getting anywhere with 3CX, now or in the future...

You and I are already in contact outside this forum. I will follow up on that to see what you can do for us.

Thanks!
 
Allright...

Trying to go the more accepted way... Powershell :-)
However, no matter what I try, I cannot get this to work...

Probably unsupported, too?

upload_2018-6-7_15-13-14.png
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,885
Messages
589,547
Members
164,745
Latest member
Herm77