Hello,
I installed and run Kamailio, it run pretty stabil for a while with a
few phone registered, but recently encountered a mysql error, once a
while, kamailio report following error:
/usr/local/sbin/kamailio[11693]: INFO: <script>: route[AUTH]
/usr/local/sbin/kamailio[11693]: ERROR: db_mysql [km_dbase.c:117]:
driver error on query: Commands out of sync; you can't run this
command now
/usr/local/sbin/kamailio[11693]: ERROR: <core> [db_query.c:101]:
error while submitting query
/usr/local/sbin/kamailio[11693]: ERROR: auth_db [authorize.c:102]:
failed to query database
the freq of these error getting increase once we introduce more
clients. Try to google about this type of error, but found a mix
suggestion without clear answer/suggestion.
Any pointer/suggestion on how to troubleshoot?
Thanks in advance for you help.
========
i'm running :
Server: kamailio (3.0.3 (i386/linux)) a22dc9
Mysql: 5.0.77
CentOS 5.5
looks like there is currently no function that could be used to replace
parts of uri (such as userpart) with a new value. it can be done by
copying the uri temporarily to request uri or by a ugly regular
expression.
should i write utility function(s) for replacing userpart and perhaps
also hostpart or are there better, more generic suggestions?
-- juha
Module: sip-router
Branch: master
Commit: 1b209e395c1816aa126592c005f4fb61d9828dfd
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1b209e3…
Author: Jan Janak <jan(a)ryngle.com>
Committer: Jan Janak <jan(a)ryngle.com>
Date: Wed Nov 17 18:27:35 2010 -0500
Merge branch 'master' of ssh://git.sip-router.org/sip-router
* 'master' of ssh://git.sip-router.org/sip-router: (31 commits)
app_lua: several tm functions added to Lua api
tm: added export structure for extra API
app_lua: added several core functions to sr package
app_lua: helper function to return error code
app_lua: fixed name of module in modparam examples
app_lua: added registrar API to Lua
registrar(k): exported inter-module API
usrloc(k): db modes defines moved in usrloc.h
usrloc(k)API function get_udomain()
usrloc(k): preload parameter exported
usrloc(k): new parameter 'preload'
sqlops: added LF to end of debug message
app_lua: sr.maxfwd mentioned as available submodule
maxfwd(k): added inter-module API structure
auth_db(k): added new file api.h
app_lua: typo in register parameter
app_lua: added functions from auth_db api
auth_db(k): close db handle only for second param fixup
app_lua: note about submodule sr.auth
app_lua: exported functions from AUTH API to Lua
...
---
Module: sip-router
Branch: master
Commit: 0e564bcd3616f9dc981bb768003545674c79c2a7
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0e564bc…
Author: Jan Janak <jan(a)ryngle.com>
Committer: Jan Janak <jan(a)ryngle.com>
Date: Wed Nov 17 18:26:32 2010 -0500
db_mysql: Fixes crash in libmysqlclient after connection reset.
Sometimes SIP-Router would crash in libmysqlclient after a connection
to the server has been reset. This is caused by mysql_stmt_prepare
which will reset the connection data structure if a connection has been
reset. Subsequent calls to other mysql functions (mysql_stmt_execute)
crash unless the connection has been re-connected. This is documented
as mysql bug #33384.
A workaround is to reset and reconnect the connection explicitly
immediately after mysql_stmt_prepare has failed with
CR_SERVER_GONE_ERROR. This change implements exactly that.
First of all, this patch fixes a minor bug in updating the variable
that keeps track of number of connection resets for each database
connection and pre-pared statement. The variable needs to be
incremented each time a connection is closed. Previously it was
incremented only if a connection was successfully reconnected. If the
reconnect attempt failed than the variable was not incremented. The
function that uploads commands to the server relies on the variable
to detect connection resets and may not have worked properly under
some circumstances (if a connection fails to reconnect).
Function upload_cmd has been modified to close the connection
explicitly if mysql_stmt_prepare fails with CR_SERVER_GONE_ERROR. This
ensures that subsequent calls to mysql_stmt_exec are forced to reconnect
and re-upload commands to the server. This is needed to prevent the
library from crashing.
exec_cmd_safe now checks if a connection has been disconnected and if
so it tries to reconnect it before executing a prepared statement. This
is used to recover from failing mysql_stmt_prepare.
---
modules/db_mysql/my_cmd.c | 258 +++++++++++++++++++++++++--------------------
modules/db_mysql/my_con.c | 18 ++--
modules/db_mysql/my_con.h | 10 +-
3 files changed, 158 insertions(+), 128 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=0e5…
Hello SER Team,
We have made SER listen on two ports via adding this command
(listen=eth0:5060 eth0:5062) in ser.cfg file. Now we are able to get
the server listening on two ports as 5060 & 5062 and it is sending 200
OK for the user agents which try to communicate on both the ports. SER
is able to register two user agents, one on 5060 and one on 5062. But
when we are trying to make a communication between the two registered
user agents (i.e. one on 5060 and other on 5062) then no communication
is possible (i.e. we cannot make calls and chats). Though when the two
user agents are registered on same port (i.e. both UAs on 5060 or both
UAs on 5062) then communication is possible between the two clients
(i.e. we can make calls and chats).
Can you people please guide me through that how can I make the 2 UAs
registered to SER on different ports (i.e. one on 5060 and other on
5062) communicate with each other (i.e. they can make calls and
chats).
I have attached a log as well which shows the same problem. This is a
wireshark captured output on the machine which has SER installed.
Thanks and Best Regards
Saurabh Srivastava