Module: sip-router
Branch: master
Commit: 61c706ef813520ce0ac6767e6be7ef6e52bd6b3a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=61c706e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Mar 24 13:07:39 2013 +0100
db_mysql: new module parameter - insert_delayed
- if set to 1, then all INSERT API queries will be converted in INSERT
DELAYED (only DB API insert, not for raw queries)
---
modules/db_mysql/README | 28 ++++++++++++++++++++++------
modules/db_mysql/doc/db_mysql_admin.xml | 20 ++++++++++++++++++++
modules/db_mysql/km_db_mysql.c | 1 +
modules/db_mysql/km_db_mysql.h | 1 +
modules/db_mysql/km_dbase.c | 11 ++++++++---
modules/db_mysql/mysql_mod.c | 1 +
6 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/modules/db_mysql/README b/modules/db_mysql/README
index 13a578f..def06aa 100644
--- a/modules/db_mysql/README
+++ b/modules/db_mysql/README
@@ -28,6 +28,7 @@ Daniel-Constantin Mierla
3.1. ping_interval (integer)
3.2. timeout_interval (integer)
3.3. auto_reconnect (integer)
+ 3.4. insert_delayed (integer)
4. Functions
5. Installation
@@ -38,9 +39,10 @@ Daniel-Constantin Mierla
1.1. Set ping_interval parameter
1.2. Set timeout_interval parameter
1.3. Set auto_reconnect parameter
- 1.4. Set a my.cnf group in db_url parameter
- 1.5. Adding a kamailio group to my.cnf
- 1.6. Using [client] and specific group
+ 1.4. Set insert_delayed parameter
+ 1.5. Set a my.cnf group in db_url parameter
+ 1.6. Adding a kamailio group to my.cnf
+ 1.7. Using [client] and specific group
Chapter 1. Admin Guide
@@ -57,6 +59,7 @@ Chapter 1. Admin Guide
3.1. ping_interval (integer)
3.2. timeout_interval (integer)
3.3. auto_reconnect (integer)
+ 3.4. insert_delayed (integer)
4. Functions
5. Installation
@@ -89,6 +92,7 @@ Chapter 1. Admin Guide
3.1. ping_interval (integer)
3.2. timeout_interval (integer)
3.3. auto_reconnect (integer)
+ 3.4. insert_delayed (integer)
3.1. ping_interval (integer)
@@ -132,6 +136,18 @@ modparam("db_mysql", "timeout_interval", 2)
modparam("db_mysql", "auto_reconnect", 0)
...
+3.4. insert_delayed (integer)
+
+ If set to 1, all INSERT SQL queries will be sent to MySQL server as
+ INSERT DELAYED.
+
+ Default value is 0 (1 - on / 0 - off).
+
+ Example 1.4. Set insert_delayed parameter
+...
+modparam("db_mysql", "insert_delayed", 1)
+...
+
4. Functions
No function exported to be used from configuration file.
@@ -158,12 +174,12 @@ modparam("db_mysql", "auto_reconnect", 0)
* mysql://user:pass@[group]/db
* mysql://[group]/db
- Example 1.4. Set a my.cnf group in db_url parameter
+ Example 1.5. Set a my.cnf group in db_url parameter
...
modparam("usrloc", "db_url", "mysql://[kamailio]/kamailio)
...
- Example 1.5. Adding a kamailio group to my.cnf
+ Example 1.6. Adding a kamailio group to my.cnf
...
[kamailio]
socket = /path/to/mysql.sock
@@ -177,7 +193,7 @@ default-character-set = utf8
both your specific group and the client group, then the value is taken
from the last one.
- Example 1.6. Using [client] and specific group
+ Example 1.7. Using [client] and specific group
...
[client]
socket = /var/run/mysql/mysqld.sock
diff --git a/modules/db_mysql/doc/db_mysql_admin.xml b/modules/db_mysql/doc/db_mysql_admin.xml
index 36ce140..738c464 100644
--- a/modules/db_mysql/doc/db_mysql_admin.xml
+++ b/modules/db_mysql/doc/db_mysql_admin.xml
@@ -121,6 +121,26 @@ modparam("db_mysql", "auto_reconnect", 0)
</programlisting>
</example>
</section>
+ <section id="db_mysql.p.insert_delayed">
+ <title><varname>insert_delayed</varname> (integer)</title>
+ <para>
+ If set to 1, all INSERT SQL queries will be sent to MySQL server as
+ INSERT DELAYED.
+ </para>
+ <para>
+ <emphasis>
+ Default value is 0 (1 - on / 0 - off).
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>insert_delayed</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("db_mysql", "insert_delayed", 1)
+...
+</programlisting>
+ </example>
+ </section>
</section>
<section>
<title>Functions</title>
diff --git a/modules/db_mysql/km_db_mysql.c b/modules/db_mysql/km_db_mysql.c
index 462dc60..8a51f3d 100644
--- a/modules/db_mysql/km_db_mysql.c
+++ b/modules/db_mysql/km_db_mysql.c
@@ -50,6 +50,7 @@
unsigned int db_mysql_timeout_interval = 2; /* Default is 6 seconds */
unsigned int db_mysql_auto_reconnect = 1; /* Default is enabled */
+unsigned int db_mysql_insert_all_delayed = 0; /* Default is off */
/* MODULE_VERSION */
diff --git a/modules/db_mysql/km_db_mysql.h b/modules/db_mysql/km_db_mysql.h
index 9fd9747..09997f7 100644
--- a/modules/db_mysql/km_db_mysql.h
+++ b/modules/db_mysql/km_db_mysql.h
@@ -42,6 +42,7 @@
extern unsigned int db_mysql_timeout_interval;
extern unsigned int db_mysql_auto_reconnect;
+extern unsigned int db_mysql_insert_all_delayed;
int db_mysql_bind_api(db_func_t *dbb);
diff --git a/modules/db_mysql/km_dbase.c b/modules/db_mysql/km_dbase.c
index e1cce08..029a674 100644
--- a/modules/db_mysql/km_dbase.c
+++ b/modules/db_mysql/km_dbase.c
@@ -404,10 +404,15 @@ int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r)
* \param _n number of key=value pairs
* \return zero on success, negative value on failure
*/
-int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n)
+int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
+ const int _n)
{
- return db_do_insert(_h, _k, _v, _n, db_mysql_val2str,
- db_mysql_submit_query);
+ if(unlikely(db_mysql_insert_all_delayed==1))
+ return db_do_insert_delayed(_h, _k, _v, _n, db_mysql_val2str,
+ db_mysql_submit_query);
+ else
+ return db_do_insert(_h, _k, _v, _n, db_mysql_val2str,
+ db_mysql_submit_query);
}
diff --git a/modules/db_mysql/mysql_mod.c b/modules/db_mysql/mysql_mod.c
index 74c61af..328965d 100644
--- a/modules/db_mysql/mysql_mod.c
+++ b/modules/db_mysql/mysql_mod.c
@@ -107,6 +107,7 @@ static param_export_t params[] = {
{"timeout_interval", INT_PARAM, &db_mysql_timeout_interval},
{"auto_reconnect", INT_PARAM, &db_mysql_auto_reconnect},
+ {"insert_delayed", INT_PARAM, &db_mysql_insert_all_delayed},
{0, 0, 0}
};
CC (gcc) [M msrp.so] msrp_parser.o
msrp_parser.c: In function ‘msrp_parse_uri’:
msrp_parser.c:540: warning: format ‘%ld’ expects type ‘long int’, but argument 9 has type ‘int’
msrp_parser.c:540: warning: format ‘%ld’ expects type ‘long int’, but argument 7 has type ‘int’
msrp_parser.c:540: warning: format ‘%ld’ expects type ‘long int’, but argument 8 has type ‘int’
msrp_parser.c:540: warning: format ‘%ld’ expects type ‘long int’, but argument 6 has type ‘int’
msrp_parser.c:540: warning: format ‘%ld’ expects type ‘long int’, but argument 6 has type ‘int’
gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)
Centos 5.9
/O
Module: sip-router
Branch: master
Commit: 3580d7fbc3318a2eefaa62e60fcad363e953cccb
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3580d7f…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: Sun Mar 24 11:38:27 2013 +0100
snmpstats Add SNMP support for shared memory
This is just the first proof-of-concept addition, will add more of the
core variables for memory and TCP connections
---
modules/snmpstats/kamailioServer.c | 126 ++++++++++++++++++++++++
modules/snmpstats/kamailioServer.h | 42 ++++++++
modules/snmpstats/mibs/KAMAILIO-MIB | 65 ++++++++++++
modules/snmpstats/mibs/KAMAILIO-SIP-COMMON-MIB | 1 -
modules/snmpstats/sub_agent.c | 8 ++
5 files changed, 241 insertions(+), 1 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=358…
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#278 - usrloc module stops updating some records in db_mode 2
User who did this - Jordan (jordan)
----------
I've attached the output of 'kamailio -V'. This is 3.3.4 compiled and installed from the source tarball on March 4, 2013.
The bad contact hasn't expired according to the output of 'kamctl ul show', but look at the value stored in the database. I forgot to mention that I generated the output of bad.txt yesterday, on March 22, 2013. The `expires` and `last_modified` fields in the database show March 5, 2013---nearly 20 days earlier.
One thing I noticed is the Call-ID is different in the DB vs. in-memory. Kamailio is sending SQL update queries with the where clause matching on three fields: username, contact, and callid. Since kamailio has a different Call-ID in memory, the row is never matched when it tries to update.
----------
One or more files have been attached.
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=278#comment794
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#243 - Internal timer lags real time by the startup time
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=243
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#276 - Problem with SUBSCRIBE presence status on WEBSOCKET protocol
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Not a bug
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=276
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#277 - Added Record Route Header incorrect when Request-URI contains a SIPS URI
User who did this - Daniel-Constantin Mierla (miconda)
----------
Can you test the master branch with the patch from commit:
* http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1826a5f…
If works fine, I will backport.
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=277#comment793
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.