Ok, so I believe I may have found the issue, or rather I think I know what's 
happening, just not where it all goes wrong.

In my kamailio config I have logic for some users to call through a list of 
numbers to find a number where they are able to take the call, pretty much like 
a hunt-group, trying the numbers one by one.

When none of the numbers are answered and one of these calls time out and 
Request Timeout occurs, it looks like the `timer` process would like to write a 
row for each call leg/branch to the `missed_calls` table and here's where the 
issue seems to occur (I've added some debug output to be able to trace back 
what's happening and 54110017 below is the mysql thread ID):
```
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: WARNING: db_mysql 
[km_dbase.c:80]: db_mysql_submit_query(): 54110017 entering 
db_mysql_submit_query
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: WARNING: db_mysql 
[km_dbase.c:89]: db_mysql_submit_query(): 54110017 mysql ping done
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: WARNING: db_mysql 
[km_dbase.c:101]: db_mysql_submit_query(): 54110017 submit_query(): insert into 
`missed_calls` (branch 1 data)
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: WARNING: db_mysql 
[km_dbase.c:116]: db_mysql_submit_query(): 54110017 db_mysql_submit_query 
returned 0
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: WARNING: db_mysql 
[km_dbase.c:80]: db_mysql_submit_query(): 54110017 entering 
db_mysql_submit_query
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: WARNING: db_mysql 
[km_dbase.c:101]: db_mysql_submit_query(): 54110017 submit_query(): insert into 
`missed_calls` (branch 2 data)
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: ERROR: db_mysql 
[km_dbase.c:128]: db_mysql_submit_query(): 54110017 driver error on query: SSL 
connection error: socket layer receive error (2026)
Feb 16 21:05:24 host /usr/sbin/kamailio[2731]: ERROR: <core> [db_query.c:235]: 
db_do_insert_cmd(): error while submitting query
```

I'm guessing that the two db_mysql_submit_query() calls run at almost the same 
time and that the first insert has not completed before the second insert wants 
to run, at which point something similar to what's described here occurs: 
http://dev.mysql.com/doc/refman/5.6/en/c-api-multiple-queries.html

This is only observed when the connection is running over SSL, so there's 
probably something related there.

OR.. my config is screwed up and I'm not working with branches in the correct 
way :)

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/406#issuecomment-184863893
_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to