Module: kamailio
Branch: master
Commit: 349def6b129e63cdc46b88c502562c9e2543d421
URL:
https://github.com/kamailio/kamailio/commit/349def6b129e63cdc46b88c502562c9…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: lazedo <luis.azedo(a)factorlusitano.com>
Date: 2017-04-14T04:38:30+01:00
kazoo: add pua transaction lock type
---
Modified: src/modules/kazoo/kazoo.c
Modified: src/modules/kazoo/kz_pua.c
---
Diff:
https://github.com/kamailio/kamailio/commit/349def6b129e63cdc46b88c502562c9…
Patch:
https://github.com/kamailio/kamailio/commit/349def6b129e63cdc46b88c502562c9…
---
diff --git a/src/modules/kazoo/kazoo.c b/src/modules/kazoo/kazoo.c
index 5c81ad2..8574de6 100644
--- a/src/modules/kazoo/kazoo.c
+++ b/src/modules/kazoo/kazoo.c
@@ -88,6 +88,7 @@ int dbk_consumer_loop_count = 10;
int dbk_consumer_ack_loop_count = 20;
int dbk_include_entity = 1;
int dbk_pua_mode = 1;
+db_locking_t kz_pua_lock_type = DB_LOCKING_WRITE;
int dbk_use_hearbeats = 0;
int dbk_single_consumer_on_reconnect = 1;
int dbk_consume_messages_on_reconnect = 1;
@@ -197,6 +198,7 @@ static param_export_t params[] = {
{"amqps_key", STR_PARAM, &kz_amqps_key.s},
{"amqps_verify_peer", INT_PARAM, &kz_amqps_verify_peer},
{"amqps_verify_hostname", INT_PARAM, &kz_amqps_verify_hostname},
+ {"pua_lock_type", INT_PARAM, &kz_pua_lock_type},
{0, 0, 0}
};
diff --git a/src/modules/kazoo/kz_pua.c b/src/modules/kazoo/kz_pua.c
index 60b89dc..3c1e3cf 100644
--- a/src/modules/kazoo/kz_pua.c
+++ b/src/modules/kazoo/kz_pua.c
@@ -43,6 +43,7 @@ extern db1_con_t *kz_pa_db;
extern db_func_t kz_pa_dbf;
extern str kz_presentity_table;
+extern db_locking_t kz_pua_lock_type;
int kz_pua_update_presentity(str* event, str* realm, str* user, str* etag, str* sender,
str* body, int expires, int reset)
{
@@ -125,7 +126,7 @@ int kz_pua_update_presentity(str* event, str* realm, str* user, str*
etag, str*
if (kz_pa_dbf.start_transaction)
{
- if (kz_pa_dbf.start_transaction(kz_pa_db, DB_LOCKING_WRITE) < 0)
+ if (kz_pa_dbf.start_transaction(kz_pa_db, kz_pua_lock_type) < 0)
{
LM_ERR("in start_transaction\n");
goto error;