[asterisk-dev] Problem with res_config_mysql

Mark Michelson mmichelson at digium.com
Fri Nov 9 08:59:04 CST 2012


On 11/08/2012 08:50 PM, Taylor, Jonn wrote:
> I am trying to use res_config_mysql to store phone information from 
> chan_sccp-b. I can not get the module to connect to the mysql 
> database. I can configure the sccp module with config files and 
> everything works fine. Here is my configs.
>
> res_config_mysql.conf
>
> [general]
> dbhost = localhost
> dbport = 3306
> dbname = asterisk
> dbuser = asteriskuser
> dbpass = xxxxxxxxx
> dbsock = /var/lib/mysql/mysql.sock
> requirements=warn ; or createclose or createchar
>
> Asterisk SVN-trunk-r375175, Copyright (C) 1999 - 2012 Digium, Inc. and 
> others.
> Created by Mark Spencer <markster at digium.com>
> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' 
> for details.
> This is free software, with components licensed under the GNU General 
> Public
> License version 2 and other licenses; you are welcome to redistribute 
> it under
> certain conditions. Type 'core show license' for details.
> =========================================================================
>   == Parsing '/etc/asterisk/extconfig.conf': Found
>   == Binding meetme to odbc/meetme/booking
>   == Binding sccpdevice to mysql/asterisk/sccpdeviceconfig
>   == Binding sccpline to mysql/asterisk/sccpline
> Connected to Asterisk SVN-trunk-r375175 currently running on gateway 
> (pid = 19431)
> gateway*CLI> realtime mysql status
> general connected to asterisk at localhost, port 3306 with username 
> asteriskuser for 9 minutes.
>     -- SCCP: Accepted connection from 192.168.183.120
>     -- SCCP: Using ip 192.168.183.1
>     -- SCCP: Alarm Message: Severity: Informational (2), 24: 
> Name=SEP001BD51256C4 Load=8.1(2.0) Last=Phone-Reg-Rej [2048/2025302208]
> [2012-11-08 20:48:46] WARNING[9513]: res_config_mysql.c:335 
> realtime_mysql: MySQL RealTime: Invalid database specified: asterisk 
> (check res_mysql.conf)
> [2012-11-08 20:48:46] NOTICE[9513]: sccp_actions.c:439 
> sccp_handle_register: SEP001BD51256C4: Rejecting device: Device Unknown
> gateway*CLI>
>
>

The error message is a bit misleading. What it meant to say is that you 
don't have a database configured in your res_config_mysql.conf file 
called "asterisk". You have a database called "general" that maps to a 
MySQL database called "asterisk". In other words, if you change the 
[general] to [asterisk] it should work.

Also, this is not a question pertaining to developing Asterisk code. 
Please ask questions such as these on the Asterisk users' mailing list 
in the future.

Thanks,
Mark Michelson



More information about the asterisk-dev mailing list