[Home]

Summary:ASTERISK-14103: [patch] Realtime SIP not working in current SVN
Reporter:MichaelLinke (michaellinke)Labels:
Date Opened:2009-05-11 06:22:49Date Closed:2011-06-07 14:00:46
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Addons/res_config_mysql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20090511__DEBUG_issue15077.diff.txt
Description:There seams to be an broken connection beetwen the Aterisk SIP Module in Realtime mode and res_config_mysql.
Asterisk report an missimg mysql table for alle configured tables in extconfig.conf.
The mysql server is working and the tables exist. The mysql server log shows that no request hast been send to the server.
And "realtime mysql status" shows that the realtime module is connected to the mysql server.
Using the same configurations files, this mysql configuration is working in Asterisk 1.4 and 1.6.0 without any problems.
And the  cdr_addon_mysql.c works in this svn version using the same mysql parameters.

It seams as the there is a bug so that no request is send and so the asterisk think that there is no table. So the error message is wrong.



****** ADDITIONAL INFORMATION ******

[ Reading Master Configuration ]
[ Initializing Custom Configuration Options ]
[May 11 13:10:22] NOTICE[30649]: cdr.c:1441 do_reload: CDR simple logging enabled.
[May 11 13:10:22] NOTICE[30649]: loader.c:860 load_modules: 99 modules will be loaded.
...[May 11 13:10:22] NOTICE[30649]: config.c:1958 ast_config_engine_register: Registered Config Engine mysql
....SIP channel loading...
[May 11 13:10:22] WARNING[30649]: res_config_mysql.c:1122 require_mysql: Table sip_intern not found in database.  This table should exist if you're using realtime.
..[May 11 13:10:22] ERROR[30649]: pbx_dundi.c:4597 set_config: Unable to load config dundi.conf
...........[May 11 13:10:22] NOTICE[30649]: app_meetme.c:4435 load_config_meetme: Audio buffers per channel set to 16
[May 11 13:10:22] WARNING[30649]: res_config_mysql.c:1122 require_mysql: Table meetme not found in database.  This table should exist if you're using realtime.



*CLI> realtime mysql status
general connected to asterisk@yyyyyyyyyyy.yy, port 3306 with username asterisk for 0 seconds.

Comments:By: Tilghman Lesher (tilghman) 2009-05-11 12:00:30

I have uploaded a patch which should clarify exactly why it was not able to find the table.  Please upload a new log, as well as the contents of your extconfig.conf and res_mysql.conf.  These will help me to discover wherein the problem lies.

By: MichaelLinke (michaellinke) 2009-05-11 14:54:49

Hi, here a new log and the requested files:


