Can You Access Your 3CX Database via MySql/Postgres (Sql Tools)?

Status
Not open for further replies.

paul_carass

Gold Partner
Advanced Certified
Joined
Apr 1, 2019
Messages
51
Reaction score
12
Hi,
I am wondering if it's possible to access your own instance of 3CX using tools like MySQL or Postgres?
The purpose would be to query call/agent statistics and use with other tools (Dashboard visualization tools like klipfolio).
Thanks
 
ssh to your 3CX server

Code:
root@3cx:~# su postgres -
postgres@3cx:/root$ psql -l

      Name       |    Owner    | Encoding |   Collate   |    Ctype    |      Access privileges      
-----------------+-------------+----------+-------------+-------------+-----------------------------
 database_single | phonesystem | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/phonesystem            +
                 |             |          |             |             | phonesystem=CTc/phonesystem+
                 |             |          |             |             | readonly=c/phonesystem
 masterprofiles  | phonesystem | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres        | postgres    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0       | postgres    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres                +
                 |             |          |             |             | postgres=CTc/postgres
 template1       | postgres    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres                +
                 |             |          |             |             | postgres=CTc/postgres
(5 rows)

postgres@3cx:/root$ psql database_single

database_single=# select * from cl_calls;

id   |          start_time          |        end_time        | is_answered |   ringing_dur   |   talking_dur    |   q_wait_dur    
-------+------------------------------+------------------------+-------------+-----------------+------------------+-----------------
     1 | 2018-10-16 09:11:59+02       | 2018-10-16 09:11:59+02 | f           | 00:00:00.040556 |                  | 
     2 | 2018-10-16 10:48:22+02       | 2018-10-16 10:48:41+02 | t           | 00:00:04.054384 | 00:00:14.957408  | 
...
 
Possible = yes
Supported = no
Difficulty to setup = Moderate to Expert level Postgre experience required.
Proceed at your own risk knowing 3CX does not condone this, as direct DB access and changes can yield highly undesired/unexpected results!
 
Thanks @BrenttG
I have one test environment. I may go break it there before I try it anywhere else! ;)
Just interested if I can dip into the db and pull info to visualise in Klipfolio
 
  • Like
Reactions: AGidi
Status
Not open for further replies.

Forum statistics

Threads
111,933
Messages
589,811
Members
164,808
Latest member
jsbjsb