mirror of https://github.com/sipwise/kamailio.git
"Use a tag based on the request direction, for an early
transaction record loading."
Important backport from the upstream which we lack in the 5.6.0
version of the kamailio, which is present in mr10.5 .
Without that UPDATE processing is still not working correctly
within an early stage of a dialog.
Change-Id: I61ba4251f395bf5e72aeab450b624cdfaaf9e06c
(cherry picked from commit 829ad5d76c)
mr10.5.1
parent
94a2ebf0c6
commit
cf44b014af
@ -0,0 +1,43 @@
|
||||
--- a/src/modules/topos_redis/topos_redis_storage.c
|
||||
+++ b/src/modules/topos_redis/topos_redis_storage.c
|
||||
@@ -54,6 +54,10 @@ static str _tps_redis_dprefix = str_init
|
||||
|
||||
static char _tps_redis_cbuf[TPS_REDIS_DATA_SIZE];
|
||||
|
||||
+static str _tps_redis_empty = str_init("");
|
||||
+
|
||||
+#define TPS_REDIS_STRZ(_s) ((_s).s)?(_s):(_tps_redis_empty)
|
||||
+
|
||||
/**
|
||||
* storage keys
|
||||
*/
|
||||
@@ -594,6 +598,7 @@ int tps_redis_load_initial_method_branch
|
||||
str skey = STR_NULL;
|
||||
str sval = STR_NULL;
|
||||
str xuuid = str_init("");
|
||||
+ str xtag = str_init("");
|
||||
str smethod = str_init("INVITE");
|
||||
|
||||
if(msg==NULL || md==NULL || sd==NULL)
|
||||
@@ -615,6 +620,12 @@ int tps_redis_load_initial_method_branch
|
||||
memset(argvlen, 0, TPS_REDIS_NR_KEYS * sizeof(size_t));
|
||||
argc = 0;
|
||||
|
||||
+ if(md->direction==TPS_DIR_DOWNSTREAM) {
|
||||
+ xtag = TPS_REDIS_STRZ(md->b_tag);
|
||||
+ } else {
|
||||
+ xtag = TPS_REDIS_STRZ(md->a_tag);
|
||||
+ }
|
||||
+
|
||||
if(md->a_uuid.len>1) {
|
||||
xuuid.s = md->a_uuid.s + 1;
|
||||
xuuid.len = md->a_uuid.len - 1;
|
||||
@@ -641,7 +652,7 @@ int tps_redis_load_initial_method_branch
|
||||
_tps_redis_bprefix.len, _tps_redis_bprefix.s,
|
||||
smethod.len, smethod.s,
|
||||
md->a_callid.len, md->a_callid.s,
|
||||
- md->b_tag.len, md->b_tag.s,
|
||||
+ xtag.len, xtag.s,
|
||||
xuuid.len, xuuid.s);
|
||||
if(rkey.len<0 || rkey.len>=TPS_REDIS_DATA_SIZE) {
|
||||
LM_ERR("error or insufficient buffer size: %d\n", rkey.len);
|
||||
Loading…
Reference in new issue