Hello,

the ping option is set to the libmysqlclient, kamailio itself doesn't do anything in this regard. Iirc, in some old versions of the library, this option didn't work.

On the other hand, kamailio should try to reconnect if disconnected, but in this case it seems that the connection was broken during the query.

Cheers,
Daniel

On 14.12.20 17:51, Duarte Rocha wrote:
Greetings all, 

I'm having some dropped MySQL connections in my Kamailio in times of low or no activity in the proxy. 

These are the errors i'm getting : 

    db_mysql [km_dbase.c:123]: db_mysql_submit_query(): driver error on query: Lost connection to MySQL server during query (2013)
    <core> [db_query.c:348]: db_do_update(): error while submitting query
    usrloc [ucontact.c:1147]: db_update_ucontact_ruid(): updating database failed
    usrloc [ucontact.c:1663]: update_contact_db(): failed to update database
    registrar [save.c:784]: update_contacts(): failed to update contact
    sl [sl_funcs.c:414]: sl_reply_error(): stateless error reply used: I'm terribly sorry, server error occurred (1/SL)

In order to try to fix this i've added timeout_interval and ping_interval from the db_mysql module. Is this the best approach?

I've restarted my Kamailio but i don't see any ping going to my BD. Is there any other config that I need to add so that the pings are sent?

Is it possible to do a ping to verify connection and reconnect mannualy on the config file?

Best Regards,

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla