Module: kamailio
Branch: master
Commit: 26d57116abc86e5d10bb1e5fe05c555e70e731c4
URL:
https://github.com/kamailio/kamailio/commit/26d57116abc86e5d10bb1e5fe05c555…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2023-11-22T18:26:10+01:00
sca: update rr if necessary for subscriptions
---
Modified: src/modules/sca/sca_subscribe.c
---
Diff:
https://github.com/kamailio/kamailio/commit/26d57116abc86e5d10bb1e5fe05c555…
Patch:
https://github.com/kamailio/kamailio/commit/26d57116abc86e5d10bb1e5fe05c555…
---
diff --git a/src/modules/sca/sca_subscribe.c b/src/modules/sca/sca_subscribe.c
index 6cdf33a6f74..6e9949a5d78 100644
--- a/src/modules/sca/sca_subscribe.c
+++ b/src/modules/sca/sca_subscribe.c
@@ -905,6 +905,17 @@ static int sca_subscription_update_unsafe(sca_mod *scam,
}
SCA_STR_COPY(&update_sub->rr, &saved_sub->rr);
+ } else if(!SCA_STR_EMPTY(&update_sub->rr)
+ && !STR_EQ(update_sub->rr, saved_sub->rr)) {
+ if(!SCA_STR_EMPTY(&saved_sub->rr)) {
+ shm_free(saved_sub->rr.s);
+ saved_sub->rr.len = 0;
+ }
+ if((saved_sub->rr.s = (char *)shm_malloc(update_sub->rr.len)) == NULL) {
+ SHM_MEM_ERROR;
+ goto done;
+ }
+ SCA_STR_COPY(&saved_sub->rr, &update_sub->rr);
}
rc = 1;