Module: kamailio
Branch: master
Commit: 42d90d3665256c3d38945193b0a14ad199221bc6
URL:
https://github.com/kamailio/kamailio/commit/42d90d3665256c3d38945193b0a14ad…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-08T13:19:17+02:00
rr: conditions adjustmets for append from tag in record route preset
---
Modified: src/modules/rr/record.c
Modified: src/modules/rr/rr_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/42d90d3665256c3d38945193b0a14ad…
Patch:
https://github.com/kamailio/kamailio/commit/42d90d3665256c3d38945193b0a14ad…
---
diff --git a/src/modules/rr/record.c b/src/modules/rr/record.c
index 083955803f..8624ee5e13 100644
--- a/src/modules/rr/record.c
+++ b/src/modules/rr/record.c
@@ -570,7 +570,7 @@ int record_route_preset(struct sip_msg* _m, str* _data)
hdr.len += user.len + 1; /* @ */
hdr.len += _data->len;
- if (append_fromtag && from->tag_value.len) {
+ if (append_fromtag && from && from->tag_value.len) {
hdr.len += RR_FROMTAG_LEN + from->tag_value.len;
}
@@ -612,7 +612,7 @@ int record_route_preset(struct sip_msg* _m, str* _data)
memcpy(p, _data->s, _data->len);
p += _data->len;
- if (append_fromtag && from->tag_value.len) {
+ if (append_fromtag && from && from->tag_value.len) {
memcpy(p, RR_FROMTAG, RR_FROMTAG_LEN);
p += RR_FROMTAG_LEN;
memcpy(p, from->tag_value.s, from->tag_value.len);
diff --git a/src/modules/rr/rr_mod.c b/src/modules/rr/rr_mod.c
index d9cfedfaf9..67828d5d2d 100644
--- a/src/modules/rr/rr_mod.c
+++ b/src/modules/rr/rr_mod.c
@@ -253,7 +253,6 @@ static int direction_fixup(void** param, int param_no)
return E_CFG;
}
if (param_no==1) {
- n = 0;
s = (char*) *param;
if ( strcasecmp(s,"downstream")==0 ) {
n = RR_FLOW_DOWNSTREAM;