Every so often Mysql Failed to connect to Db stops asterisk

Hi

Using asterisk 1.2.13 on centos every so often we can find our asterisk stopped. We record all cdr records to mysql which is also on the same machine. I have also had this happen on a asterisk 1.4 box once in the last 2 months.

Typing service asterisk start always gets it going again.

/var/log/asterisk/messages had the following which stopped asterisk.

Oct 23 12:47:46 ERROR[26763] res_config_mysql.c: MySQL RealTime: Failed to connect database server on (err 2002). Check debug for more info.
Oct 23 12:47:46 WARNING[26763] res_config_mysql.c: MySQL RealTime: Couldn’t establish connection. Check debug.

cdr_mysql.conf

[global]
hostname=localhost
dbname=asterisk
table=cdr
password=pbdf32
user=root
port=3306
sock=/var/lib/mysql/mysql.sock
userfield=1

cdr.conf

batch=yes
size=300
time=3600
scheduleronly=no

Any Ideas why it actually stops asterisk. I have checked mysql and every thing seems ok. Always works when you start asterisk again.
Is there a way to not have asterisk stop if it fails to write records to mysql ?

Thanks

Nick

Hi

Just spent some more time checking on it as asterisk stopped around every hour yesterday. The mysql error was just the realtime mysql which was not setup as we dont use mysql to store the config.

The Actual error message which stopped asterisk was only visible on the F9 screen of the server.? not in any logs.

DCS Group(1111) coding_8-bit data class=1
/usr/lib/asterisk/sms_spooler no such file or dir
Ouch error while writing audio data broken pipe
warn flexible rate not heavly tested.

This is to do with the voismart quad vgsm card driver when it receives text messages. Adding to vsgm.conf the stuff to send incoming txt via sendmail fixed the above message but when we receive mms via one of the sims that still stopped asterisk with the message below.

DCS Group(1111) coding_8-bit data class=1
Ouch
no recipient address found in header.

Not quite sure where to put this in the vsgm.conf but Ill look at the voismart wiki.

Thanks
Nick