Re: [sr-dev] [kamailio/kamailio] modules/{acc, cdp}: allows big endian build (#1068)

2017-04-13 Thread Daniel-Constantin Mierla
auth_diameter had a different implementation than cdp. Maybe @ngvoice, 
@jaybeepee or @vingarzan can comment if cdp is safe for big endian.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1068#issuecomment-293804306___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 4.4.5 crash at receive_fd() (#1069)

2017-04-13 Thread Pepelux
Patch applied. I'm going to test it a few days and I'll send feedbacks

Thanks

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1069#issuecomment-294004285___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Kamailio 4.4.5 crash at receive_fd() (#1069)

2017-04-13 Thread Daniel-Constantin Mierla
Seems a bit similar with #1059 -- can you try with patch e4a11d7?

Also, what is executed in the event_route[dialog:end]? Are there operations 
that could take long time?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1069#issuecomment-293808652___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] How to cherry-pick from master to 4.4 since file paths have changed

2017-04-13 Thread Lucian Balaceanu

Hello,

Thank you, in the end I used the diff-tree way.

Have a nice day,
Lucian

On 13.04.2017 16:01, Daniel-Constantin Mierla wrote:

Hello,

in most of the cases it worked with 'cherry-pick -x' for me, latest git
versions seems to be smart and figure out the path change.

Otherwise I just get the patch as a diff from the commit with `git
diff-tree -p COMMITID` and apply it manually with 'patch'.

If there are better ways, I am keen to learn about as well.

Cheers,
Daniel


On 13.04.17 14:54, Lucian Balaceanu wrote:

Hi guys,

I would like to port my latest master commit to the 4.4 branch.
Since the path to the modules have changed I can no longer do a simple
`git cherry-pick -x ...`.

What is the accepted way to backport changes to 4.4? Maybe something
using the `git cherry-pick --strategy ...` ?

Thank you,
Lucian


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev



___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:349def6b: kazoo: add pua transaction lock type

2017-04-13 Thread lazedo
Module: kamailio
Branch: master
Commit: 349def6b129e63cdc46b88c502562c9e2543d421
URL: 
https://github.com/kamailio/kamailio/commit/349def6b129e63cdc46b88c502562c9e2543d421

Author: lazedo 
Committer: lazedo 
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/349def6b129e63cdc46b88c502562c9e2543d421.diff
Patch: 
https://github.com/kamailio/kamailio/commit/349def6b129e63cdc46b88c502562c9e2543d421.patch

---

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, _amqps_key.s},
 {"amqps_verify_peer", INT_PARAM, _amqps_verify_peer},
 {"amqps_verify_hostname", INT_PARAM, _amqps_verify_hostname},
+   {"pua_lock_type", INT_PARAM, _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;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:29aec680: kazoo: add consistent worker key

2017-04-13 Thread lazedo
Module: kamailio
Branch: master
Commit: 29aec6800099a3b1d7a2b2c7e6d4b3865f0bc6e6
URL: 
https://github.com/kamailio/kamailio/commit/29aec6800099a3b1d7a2b2c7e6d4b3865f0bc6e6

Author: lazedo 
Committer: lazedo 
Date: 2017-04-14T05:47:52+01:00

kazoo: add consistent worker key

---

Modified: src/modules/kazoo/kz_amqp.c
Modified: src/modules/kazoo/kz_amqp.h

---

Diff:  
https://github.com/kamailio/kamailio/commit/29aec6800099a3b1d7a2b2c7e6d4b3865f0bc6e6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/29aec6800099a3b1d7a2b2c7e6d4b3865f0bc6e6.patch

---

diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index f3a7c2c..d759490 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -384,6 +384,8 @@ void kz_amqp_free_bind(kz_amqp_bind_ptr bind)
kz_amqp_bytes_free(bind->event_key);
if(bind->event_subkey.bytes)
kz_amqp_bytes_free(bind->event_subkey);
+   if(bind->consistent_worker_key)
+   shm_free(bind->consistent_worker_key);
shm_free(bind);
 }
 
@@ -1771,6 +1773,7 @@ int kz_amqp_subscribe(struct sip_msg* msg, char* payload)
int no_ack = 1;
int federate = 0;
int consistent_worker = 0;
+   str* consistent_worker_key = NULL;
int wait_for_consumer_ack = 1;
kz_amqp_queue_ptr queue = NULL;
kz_amqp_exchange_ptr exchange = NULL;
@@ -1825,6 +1828,11 @@ int kz_amqp_subscribe(struct sip_msg* msg, char* payload)
consistent_worker = json_object_get_int(tmpObj);
}
 
