• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

3CX v11 database connection

Status
Not open for further replies.

centrocom

Joined
Nov 28, 2012
Messages
2
Reaction score
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.
 
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?
 

Attachments

  • 3cx.jpg
    3cx.jpg
    49.9 KB · Views: 1,685
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.
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Forum statistics

Threads
141,630
Messages
748,945
Members
144,742
Latest member
Steffen Ekerdt
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.