[RESOLVED] 1.4.5 crash with cdr_addon_mysql

It looks like Asterisk 1.4.5 and the addons package is having issues.

My Asterisk 1.4.5 is crashing as soon as the first call terminates. I have asterisk-addons-1.4.1 loaded.

The error message I’m getting is:
asterisk: symbol lookup error: /usr/lib/asterisk/modules/cdr_addon_mysql.so: undefined symbol: dont_use_localtime_r_use_ast_localtime_instead

Same here!
Asterisk 1.4.5 and Addons 1.4.1 on a Ubuntu 7.04

I should have mentioned that my box was also a Ubuntu 7.04 x86 platform. I have an Ubuntu 6.06 box and had no problems with 1.4.5 and the addons package.

My short term solution was to downgrade back to 1.4.4.

I too am having the crash just after a disconnect (looks like prior to spawning a connection). Using Mandriva 2007.0 with 2.6.21 kernel, asterisk-1.4.5 and asterisk-addons-1.4.1.


I am running Fedora 6 with asterisk-1.4.5 : Same problem

asterisk: symbol lookup error: /usr/lib/asterisk/modules/cdr_addon_mysql.so: undefined symbol: dont_use_localtime_r_use_ast_localtime_instead

At first I noticed a crash when accessing some GUI pages.
Then I noticed a crash after accessing voice mail.
I’ll have to remove asterisk cdr_addon_mysql.so to stablize the system

Added this to modules.conf
noload => cdr_addon_mysql.so

I think asterisk-addons-1.4.1 asterisk-1.4.5 or needs an update

Same problem here - Slackware 11 upgrading from:

Asterisk 1.4.4
Asterisk-addons 1.4.1
LibPRI 1.4.0


Asterisk 1.4.5
Asterisk-addons 1.4.1
Zaptel 1.4.3
LibPRI 1.4.0

‘noload cdr_addon_mysql.so’ in modules.conf stops the crash, but (obviously) stops CDR logging to MySQL also.


same problem for me, with CentOS 5. My application uses mysql in the dialplan and just by removing the cdr_addon_mysql.so, it quit crashing on me. It was crashing on hangup for every call.

I have the same prob too. Redhat Core 4.

I did a little hack as a workaround (likely this is not the proper way to do it; I am not at-all familiar with the asterisk code). But, my CDRs are still being logged to MySQL using this hack.

asterisk-addons-1.4.1/cdr_addon_mysql.c (around line 132)


localtime_r(&cdr->start.tv_sec, &tm);


ast_localtime(&cdr->start.tv_sec, &tm, NULL);

‘make’ then ‘make install’ then restart asterisk

So far, no crash, but only running on the hack for one day…


Good work Priam!
That works on our system.
Here is a patch file.

START =========================================
— cdr_addon_mysql.c 2007-02-16 09:25:24.000000000 +1100
+++ cdr_addon_mysql.c 2007-06-19 09:09:19.000000000 +1000
@@ -129,7 +129,7 @@

memset(sqlcmd, 0, 2048);
  • localtime_r(&cdr->start.tv_sec, &tm);
  • ast_localtime(&cdr->start.tv_sec, &tm, NULL);
    strftime(timestr, 128, DATE_FORMAT, &tm);

END ==========================================

patch -bp0 < cdr_addon_mysql.diff

I see that addons-1.4.2 is now available. Hopefully Priam’s patch was incorporated into the latest rev. Thanks, Priam, for finding the fix! I’ll mark this thread as “RESOLVED” as soon as I test the latest addons with 1.4.5.

With Asterisk 1.4.5 and Asterisk-Addons 1.4.2, I still have the crash occur.

Unfortunately I’m in a live environment, so I won’t be able to provide debug information until after 5 CDT.

My eviroment:

Asterisk 1.4.5+asterisk-addons 1.4.2.

cli :cdr status reture

CDR registered backend: csv
CDR registered backend: pgsql
CDR registered backend: cdr_manager
CDR registered backend: cdr-custom

It seemed like cdr_mysql.so is not loaded at all.

Was crashing here too.
Slackware 11

  • 1.4.5
    addons 1.4.1 --> upgraded to 1.4.2 and all seems OK.
    Thanks guys.

I finally had some down time and upgraded to 1.4.5 again, this time using the 1.4.2 version of addons. Looks like that did the trick - no more crashes. I went ahead and marked the thread as resolved.

Hi afried, Thanks for this post. I got my Asterisk 1.4.5 resolved too with the new addon-1.4.2 on my new FC7 Box.

I am planning to deploy Asterisk on an Ubuntu server 7.04. I have once tried and got some difficulties with the file system and thus Asterisk couldn’t compile and so also zaptel. Can you please give me a work around on how you got Asterisk installed on your Ubuntu Server or any link that could help.