[Home]

Summary:ASTERISK-09988: Blocking Asterisk is connection to server disappears
Reporter:Carles Pina i Estany (cpina)Labels:
Date Opened:2007-07-31 02:16:43Date Closed:2011-06-07 14:00:35
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Addons/app_mysql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:mysql_ping function is used in cdr_addon_mysql.c. This function blocks the module if connection is dropped "in some ways" (when network doesn't return any ICMP notification). It is a known problem with mysql_ping.

Way to reproduce: setup an Asterisk and configure the CDRs to Mysql server using cdr_addon_mysql, then execute:
route add -host MYSQL_IP_SERVER gw 127.0.0.1
And try to do some more calls.

This Asterisk will not be able to do any more call, stop now will not stop Asterisk, killall asterisk will not kill (only killall -9 asterisk).

It has mainly happened to us when we had a connectivity problem in Mysql server network.

Patch is in Additional Information.

Note: we are using cdr_mysql_addon with this patch:
http://www.uglyboxindustries.com/cdr_addon_mysql.patch
Anyway, original cdr_mysql_addon is using mysql_ping in the same way with the same problem.

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

Fix:
after mysql_options call, it is needed to add:
mysql_options(&mysql,MYSQL_OPT_RECONNECT,"FALSE");

Then will work as expected. We have been using it for some time without other
problems.
Comments:By: Jason Parker (jparker) 2007-08-17 14:34:24

According to the mysql documentation at http://dev.mysql.com/doc/refman/5.0/en/mysql-options.html, this option only exists in version 5.0.13 and higher.  It defaults to off in 5.0.3 and higher.

Additionally, we use mysql_ping as a way to force a reconnect.

I expect that Asterisk will not stop new calls from being made in 1.4.  Please test 1.4, and reopen if you can still reproduce the call blocking aspect of this.