Re: [SR-Users] db_mysql Commands out of sync; you can't run this command now

2011-08-28 Thread Daniel-Constantin Mierla

Hello,

thanks for investigation - this is only on current devel version. For 
quick try, can you revert the patch and try? Practically, you have to 
replace:



while( mysql_more_results(CON_CONNECTION(_h))  
mysql_next_result(CON_CONNECTION(_h))  0 ) {


with:

while( mysql_next_result( CON_CONNECTION(_h) )  0 ) {

two times in modules/db_mysql/km_dbase.c.

At this moment I do not have a good internet connection to be able to 
investigate more and search into documentation of mysql for 
mysql_more_results(). It looks like the result was not freed indeed. 
Another case for such error is when a mysql connection is shared between 
many processes and the access to it is not synchronized -- there were no 
changes afaik that could introduce such situation.


Thanks,
Daniel

On 8/27/11 10:14 PM, MÉSZÁROS Mihály wrote:

Hi,

I am using the git version of kamailio, and i am experiencing problem
This message is repeated in log with all kind of mysql query 
(insert/delete/select)


Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: db_mysql 
[km_dbase.c:124]: driver error on query: Commands out of sync; you 
can't run this command now
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: core 
[db_query.c:103]: error while submitting query
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[udomain.c:570]: db_query failed
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: db_mysql 
[km_dbase.c:124]: driver error on query: Commands out of sync; you 
can't run this command now
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: core 
[db_query.c:186]: error while submitting query
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[ucontact.c:513]: inserting contact in db failed
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[urecord.c:474]: failed to insert in database
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: registrar 
[save.c:430]: failed to insert contact
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: db_mysql 
[km_dbase.c:124]: driver error on query: Commands out of sync; you 
can't run this command now
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: core 
[db_query.c:242]: error while submitting query
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[urecord.c:426]: failed to delete from database
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[udomain.c:896]: DB delete failed


I am using stable debian so db_mysql.so linked with libmysqlclient.so.16

I read mysql doc and it is saying about this error the following:
Commands out of sync; you can't run this command now

http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html

So this problem cause it that not freed the last result.

Only one assumption:
Could it related to this change:
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=commitdiff;h=dfc2834223b7c6b2e799da5a0876b8096cfdae5e 



Any help appreciated.

Regards,
Misi

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Off the wall Cellular phone idea

2011-08-28 Thread Daniel-Constantin Mierla

Hello,

I don't see how this question relates to Kamailio -- anyhow, you should 
consult the legislation of your country. I know such action voids the 
guarantee of the device.


Daniel

On 8/27/11 8:03 AM, Justin wrote:
Would it be illegal to unlock a cellular phone to freely accept any 
cellular signal?  In thought, cellular phones operate similar to a 
Stereo/ radio receiving signal, so why do we limit our service to the 
selected provider? Are we not allowed to open the phone to collect and 
send any signal we choose?


Pretty dumb questions, just a hanker for some tinkering. Thanks~


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] SEMS 1.4.2 released

2011-08-28 Thread Daniel-Constantin Mierla

Hello,

On 8/26/11 11:56 AM, Stefan Sayer wrote:

(apologies if you receive multiple copies of this mail)

Hello,

the SIP Express Media Server version 1.4.2 is available. Users of SEMS 
1.4 versions and anyone else is recommended to upgrade to that 
version. Please find below the relevant changelog, the source at

  ftp://ftp.iptel.org/pub/sems/sems-1.4.2.tar.gz
and Debian/Ubuntu packages as always at OBS
  https://build.opensuse.org/project/show?project=home%3Ateam-sems

Many thanks to everyone who contributed with testing, bug fixes, 
documentation and feedback.


  * SEMS 1.4.2 release
 * auth'ed BYE (wait_for_bye_transaction)
 * fixes SIP auth for qop header format
 * xmlrpc: fix busyloop with keep-alive
 * a few minor SST issues
 * builds on Ubuntu 11.4 (build-deps)
 * ivr: release GIL on blocking file I/O
 * SBC: fix codec filter for unnamed payloads96
 * fixed DSM variables to outgoing call
 * some examples and documentation added
is there any site kept updated with documentation or just some folder in 
the source tree?


Thanks,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] db_mysql Commands out of sync; you can't run this command now