+   tmpObj = kz_json_get_object(json_obj, "consistent-worker-key");
+   if(tmpObj != NULL) {
+   consistent_worker_key = 
kz_str_dup_from_char((char*)json_object_get_string(tmpObj));
+   }
+
tmpObj = kz_json_get_object(json_obj, "exchange-bindings");
if(tmpObj != NULL) {
exchange_binding = kz_amqp_exchange_binding_from_json(tmpObj);
@@ -1853,6 +1861,7 @@ int kz_amqp_subscribe(struct sip_msg* msg, char* payload)
bind->wait_for_consumer_ack = wait_for_consumer_ack;
bind->federate = federate;
bind->consistent_worker = consistent_worker;
+   bind->consistent_worker_key = consistent_worker_key;
 
 
kz_amqp_binding_ptr binding = shm_malloc(sizeof(kz_amqp_binding));
@@ -2866,6 +2875,8 @@ void kz_amqp_send_worker_event(kz_amqp_server_ptr 
server_ptr, amqp_envelope_t* e
 char buffer[100];
 kz_amqp_cmd_ptr cmd = NULL;
 kz_amqp_consumer_delivery_ptr ptr = NULL;
+json_obj_ptr json_obj = NULL;
+json_object* JObj = NULL;
 str* message_id = NULL;
 int idx = envelope->channel-1;
 int worker = 0;
@@ -2878,7 +2889,7 @@ void kz_amqp_send_worker_event(kz_amqp_server_ptr 
server_ptr, amqp_envelope_t* e
 }
 memset(json_data, 0, msg_size + 1);
 memcpy(json_data, (char*)envelope->message.body.bytes, msg_size);
-json_obj_ptr json_obj = kz_json_parse(json_data);
+json_obj = kz_json_parse(json_data);
 pkg_free(json_data);
 if (json_obj == NULL) {
LM_ERR("error parsing json body\n");
@@ -2888,7 +2899,7 @@ void kz_amqp_send_worker_event(kz_amqp_server_ptr 
server_ptr, amqp_envelope_t* e
 json_object_object_add(json_obj, BLF_JSON_BROKER_ZONE, 
json_object_new_string(server_ptr->zone->zone));
 
 
-json_object* JObj = kz_json_get_object(json_obj, BLF_JSON_SERVERID);
+JObj = kz_json_get_object(json_obj, BLF_JSON_SERVERID);
 if(JObj != NULL) {
 const char* _kz_server_id_str = json_object_get_string(JObj);
 sprintf(buffer, "consumer://%d/%s", _kz_server_id, _kz_server_id_str);
@@ -2932,8 +2943,14 @@ void kz_amqp_send_worker_event(kz_amqp_server_ptr 
server_ptr, amqp_envelope_t* e
 
 if(bind && bind->consistent_worker) {
 str rk;
-rk.s = (char*)envelope->routing_key.bytes;
-rk.len = (int)envelope->routing_key.len;
+   if(bind->consistent_worker_key != NULL &&
+   (JObj = kz_json_get_object(json_obj, 
bind->consistent_worker_key->s)) != NULL) {
+   rk.s = (char*)json_object_get_string(JObj);
+   rk.len = strlen(rk.s);
+   } else {
+   rk.s = (char*)envelope->routing_key.bytes;
+   rk.len = (int)envelope->routing_key.len;
+   }
 worker = core_hash(, NULL, dbk_consumer_workers);
 LM_DBG("computed worker for %.*s is %d\n", rk.len, rk.s, worker);
 } else {
diff --git a/src/modules/kazoo/kz_amqp.h b/src/modules/kazoo/kz_amqp.h
index c412156..b4a88ff 100644
--- a/src/modules/kazoo/kz_amqp.h
+++ b/src/modules/kazoo/kz_amqp.h
@@ -217,6 +217,7 @@ typedef struct {
amqp_boolean_t wait_for_consumer_ack;
amqp_boolean_t federate;
 amqp_boolean_t consistent_worker;
+str* consistent_worker_key;
 } kz_amqp_bind, *kz_amqp_bind_ptr;
 
 typedef struct {


___
Kamailio (SER) - Development 

[sr-dev] git:master:3cdcb8ae: p_usrloc: fix to update expires column when db_ops_ruid set

2017-04-13 Thread Lucian Balaceanu
Module: kamailio
Branch: master
Commit: 3cdcb8ae3783d7221d212df00769b495f88c740b
URL: 
https://github.com/kamailio/kamailio/commit/3cdcb8ae3783d7221d212df00769b495f88c740b

Author: Lucian Balaceanu 
Committer: Lucian Balaceanu 
Date: 2017-04-13T15:02:37+03:00

p_usrloc: fix to update expires column when db_ops_ruid set

---

Modified: src/modules/p_usrloc/ucontact.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3cdcb8ae3783d7221d212df00769b495f88c740b.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3cdcb8ae3783d7221d212df00769b495f88c740b.patch

---

diff --git a/src/modules/p_usrloc/ucontact.c b/src/modules/p_usrloc/ucontact.c
index 5bc5e09..75da91a 100644
--- a/src/modules/p_usrloc/ucontact.c
+++ b/src/modules/p_usrloc/ucontact.c
@@ -819,10 +819,10 @@ int db_update_ucontact_ruid(ucontact_t* _c)
vals2[n2].val.str_val = _c->c;
n2++;
 
-   keys2[n2] = _col;
-   vals2[n2].type = DB1_STR;
+   keys2[n2] = _col;
+   vals2[n2].type = DB1_DATETIME;
vals2[n2].nul = 0;
-   vals2[n2].val.str_val = _c->callid;
+   vals2[n2].val.time_val = _c->expires;
n2++;
 
keys2[n2] = _col;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] How to cherry-pick from master to 4.4 since file paths have changed

2017-04-13 Thread Daniel-Constantin Mierla
Hello,

in most of the cases it worked with 'cherry-pick -x' for me, latest git
versions seems to be smart and figure out the path change.

Otherwise I just get the patch as a diff from the commit with `git
diff-tree -p COMMITID` and apply it manually with 'patch'.

If there are better ways, I am keen to learn about as well.

Cheers,
Daniel


On 13.04.17 14:54, Lucian Balaceanu wrote:
> Hi guys,
>
> I would like to port my latest master commit to the 4.4 branch.
> Since the path to the modules have changed I can no longer do a simple
> `git cherry-pick -x ...`.
>
> What is the accepted way to backport changes to 4.4? Maybe something
> using the `git cherry-pick --strategy ...` ?
>
> Thank you,
> Lucian
>
>
> ___
> Kamailio (SER) - Development Mailing List
> sr-dev@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev