[asterisk-users] realtime queue_log to mySQL backport to 1.4

Lee, John (Sydney) John.Lee at compuware.com
Fri Oct 17 01:09:18 CDT 2008


> I did not know what I did but I bumped into something in the log that
says:
> [Oct 16 ...] ERROR[24536] res_config_mysql.c: MySQL RealTime: Ping
failed
> (2006).  Trying an explicit reconnect.
> [Oct 16 ...] DEBUG[24536] res_config_mysql.c: MySQL RealTime: Server
Error
> (2006): MySQL server has gone away
> [Oct 16 ...] DEBUG[24536] res_config_mysql.c: MySQL RealTime:
Successfully
> connected to database.
> 
> However, I believe the problem has something to do with MySQL refusing
to
> talk to Asterisk.
>
That was my wrong assumption.
I checked res_config_mysql.c and the comments says:
/* MySQL likes to return an error, even if it reconnects successfully.
 * So the postman pings twice. */
if (mysql_ping(&mysql) != 0 && mysql_ping(&mysql) != 0) {...}

So, at this stage, my res_config_mysql.c is still not writing anything
into table queue_log despite having: a) correct res_mysql.conf b)
extconfig.conf c) mysql up and running d) res_config_mysql.c start up
okay

I believe that it is because the following "if" condition in logger.c is
never met:

***if (ast_check_realtime("queue_log"))***
   {
     va_start(ap, fmt);
     vsnprintf(qlog_msg, sizeof(qlog_msg), fmt, ap);
     va_end(ap);
     snprintf(time_str, sizeof(time_str), "%ld", (long)time(NULL));
     ast_store_realtime("queue_log", "time", time_str, "callid", callid,

                        "queuename", queuename, "agent", agent, "event",

                         event, "data", qlog_msg, NULL);

Does anyone know what does ast_check_realtime do?
Is there a developer mailing list I can try?





More information about the asterisk-users mailing list