Well I'll be dipped, look at the big brain on Daniel. This appears to be the solution, my new sip-router has only been up for 10 days, had 300K+ records in acc table. I added a simple mysql table rotation script as a daily cron task to clean records past a day. Now the stored procedure is executing quickly and the log errors have disappeared. Fred's response of adding "select 'done' as result;" seems plausible in a low call volume situation, but in this case it was the opposite.
Thanks Gentleman and have a great weekend!
JR
On Thu, Mar 28, 2019 at 3:50 PM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
iirc, a while ago I had similar errors, that happened because the stored procedure took too long to execute, due to the fact that the acc or cdrs tables had a lot of records. If that is the case, you should move old processed records to a different table or delete them if they are no longer needed.
Cheers, Daniel
On 28.03.19 18:42, JR Richardson wrote:
Hey Folks,
Getting some annoying logs, pretty certain these are false positives. I'm running kamailio 4.4.7 using localhost mysql 5.5.60 on debian 7.11. Pretty simple setup, have acc and collecting cdrs. Relevant kamailio.cfg:
loadmodule "acc.so" loadmodule "rtimer.so" loadmodule "sqlops.so"
# ----- acc params ----- modparam("acc", "db_url", DBURLRW) modparam("acc", "db_flag", 1) modparam("acc", "db_missed_flag", 2) modparam("acc", "db_extra", "src_user=$fU;src_domain=$fd;src_ip=$si;" "dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;" "accountcode=$avp(s:acctcode)") modparam("rtimer", "timer", "name=cdr;interval=300;mode=1;") modparam("rtimer", "exec", "timer=cdr;route=CDRS") modparam("sqlops", "sqlcon", "cb=>mysql://rwuser:rwpass@localhost/kamailio")
route[CDRS] { sql_query("cb","call kamailio_cdrs()","rb"); }
Logs: ERROR: db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver error on query: Lost connection to MySQL server during query (2013) ERROR: <core> [db_query.c:181]: db_do_raw_query(): error while submitting query ERROR: sqlops [sql_api.c:265]: sql_do_query(): cannot do the query [call kamailio_cdrs()]
CDRs are working fine, no issues with the results, just the log messages. Errors occur every 5 minutes so this is related to the rtimer cycle, mode=1 is set for new connection so there really wouldn't be a lost connection, the old connection should have been relieved on last cycle.
I've seen some other post talking about this issue but could not find any resolution or work around. Any help is appreciated.
Thanks.
JR
-- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com
-- JR Richardson Engineering for the Masses Chasing the Azeotrope