Asterisk SVN-trunk-r193461, Copyright (C) 1999 - 2009 Digium, Inc. and others.
Created by Mark Spencer <markster@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.
=========================================================================
[ Booting...
[ Reading Master Configuration ]
[ Initializing Custom Configuration Options ]
[May 11 21:31:33] NOTICE[5374]: cdr.c:1441 do_reload: CDR simple logging enabled.
[May 11 21:31:33] NOTICE[5374]: loader.c:860 load_modules: 99 modules will be loaded.
...[May 11 21:31:33] NOTICE[5374]: config.c:1958 ast_config_engine_register: Registered Config Engine mysql
....SIP channel loading...
[May 11 21:31:33] WARNING[5374]: res_config_mysql.c:203 find_table: Database 'asterisk' not found!
[May 11 21:31:33] WARNING[5374]: res_config_mysql.c:1124 require_mysql: Table sip_intern not found in database.  This table should exist if you're using realtime.
..[May 11 21:31:33] ERROR[5374]: pbx_dundi.c:4597 set_config: Unable to load config dundi.conf
...........[May 11 21:31:33] NOTICE[5374]: app_meetme.c:4435 load_config_meetme: Audio buffers per channel set to 16
[May 11 21:31:33] WARNING[5374]: res_config_mysql.c:203 find_table: Database 'asterisk' not found!
[May 11 21:31:33] WARNING[5374]: res_config_mysql.c:1124 require_mysql: Table meetme not found in database.  This table should exist if you're using realtime.



cat /etc/asterisk/extconfig.conf
; Static and realtime external configuration
; engine configuration
;
; Please read doc/extconfig.txt for basic table
; formatting information.
;
[settings]
;
; Static configuration files:
;
; file.conf => driver,database[,table]
;
; maps a particular configuration file to the given
; database driver, database and table (or uses the
; name of the file as the table if not specified)

;
; Realtime configuration engine
;
meetme => mysql,asterisk,meetme
sippeers => mysql,asterisk,sip_intern
sipusers => mysql,asterisk,sip_intern
;sipregs => mysql,asterisk,sip_intern
extensions => mysql,asterisk,dialplan

speak => mysql,asterisk,dialplan_helper_record
record => mysql,asterisk,dialplan_helper_speak



# vi /etc/asterisk/res_mysql.conf
;
; Sample configuration for res_config_mysql.c
;
; The value of dbhost may be either a hostname or an IP address.
; If dbhost is commented out or the string "localhost", a connection
; to the local host is assumed and dbsock is used instead of TCP/IP
; to connect to the server.
;
[general]
dbhost = wwx.xxxx.de
dbname = asterisk
dbuser = xxxxxxx
dbpass = xxxxxxx
dbport = 3306
dbsock = /tmp/mysql.sock
requirements=warn



And here the MYSQL Server Log:
tail -f /var/log/mysql/mysql.log

090511 21:37:1213007 Connect    asterisk@localhost on asterisk
               13007 Query     SET NAMES
               13007 Query     DESC cdr



As we see here there is an connect, but only from the cdr module. The Realtime module don't speak with the server. If I connect to mysql server from the shell using the same parameters, I can see all needed tables and data.



By: Tilghman Lesher (tilghman) 2009-05-11 17:34:15

Please re-read the comment at the very top of extconfig.conf, and re-read the mysql.log.  Please note the difference in the host connected, make that correction, and try again.

For reference, please note the difference between:
% mysql -h localhost asterisk
and
% mysql -h xx.xxxxxx.de asterisk

By: MichaelLinke (michaellinke) 2009-05-12 02:01:50

ok, this difference was from my last test. But the host was the same. I have now configured both to localhost, but the problem is the same.
Here a new log in debug mode, so you can see the connected hosts.

[[[log snipped]]]



By: Tilghman Lesher (tilghman) 2009-05-12 03:01:36

For future reference, please upload logs into the file upload area, instead of pasting them into a bugnote.

Next thing to check is whether you actually have a /tmp/mysql.sock.  If you're using a packaged version of MySQL, it's more likely to be in either /var/lib/mysql/mysql.sock or /var/run/mysql/mysqld.sock.  You can also comment out the line item for MySQL to use the default location (usually correct).

By: MichaelLinke (michaellinke) 2009-05-12 16:43:59

ls -l /tmp/
total 0
srwxrwxrwx 1 mysql users 0 Apr 11 23:41 mysql.sock

So the path is correct. It is a source version, self compiled.

The problem has nothing to do with the mysql socket path because the problem occur even if I use localhost or 127.0.0.1 or the domain name of the server. It is allways the same.

And please remember that Asterisk 1.6.0.9 and 1.6.1 works with the same config on the same server. Only the current SVN version don't work.

By: Tilghman Lesher (tilghman) 2009-05-12 17:00:09

Found the problem:

Change your extconfig.conf to:

meetme => mysql,general,meetme
sippeers => mysql,general,sip_intern
sipusers => mysql,general,sip_intern
;sipregs => mysql,general,sip_intern
extensions => mysql,general,dialplan

speak => mysql,general,dialplan_helper_record
record => mysql,general,dialplan_helper_speak

Please see the first 6 lines of UPGRADE.txt in asterisk-addons trunk.  Note that this is not the same UPGRADE.txt as core Asterisk, but is specific to asterisk-addons.

By: Tilghman Lesher (tilghman) 2009-05-12 17:03:39

BTW, the reason for this change was to allow realtime to support separate read and write handles.

By: MichaelLinke (michaellinke) 2009-05-13 16:43:08

This solved the problem.
I did nothing read before about this "general" instead of the dbname here.


Thank you for your help!