Module: kamailio
Branch: 5.1
Commit: 933660b707b6b31272a3ca93cba67e3c2798b708
URL:
https://github.com/kamailio/kamailio/commit/933660b707b6b31272a3ca93cba67e3…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2018-07-11T11:48:42+02:00
usrloc: fix RPC ul.add optional received param value when unset
fix #1586
(cherry picked from commit 9ede3f273b4e478b875369da5b92ff963ee21573)
---
Modified: src/modules/usrloc/ul_rpc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/933660b707b6b31272a3ca93cba67e3…
Patch:
https://github.com/kamailio/kamailio/commit/933660b707b6b31272a3ca93cba67e3…
---
diff --git a/src/modules/usrloc/ul_rpc.c b/src/modules/usrloc/ul_rpc.c
index 1231d4fc8a..ead017a590 100644
--- a/src/modules/usrloc/ul_rpc.c
+++ b/src/modules/usrloc/ul_rpc.c
@@ -600,6 +600,7 @@ static void ul_rpc_add(rpc_t* rpc, void* ctx)
str aor = {0, 0};
str contact = {0, 0};
str path = {0, 0};
+ str received = {0, 0};
str socket = {0, 0};
str temp = {0, 0};
double dtemp;
@@ -612,7 +613,7 @@ static void ul_rpc_add(rpc_t* rpc, void* ctx)
memset(&ci, 0, sizeof(ucontact_info_t));
ret = rpc->scan(ctx, "SSSdfSddd*SS", &table, &aor, &contact,
&ci.expires,
- &dtemp, &path, &ci.flags, &ci.cflags, &ci.methods,
&ci.received,
+ &dtemp, &path, &ci.flags, &ci.cflags, &ci.methods, &received,
&socket);
if (ret < 9) {
LM_ERR("not enough parameters - read so far: %d\n", ret);
@@ -626,9 +627,9 @@ static void ul_rpc_add(rpc_t* rpc, void* ctx)
}
if(ret>9) {
/* received parameter */
- if(!ul_rpc_is_param_set(&ci.received)) {
- ci.received.s = 0;
- ci.received.len = 0;
+ if(ul_rpc_is_param_set(&received)) {
+ ci.received.s = received.s;
+ ci.received.len = received.len;
}
}
if(ret>10) {