THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#226 - Kamailio looses track of location entries
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=226
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#226 - Kamailio looses track of location entries
User who did this - Daniel-Constantin Mierla (miconda)
----------
I just committed a patch that uses affected_rows() to detect if UPDATE was successful, if not, it does an INSERT. See commit GIT#4b68b3ca0aef58f21e46f06944fa31391ef22fe5
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=226#comment659
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#41 - kamailio registrar module / usrloc should be able to recover from temporary data loss
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=41
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#41 - kamailio registrar module / usrloc should be able to recover from temporary data loss
User who did this - Daniel-Constantin Mierla (miconda)
----------
I just committed a patch that uses affected_rows() to detect if UPDATE was successful, if not, it does an INSERT. See commit GIT#4b68b3ca0aef58f21e46f06944fa31391ef22fe5
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=41#comment658
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.
Module: sip-router
Branch: master
Commit: 4b68b3ca0aef58f21e46f06944fa31391ef22fe5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4b68b3c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu May 31 19:15:52 2012 +0200
usrloc(k): option to check if contact DB UPDATE was successful
- use DB API affected_rows() when available to detect if the DB UPDATE
operation for a contact was successful, if not, do an INSERT instead
- behaviour controlled by parameter db_check_update, default is 0 (no
check for affected rows and no insert -- backward compatible)
- closes items FS#41 and FS#226
---
modules_k/usrloc/README | 31 +++++++++++++++++++++++++------
modules_k/usrloc/doc/usrloc_admin.xml | 24 ++++++++++++++++++++++++
modules_k/usrloc/ucontact.c | 9 +++++++++
modules_k/usrloc/ul_mod.c | 2 ++
modules_k/usrloc/ul_mod.h | 1 +
5 files changed, 61 insertions(+), 6 deletions(-)
diff --git a/modules_k/usrloc/README b/modules_k/usrloc/README
index 06094af..9b9cc51 100644
--- a/modules_k/usrloc/README
+++ b/modules_k/usrloc/README
@@ -64,7 +64,8 @@ Bogdan-Andrei Iancu
3.26. hash_size (integer)
3.27. preload (string)
3.28. db_update_as_insert (string)
- 3.29. timer_procs (string)
+ 3.29. db_check_update (string)
+ 3.30. timer_procs (string)
4. Functions
5. MI Commands
@@ -137,7 +138,8 @@ Bogdan-Andrei Iancu
1.26. Set hash_size parameter
1.27. Set preload parameter
1.28. Set db_update_as_insert parameter
- 1.29. Set timer_procs parameter
+ 1.29. Set db_check_update parameter
+ 1.30. Set timer_procs parameter
Chapter 1. Admin Guide
@@ -182,7 +184,8 @@ Chapter 1. Admin Guide
3.26. hash_size (integer)
3.27. preload (string)
3.28. db_update_as_insert (string)
- 3.29. timer_procs (string)
+ 3.29. db_check_update (string)
+ 3.30. timer_procs (string)
4. Functions
5. MI Commands
@@ -287,7 +290,8 @@ Chapter 1. Admin Guide
3.26. hash_size (integer)
3.27. preload (string)
3.28. db_update_as_insert (string)
- 3.29. timer_procs (string)
+ 3.29. db_check_update (string)
+ 3.30. timer_procs (string)
3.1. nat_bflag (integer)
@@ -667,7 +671,22 @@ modparam("usrloc", "preload", "location")
modparam("usrloc", "db_update_as_insert", 1)
...
-3.29. timer_procs (string)
+3.29. db_check_update (string)
+
+ Set this parameter to 1 if you want to do DB INSERT if the number of
+ affected rows by contact DB UPDATE operation is 0. The database module
+ driver has to implement affected_rows() DB API function, otherwise this
+ parameter is ignored - e.g., MySQL and Postgres DB connectors offer
+ affected_rows().
+
+ Default value is "0" (no DB INSERT).
+
+ Example 1.29. Set db_check_update parameter
+...
+modparam("usrloc", "db_check_update", 1)
+...
+
+3.30. timer_procs (string)
Number of timer processes to be started by module. Timer processes take
care of checking expired records and syncronization with database. If
@@ -676,7 +695,7 @@ modparam("usrloc", "db_update_as_insert", 1)
Default value is "0".
- Example 1.29. Set timer_procs parameter
+ Example 1.30. Set timer_procs parameter
...
modparam("usrloc", "timer_procs", 4)
...
diff --git a/modules_k/usrloc/doc/usrloc_admin.xml b/modules_k/usrloc/doc/usrloc_admin.xml
index 6624705..ddcf122 100644
--- a/modules_k/usrloc/doc/usrloc_admin.xml
+++ b/modules_k/usrloc/doc/usrloc_admin.xml
@@ -775,6 +775,30 @@ modparam("usrloc", "db_update_as_insert", 1)
</example>
</section>
+ <section id="db_check_update">
+ <title><varname>db_check_update</varname> (string)</title>
+ <para>
+ Set this parameter to 1 if you want to do DB INSERT if the number
+ of affected rows by contact DB UPDATE operation is 0. The
+ database module driver has to implement affected_rows() DB API
+ function, otherwise this parameter is ignored - e.g., MySQL and
+ Postgres DB connectors offer affected_rows().
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>0</quote> (no DB INSERT).
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>db_check_update</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("usrloc", "db_check_update", 1)
+...
+</programlisting>
+ </example>
+ </section>
+
<section id="timer_procs">
<title><varname>timer_procs</varname> (string)</title>
<para>
diff --git a/modules_k/usrloc/ucontact.c b/modules_k/usrloc/ucontact.c
index 0f385bb..2d07a26 100644
--- a/modules_k/usrloc/ucontact.c
+++ b/modules_k/usrloc/ucontact.c
@@ -728,6 +728,15 @@ int db_update_ucontact(ucontact_t* _c)
return -1;
}
+ if (ul_db_check_update==1 && ul_dbf.affected_rows) {
+ /* supposed to be an UPDATE, but if affected rows is 0, then try
+ * to do an INSERT */
+ if(ul_dbf.affected_rows(ul_dbh)==0) {
+ LM_DBG("affected rows by UPDATE was 0, doing an INSERT\n");
+ return db_insert_ucontact(_c);
+ }
+ }
+
return 0;
}
diff --git a/modules_k/usrloc/ul_mod.c b/modules_k/usrloc/ul_mod.c
index ccd94e8..7cbf257 100644
--- a/modules_k/usrloc/ul_mod.c
+++ b/modules_k/usrloc/ul_mod.c
@@ -107,6 +107,7 @@ extern int bind_usrloc(usrloc_api_t* api);
extern int ul_locks_no;
int ul_db_update_as_insert = 0;
int ul_timer_procs = 0;
+int ul_db_check_update = 0;
/* sruid to get internal uid for mi/rpc commands */
sruid_t _ul_sruid;
@@ -194,6 +195,7 @@ static param_export_t params[] = {
{"preload", STR_PARAM|USE_FUNC_PARAM, (void*)ul_preload_param},
{"db_update_as_insert", INT_PARAM, &ul_db_update_as_insert},
{"timer_procs", INT_PARAM, &ul_timer_procs},
+ {"db_check_update", INT_PARAM, &ul_db_check_update},
{0, 0, 0}
};
diff --git a/modules_k/usrloc/ul_mod.h b/modules_k/usrloc/ul_mod.h
index d01e504..30b8885 100644
--- a/modules_k/usrloc/ul_mod.h
+++ b/modules_k/usrloc/ul_mod.h
@@ -73,6 +73,7 @@ extern int cseq_delay;
extern int ul_fetch_rows;
extern int ul_hash_size;
extern int ul_db_update_as_insert;
+extern int ul_db_check_update;
extern db1_con_t* ul_dbh; /* Database connection handle */
extern db_func_t ul_dbf;
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#215 - Kamailio 3.2.2 fails to compile due to references to curl/types.h
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
Additional comments about closing: Committed in master by GGIT#a79afc381447eb0fa84f4ff73b4470a1179945bb . If there are other places left, reopen and point them.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=215
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#199 - kamailio does not stop if debug >= 3
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Not a bug
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=199
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#199 - kamailio does not stop if debug >= 3
User who did this - Daniel-Constantin Mierla (miconda)
----------
There is a exit timeout parameter if you want to lower shut down time:
http://www.kamailio.org/wiki/cookbooks/devel/core?&#exit_timeout
Thanks for reporting back, I will close the issue.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=199#comment657
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#199 - kamailio does not stop if debug >= 3
User who did this - Rob Gagnon (rgagnon)
----------
While working on fetching the information requested, and copying portions of huge log files between commands, it seems now (because of the time it takes to find and copy the data between commands) that this "not stopping" issue I reported could be a non-issue. Here's why.
It appears it could just take an awful long time for kamailio to dump what it needs to dump to the logs when debug is 3 or more and it is told to stop.
When debug is 3 or more, and I issue "service kamailio stop", the issuance of the stop command takes approx. 5 seconds on the server I am using before the command prompt returns.
At this point a "ps -ef | grep kamailio" shows it to still be running. I believe this is just because the parent process has died, and all the children are busy logging their own demises.
It took another 20 seconds or so before no process with the name kamailio was running, at which time the opensips.log file was well over 10MB.
You should probably just close this ticket, and maybe a note could be put somewhere in the documentation to let people know that it can take a while for kamailio to fully shut down when debug is set high enough that all the malloc's and free's are logged while it is dying off.
If the logs are not needed when shutting down, then the work-around I use (putting debug to 1 before stop) might be a good suggestion.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=199#comment656
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.