Module: kamailio
Branch: master
Commit: 8dfc0f6ef0ddc4bf2d73d21124caa289d4b8ce07
URL:
https://github.com/kamailio/kamailio/commit/8dfc0f6ef0ddc4bf2d73d21124caa28…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-09-30T12:34:40+02:00
rr: reset param buffer for r-r advertised address
- GH #2486
---
Modified: src/modules/rr/record.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8dfc0f6ef0ddc4bf2d73d21124caa28…
Patch:
https://github.com/kamailio/kamailio/commit/8dfc0f6ef0ddc4bf2d73d21124caa28…
---
diff --git a/src/modules/rr/record.c b/src/modules/rr/record.c
index 0b74356905..df3caf4a8d 100644
--- a/src/modules/rr/record.c
+++ b/src/modules/rr/record.c
@@ -549,6 +549,11 @@ int record_route_preset(struct sip_msg* _m, str* _data)
from = get_from(_m);
}
+ if (rr_param_buf.len && rr_param_msg!=_m->id) {
+ /* rr_params were set for a different message -> reset buffer */
+ rr_param_buf.len = 0;
+ }
+
l = anchor_lump(_m, _m->headers->name.s - _m->buf, 0, HDR_RECORDROUTE_T);
if (!l) {
LM_ERR("failed to create lump anchor\n");
@@ -812,6 +817,11 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data)
tag = 0;
}
+ if (rr_param_buf.len && rr_param_msg!=_m->id) {
+ /* rr_params were set for a different message -> reset buffer */
+ rr_param_buf.len = 0;
+ }
+
if(rr_ignore_sips==0) {
sips = rr_is_sips(_m);
}