Module: kamailio
Branch: master
Commit: 7c365f76560b18aca49096121ea55791ce8f3623
URL: 
https://github.com/kamailio/kamailio/commit/7c365f76560b18aca49096121ea55791ce8f3623

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2024-12-14T13:44:13+01:00

ims_diameter_server: fix retrieval ``$diameter_response`` value

``current_msg_id_repl is only`` changed if ``$diameter_reponse``
is changed by via ``pv_set_response()``. The event_route is
executed with a ``fake_msg`` so it will not match if is setted
outside anyways.

---

Modified: src/modules/ims_diameter_server/avp_helper.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/7c365f76560b18aca49096121ea55791ce8f3623.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7c365f76560b18aca49096121ea55791ce8f3623.patch

---

diff --git a/src/modules/ims_diameter_server/avp_helper.c 
b/src/modules/ims_diameter_server/avp_helper.c
index 065a58c364d..7fa2ac66ce2 100644
--- a/src/modules/ims_diameter_server/avp_helper.c
+++ b/src/modules/ims_diameter_server/avp_helper.c
@@ -48,7 +48,6 @@
 
 // ID of current message
 static unsigned int current_msg_id = 0;
-static unsigned int current_msg_id_repl = 0;
 
 cJSON *avp2json(AAA_AVP *avp_t)
 {
@@ -488,7 +487,7 @@ int pv_get_application(struct sip_msg *msg, pv_param_t 
*param, pv_value_t *res)
 
 int pv_get_response(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 {
-       if((msg->id != current_msg_id_repl) || (responsejson.len < 0)) {
+       if(responsejson.len < 0) {
                return pv_get_null(msg, param, res);
        }
        return pv_get_strval(msg, param, res, &responsejson);
@@ -504,7 +503,6 @@ int pv_set_response(
                                val->rs.s);
                responsejson.s = val->rs.s;
                responsejson.len = val->rs.len;
-               current_msg_id_repl = msg->id;
                return 0;
        }
        return 0;

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to