3CX v11 database connection

Discussion in '3CX Phone System - General' started by centrocom, Dec 2, 2012.

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

    Joined:
    Nov 28, 2012
    Messages:
    2
    Likes Received:
    0
    Hello,

    using 3CX v11, i need to connect to DB PostgreSql with 3rd party app.
    3CX server: WIn7 64bit, firewall down, uac disabled, no antivirus

    I red several posts about this topic and i applied the following changes to C:\Program Files\3CX PhoneSystem\Data\DB

    FILE pg_hba.conf

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # IPv4 local connections:
    host all all 127.0.0.1/32 password
    host all logsreader 0.0.0.0/32 password

    # IPv6 local connections:
    host all all ::1/128 password

    FILE posgresql.conf

    listen_addresses = '*'

    At this point, PostgreSql DB should listen on 5480, on the whole lan.

    THE PROBLEM:
    Anyway, connecting with pgAdmin from a lan client (no localhost) i get:

    "Access to Database Denied"


    indicating that there is no valid entry in pg_ba.conf .

    If i use pgAdmin from localhost (3CX server) i get an athentication error.

    I took a look at file pg_auth :
    "logsreader" "md5xxx" ""
    "phoneadmin" "" ""
    "phonesystem" "md5xxx" ""

    3 users, among them "logsreader", indicated as the user to employ, to connect from the lan.
    I see that passwords are md5 coded, but in pg_hba.conf i specified a "password" encoding. I did follow this article

    http://apetec.com/voip/3CX-RemoteDB.htm

    I try to connect on port 5480 (cheked in postgresql.conf) with ssl Disable .

    Can anyone help?

    Thanks a lot.
     
  2. darthzejdr

    Joined:
    Feb 20, 2012
    Messages:
    17
    Likes Received:
    0
    user(logsreader and phonesystem) passwords are in C:/Program Files/3CX PhoneSystem/Bin/3CXPhoneSystem.ini

    From that setup you posted, logsreader should be able to access the database from anywhere, while phonesystem is still set only for local access.

    Have you tried telneting to port to see if it's listening?

    I'm attaching screenshot of my config that works. Maybe you forgot to set something? like database?
     

    Attached Files:

    • 3cx.jpg
      3cx.jpg
      File size:
      49.9 KB
      Views:
      1,663
  3. centrocom

    Joined:
    Nov 28, 2012
    Messages:
    2
    Likes Received:
    0
    SOLVED:

    authentication informations are in C:/Program Files/3CX PhoneSystem/Bin/3CXPhoneSystem.ini (as darthzejdr indicated) so i can connect with pgAdmin or a generic 3rd party application installed on 3cx server.

    i found that the file pg_Hba.conf must contain the exact client' s ip address.

    FILE pg_hba.conf

    # TYPE DATABASE USER CIDR-ADDRESS METHOD

    # IPv4 local connections:
    host all all 127.0.0.1/32 password
    host all logsreader 10.0.0.22/24 password

    # IPv6 local connections: host all all ::1/128 password

    in my case the server hosting my crm webapp is on 10.0.0.22 ip address.
    Indicating a more relaxed range of ip addresses doesn't work, like 10.0.0.0/24 . This is strange because working with other pgSql db instances i use that notation . Anyway for security sake it is better to focus db access toward the effective clients.

    Thank You.
     
Thread Status:
Not open for further replies.