Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Apr 24, 2024 4:32 pm
Voice Broadcast System


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Connection failed
PostPosted: Thu Apr 05, 2012 8:29 am 
Offline

Joined: Thu Apr 05, 2012 8:12 am
Posts: 48
Hi,

I am getting "Connection failed" when trying to logon to a2billing as root with changepassword. I went through the forum and there are some people with the same issue but looks like that the root cause of mine is the fact that after hitting "LOGIN" php tries to connect to PostgreSQL instead to mysql:

/var/log/httpd/error_log

[Thu Apr 05 08:40:15 2012] [error] [client 95.215.xxx.xxx] PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused\n\tIs the server running on host "localhost" and accepting\n\tTCP/IP connections on port 5432?\ncould not connect to server: Connection refused\n\tIs the server running on host "localhost" and accepting\n\tTCP/IP connections on port 5432? in /usr/local/src/a2billing/common/lib/adodb/drivers/adodb-postgres64.inc.php on line 686, referer: http://wan1.xxx.com/a2billing/admin/Public/index.php


It can not connect because PostgreSQL does not exist - I have mysql instead.
I can connect to mysql with credentials from /etc/a2billing.conf (it is set to use mysql) , I can ping localhost and during the installation all tables have been created successfully.

Where in php or a2billing can I find the setting which defines which database to use?


Top
 Profile  
 
 Post subject: Re: Connection failed
PostPosted: Thu Apr 05, 2012 1:06 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

inspect /etc/a2billing.conf to ensure that the credentials match the your database settings.

Joe


Top
 Profile  
 
 Post subject: Re: Connection failed
PostPosted: Thu Apr 05, 2012 3:05 pm 
Offline

Joined: Thu Apr 05, 2012 8:12 am
Posts: 48
Thanks for suggestion.



/etc/a2billing.conf:

hostname = localhost
port = 3306
user = a2billinguser
password = xxxxxx
dbname = a2billing
dbtype = mysql



mysql -ua2billinguser -pxxxxxx

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| a2billing |
| asterisk |
| mysql |
| test |
+--------------------+
5 rows in set (0.33 sec)

mysql> use a2billing;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>
mysql> show tables;
+---------------------------+
| Tables_in_a2billing |
+---------------------------+
| cc_agent |
| cc_agent_commission |
| cc_agent_signup |
| cc_agent_tariffgroup |
| cc_alarm |
| cc_alarm_report |
| cc_autorefill_report |
| cc_backup |
| cc_billing_customer |
| cc_call |
| cc_call_archive |
| cc_callback_spool |
| cc_callerid |


I can access a2billing database as a2billinguser without any problems.

I understand that during logon process (from GUI) web server accesses the database via php in order to perform authentication and a2billing.conf file is not read; it is read when a2billing PBX engine itself needs to access the database - correct me if I am wrong.

I am trying to find a config file that tells either www server or php which database (mysql or postgres) needs to be accessed for user authentication.

It also could be permission related problem - so far I have not found manual explaining which service needs to be run as which user.
If anyone has an installation manual that might help please share with me.

I have CentOS 6.2, asterisk 1.8 and the latest a2billing.

In the worse case I will re-built asterisk and a2billing again.


Top
 Profile  
 
 Post subject: Re: Connection failed
PostPosted: Thu Apr 05, 2012 4:36 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Hi

The only file to change is /etc/a2billing.conf

Joe


Top
 Profile  
 
 Post subject: Re: Connection failed
PostPosted: Thu Apr 05, 2012 7:53 pm 
Offline

Joined: Thu Apr 05, 2012 8:12 am
Posts: 48
Joe,

Thanks for reply.

You were right - this was config file related. It was missing "[database]" statement.

I added it and I am able to login to a2billing GUI. Many thanks!!!!

I am still curious why a2billing was trying to talk to postgres instead of mysql?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 
Predictive Dialer


All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group