Unable To Connect PostgreSQL DB

Discussion in '3CX Phone System - General' started by TechJimF, May 31, 2017.

Thread Status:
Not open for further replies.
  1. TechJimF

    Joined:
    May 11, 2017
    Messages:
    22
    Likes Received:
    2
    I am unable to connect to the Postgre DB. I am using pgAdmin 4. I keep getting the error:

    "Unable to connect to server:

    could not connect to server: Connection timed out (0x0000274C/10060)
    Is the server running on host "my3cxserver" (x.x.x.x) and accepting
    TCP/IP connections on port 5432?"

    I have tried what I found in /usr/share/3cxpbx/skel/Bin/3CXPhoneSystem.ini (Using Debian version) under these headings:

    [CfgServerProfile]
    [QMDatabase]

    We are just in testing phase with an 4 SC enterprise license.

    Any guidance would be appreciated.

    Thanks,

    Jim
     
  2. supplenta

    Joined:
    Oct 3, 2012
    Messages:
    35
    Likes Received:
    2
    Jim,

    If you're getting connection errors, you need to do something with the 'listen_addresses' value in postgresql config file. I think it's the same kind of thing on Linux (not sure).

    It permits by default ONLY 'localhost'. The port on Windows is 5480, again the postgresql config file will tell you what port to use.

    Might also be worth checking any firewalls on the machine to see if it is a restricted port. I had to open it on Windows.

    Simon
     
  3. TechJimF

    Joined:
    May 11, 2017
    Messages:
    22
    Likes Received:
    2
    Was able to get access.

    Had to change 3 files.

    pg_hba.conf - added IPv4 connection, entire subnet
    postgresql.conf - listening addresses, removed comment and allowed all
    rules.v4 - firewall settings to allow port 5432

    Thanks for your guidance.

    Jim
     
  4. agp

    agp 3CX Team

    Joined:
    Aug 19, 2015
    Messages:
    135
    Likes Received:
    21
    Please keep in mind that exposing a database server may lead to unwanted situations.

    You should do that only if its absolutely necessary.
     
  5. TechJimF

    Joined:
    May 11, 2017
    Messages:
    22
    Likes Received:
    2
    We are in the evaluation process of 3CX and need to see what data points are available for historical and realtime reporting in regards to the call center compared to our current platform.

    What would be the supported method to replicate the databases to an MS SQL server?

    Also, is there any documentation on the databases, fields, etc?

    Thanks,

    Jim
     
  6. giwm

    giwm New Member

    Joined:
    Sep 27, 2016
    Messages:
    230
    Likes Received:
    39
    @TechJimF Did you just use the connection details from 3CXPhoneSystem.ini to connect? I could connect to the database "postgres" but not to "phonesystem" (does not exist). What DB are you connecting to? The documentation is obviously near non-existent and though I've very familiar with SQL Server, I've never touched PostgreSQL.
     
  7. giwm

    giwm New Member

    Joined:
    Sep 27, 2016
    Messages:
    230
    Likes Received:
    39
    nvm, I got in.
     
  8. Timo

    Joined:
    Jun 8, 2017
    Messages:
    2
    Likes Received:
    0
    giwm how did you get in? I am trying to get access to postgres using pgAdmin 4 without luck. Getting fatal errors, my postgresql.conf says port 5480 not the typical postgres 5432, and change in my pg_hba.conf from password to trust on IPv4 local connections.
    Is there any documentation on what tables I going to find in there and any schema description? I thought that during 3CX installation I could get asked if there is any MS SQL server instance running to install there...
     
Thread Status:
Not open for further replies.