2011-08-28 Thread Alex Hermann
On Saturday 27 August 2011, MÉSZÁROS Mihály wrote:
 I am using the git version of kamailio, and i am experiencing problem
 This message is repeated in log with all kind of mysql query
 (insert/delete/select)
 http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html

Can you try to reproduce with attached patch and mail the line with the 
mysql error as well as the last couple of loglines with submit_query and 
store_result having the same con: as the failing query.
You can anonymize the queries as long as it is still deducable which module 
submitted the query.

Also send list of modules using the database please.


 Only one assumption:
 Could it related to this change:
 http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=commitdiff;h=
 dfc2834223b7c6b2e799da5a0876b8096cfdae5e

That one can be safely reverted if you don't use the PV $sqlrows. But please 
do above test without reverting this.

-- 
Alex Hermann

diff --git a/modules/db_mysql/km_dbase.c b/modules/db_mysql/km_dbase.c
index d85fe5f..c192a0e 100644
--- a/modules/db_mysql/km_dbase.c
+++ b/modules/db_mysql/km_dbase.c
@@ -78,6 +78,13 @@ static int db_mysql_submit_query(const db1_con_t* _h, const str* _s)
 		return -1;
 	}
 
+	if (_h-table  _h-table-s)
+		LM_INFO( submit_query:  con: %p  table: %.*s  query: %.*s\n,
+_h, _h-table-len, _h-table-s, _s-len, _s-s);
+	else 
+		LM_INFO( submit_query:  con: %p  query: %.*s\n,
+_h, _s-len, _s-s);
+
 	if (my_ping_interval) {
 		t = time(0);
 		if ((t - CON_TIMESTAMP(_h))  my_ping_interval) {
@@ -163,6 +170,12 @@ static int db_mysql_store_result(const db1_con_t* _h, db1_res_t** _r)
 		return -1;
 	}
 
+	if (_h-table  _h-table-s)
+		LM_INFO(store_result:  con: %p  table: %.*s\n,
+_h, _h-table-len, _h-table-s);
+	else 
+		LM_INFO(store_result:  con: %p\n, _h);
+
 	*_r = db_new_result();
 	if (*_r == 0) {
 		LM_ERR(no memory left\n);
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] db_mysql Commands out of sync; you can't run this command now

2011-08-28 Thread MÉSZÁROS Mihály

Hello,

After reverting back to original this commit, the problem is still 
occurring. :(

So not this commit is causing the problem. :(

Misi



2011-08-28 09:25 keltezéssel, Daniel-Constantin Mierla írta:

Hello,

thanks for investigation - this is only on current devel version. For 
quick try, can you revert the patch and try? Practically, you have to 
replace:



while( mysql_more_results(CON_CONNECTION(_h))  
mysql_next_result(CON_CONNECTION(_h))  0 ) {


with:

while( mysql_next_result( CON_CONNECTION(_h) )  0 ) {

two times in modules/db_mysql/km_dbase.c.

At this moment I do not have a good internet connection to be able to 
investigate more and search into documentation of mysql for 
mysql_more_results(). It looks like the result was not freed indeed. 
Another case for such error is when a mysql connection is shared 
between many processes and the access to it is not synchronized -- 
there were no changes afaik that could introduce such situation.


Thanks,
Daniel

On 8/27/11 10:14 PM, MÉSZÁROS Mihály wrote:

Hi,

I am using the git version of kamailio, and i am experiencing problem
This message is repeated in log with all kind of mysql query 
(insert/delete/select)


Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: db_mysql 
[km_dbase.c:124]: driver error on query: Commands out of sync; you 
can't run this command now
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: core 
[db_query.c:103]: error while submitting query
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[udomain.c:570]: db_query failed
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: db_mysql 
[km_dbase.c:124]: driver error on query: Commands out of sync; you 
can't run this command now
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: core 
[db_query.c:186]: error while submitting query
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[ucontact.c:513]: inserting contact in db failed
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[urecord.c:474]: failed to insert in database
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: registrar 
[save.c:430]: failed to insert contact
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: db_mysql 
[km_dbase.c:124]: driver error on query: Commands out of sync; you 
can't run this command now
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: core 
[db_query.c:242]: error while submitting query
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[urecord.c:426]: failed to delete from database
Aug 27 22:04:05 hal /usr/sbin/kamailio[25681]: ERROR: usrloc 
[udomain.c:896]: DB delete failed


I am using stable debian so db_mysql.so linked with libmysqlclient.so.16

I read mysql doc and it is saying about this error the following:
Commands out of sync; you can't run this command now

http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html

So this problem cause it that not freed the last result.

Only one assumption:
Could it related to this change:
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=commitdiff;h=dfc2834223b7c6b2e799da5a0876b8096cfdae5e 



Any help appreciated.

Regards,
Misi

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users





___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] db_mysql Commands out of sync; you can't run this command now

2011-08-28 Thread Alex Hermann
On Sunday 28 August 2011, MÉSZÁROS Mihály wrote:
 I attached the log file.
 If you need detailed log/higher log level, then please let me know.

usrloc seems to be using the same connection from multiple processes:

pid: 18389 and 18391, connection: 0xb7387d5c


Aug 28 12:40:10 hal /usr/sbin/kamailio[18389]: INFO: db_mysql [km_dbase.c:83]:  
submit_query:  con: 0xb7387d5c  table: location  query: select 
contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified
 from location where username='mutf-hd' order by q 
Aug 28 12:40:10 hal /usr/sbin/kamailio[18391]: INFO: db_mysql [km_dbase.c:83]:  
submit_query:  con: 0xb7387d5c  table: location  query: select 
contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified
 from location where username='ppke-vjk' order by q 
Aug 28 12:40:10 hal /usr/sbin/kamailio[18389]: INFO: db_mysql [km_dbase.c:177]: 
store_result:  con: 0xb7387d5c  table: location 
Aug 28 12:40:10 hal /usr/sbin/kamailio[18389]: INFO: db_mysql [km_dbase.c:83]:  
submit_query:  con: 0xb7387d5c  table: location  query: update location set 
expires='2011-08-28 12:45:10',q=-1.00 
,cseq=2,flags=0,cflags=0,user_agent='Polycom HDX 8000 HD (Release - 
3.0.2.1-17007)',received=NULL,path=NULL,socket='tcp:195.111.192.7:5060',methods=24575,last_modified='2011-08-28
 12:40:10' where 
username='mutf-hd' AND contact='sip:mutf-hd@193.225.216.28:5060;transport=tcp' 
AND callid='3533311123-1752' 
Aug 28 12:40:10 hal /usr/sbin/kamailio[18391]: INFO: db_mysql [km_dbase.c:177]: 
store_result:  con: 0xb7387d5c  table: location 
Aug 28 12:40:10 hal /usr/sbin/kamailio[18391]: INFO: db_mysql [km_dbase.c:83]:  
submit_query:  con: 0xb7387d5c  table: location  query: insert into location
Aug 28 12:40:10 hal /usr/sbin/kamailio[18389]: INFO: db_mysql [km_dbase.c:83]:  
submit_query:  con: 0xb7387d5c  table: location  query: select 
contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified
 from location where username='de-tek-hpc' order by q 
Aug 28 12:40:10 hal /usr/sbin/kamailio[18389]: ERROR: db_mysql 
[km_dbase.c:131]: driver error on query: Commands out of sync; you can't run 
this command now 


It probably needs a fix like below because mod_init has also created a db 
connection which is inherited by at least one child and ul_dbh is not 0 
anymore. 
That process needs to be excluded from opening a database connection, all 
other childs need to open their own DB connection. I just don't know what 
rank mod_init is run as and thus don't know which process to exclude. Maybe
some other dev can jump in.


diff --git a/modules_k/usrloc/ul_mod.c b/modules_k/usrloc/ul_mod.c
index b3a9499..ca50b01 100644
--- a/modules_k/usrloc/ul_mod.c
+++ b/modules_k/usrloc/ul_mod.c
@@ -378,7 +378,7 @@ static int child_init(int _rank)
break;
}
 
-   if (!ul_dbh)
+   if (rank != PROC_MAIN)
ul_dbh = ul_dbf.init(db_url); /* Get a new database connection 
*/
if (!ul_dbh) {
LM_ERR(child(%d): failed to connect to database\n, _rank);


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users