bhavank, This won't work unless you configure postgres to allow for remote connections. I've been doing this a long time now because I've integrated external programs to interface with the data stored in the DB. But everytime I upgrade 3CX, postgres settings get overwritten and I lose remote access to the DB. I hope 3CX fixes this in future updates.
Anyway, to configure postgres to allow for remote connections:
1) Open the \3CX PhoneSystem\Data\DB\postgresql.conf in your favorite text editor (Notepad) It would be wise to make a backup of this file prior to opening and editing it.
2) Locate the line that reads listen_addresses = 'local' and change it to listen_addresses = '*'
Please be aware that by doing this you are telling postgres to listen on all available IP addresses. If you have a publicly accessible address on your 3CX server be forewarned that postgres is listening on that address as well however as you will see below it's really not all that big of a deal becuase you must still tell postgres which addresses are allowed to authenticate against the user DB.
3) Save your changes to this file
4) Locate and open the \3CX PhoneSystem\Data\DB\pg_hba.conf file in your favorite text editor. This file controls which hosts have access to the postgres database. Make a backup of this file too
5) Locate the line just below # IPv4 local connections:. It should look like this:
host all all 127.0.0.1/32 password
6) Simply add a line directly after the one above defining your local CIDR network address. Mine looks like:
host all all 192.168.180.0/23 password
If the computers on your LAN are issued IP addresses dynamically, you should enter the network address to ensure that your computer will always have access to the database. If you want to limit it just to a specific IP address use /32 as the CIDR mask along with the IP address.
7) Once completed that section looks like:
# IPv4 local connections:
host all all 127.0.0.1/32 password
host all all 192.168.180.0/23 password
8) Save you changes
9) Stop the 3CX PhoneSystem service (Windows Control Panel-->Administrative Tools-->Computer Management-->Services)
10) Stop the 3CX PhoneSystem Database Server service (same location as above)
11) Start the 3CX PhoneSystem Database Server service
12) Start the 3CX PhoneSystem service