Hi,
the problem seems to be in the pv_get_response function:

--- a/src/modules/ims_diameter_server/avp_helper.c
+++ b/src/modules/ims_diameter_server/avp_helper.c
 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_strval(msg, param, res, &responsejson);


where the msg->id is set to "1" when the request is sent while 
current_msg_id_repl is always set to zero.
I found a similar report here: 
https://github.com/kamailio/kamailio/issues/2035#issuecomment-1673511815

Daniel

________________________________
From: Grotti, Daniel via sr-users <sr-users@lists.kamailio.org>
Sent: Wednesday, December 11, 2024 4:53 PM
To: Henning Westerholt <h...@gilawa.com>; Kamailio (SER) - Users Mailing List 
<sr-users@lists.kamailio.org>
Cc: Grotti, Daniel <daniel.gro...@hpe.com>
Subject: [SR-Users] Re: ims_diameter_server: $diameter_response PV is null in 
the event_route[diameter:response]

Hi,
looks like a bug indeed, I could not even print the other PV variables in the 
event_route, the kamailio is crashing.

I will have a look at the code, thanks.

Daniel


________________________________
From: Henning Westerholt <h...@gilawa.com>
Sent: Wednesday, December 11, 2024 4:48 PM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Cc: Grotti, Daniel <daniel.gro...@hpe.com>
Subject: RE: ims_diameter_server: $diameter_response PV is null in the 
event_route[diameter:response]


Hello Daniel,



might be a bug, I did not used this module recently.



I have looked quickly to the code, its rather straightforward. For a test, is 
the synchronous sending working maybe?



Cheers,



Henning



From: Grotti, Daniel <daniel.gro...@hpe.com>
Sent: Wednesday, December 11, 2024 4:31 PM
To: Henning Westerholt <h...@gilawa.com>; Kamailio (SER) - Users Mailing List 
<sr-users@lists.kamailio.org>
Subject: Re: ims_diameter_server: $diameter_response PV is null in the 
event_route[diameter:response]



Hi Henning,

yes I can see the ACR request sent out with wireshark as well as I can see the 
ACA response coming in from the offline charging server.

I see kamailo parsing the AVPs of the responses too, but when I print the PV, I 
get null value.



Daniel



________________________________

From: Henning Westerholt <h...@gilawa.com<mailto:h...@gilawa.com>>
Sent: Wednesday, December 11, 2024 4:18 PM
To: Kamailio (SER) - Users Mailing List 
<sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Cc: Grotti, Daniel <daniel.gro...@hpe.com<mailto:daniel.gro...@hpe.com>>
Subject: RE: ims_diameter_server: $diameter_response PV is null in the 
event_route[diameter:response]



Hello,



just to double check, you’ve setup the diameter “3” peer in your CDP 
configuration?

Do you see any diameter request created on the network level with tracing tools?



Cheers,



Henning



From: Grotti, Daniel via sr-users 
<sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Sent: Wednesday, December 11, 2024 12:58 PM
To: sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
Cc: Grotti, Daniel <daniel.gro...@hpe.com<mailto:daniel.gro...@hpe.com>>
Subject: [SR-Users] ims_diameter_server: $diameter_response PV is null in the 
event_route[diameter:response]



Hi list,

I'm using kamailio 5.8 and playing with the ims_diameter_server module, by 
sending an async diameter request and trying to catch the reponse.

Following the documentation, I'm sending the request with:



route[SEND_ACR]

{

      route(PREPARE_ACR);

      diameter_request_async("3", "271", "$var(json_acr)");

}

route[PREPARE_ACR]

{

      # here I build the AVP list in JSON

      $var(json_acr) = 
"[{"avpCode":277,"vendorId":0,"Flags":64,"int32":0},{...},{...}]";

}

event_route[diameter:response] {

      xlog("Reply to diameter request is: '$diameter_response'\n");

}





The ACR request is successfully sent and the the server is replying with ACA.

The list of AVP are properly parsed, but when I enter the event_route to print 
the response, I get the $diameter_response = 'null':





2024-12-11T10:52:39.192951872+00:00 stderr F 11(19) DEBUG: cdp [worker.c:374]: 
worker_process(): worker_process(): [2] got task Q(2/2)
2024-12-11T10:52:39.193026280+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP((nil) < 0x7ff827633810 
>0x7ff8276338c0);code=263,flags=40;
2024-12-11T10:52:39.193026280+00:00 stderr F DataType=1;VendorID=0;DataLen=52;
2024-12-11T10:52:39.193026280+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP(0x7ff827633810 < 0x7ff8276338c0 
>0x7ff827633970);code=268,flags=40;
2024-12-11T10:52:39.193026280+00:00 stderr F DataType=3;VendorID=0;DataLen=4;
2024-12-11T10:52:39.193026280+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP(0x7ff8276338c0 < 0x7ff827633970 
>0x7ff827633a20);code=264,flags=40;
2024-12-11T10:52:39.193026280+00:00 stderr F DataType=1;VendorID=0;DataLen=37;
2024-12-11T10:52:39.193026280+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP(0x7ff827633970 < 0x7ff827633a20 
>0x7ff8276340b0);code=296,flags=40;
2024-12-11T10:52:39.193026280+00:00 stderr F DataType=1;VendorID=0;DataLen=33;
2024-12-11T10:52:39.193124627+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP(0x7ff827633a20 < 0x7ff8276340b0 
>0x7ff827634160);code=259,flags=40;
2024-12-11T10:52:39.193124627+00:00 stderr F DataType=0;VendorID=0;DataLen=4;
2024-12-11T10:52:39.193286132+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP(0x7ff8276340b0 < 0x7ff827634160 
>0x7ff827634210);code=480,flags=40;
2024-12-11T10:52:39.193286132+00:00 stderr F DataType=0;VendorID=0;DataLen=4;
2024-12-11T10:52:39.193286132+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP(0x7ff827634160 < 0x7ff827634210 
>0x7ff8276342c0);code=485,flags=40;
2024-12-11T10:52:39.193286132+00:00 stderr F DataType=0;VendorID=0;DataLen=4;
2024-12-11T10:52:39.193286132+00:00 stderr F 11(19) DEBUG: ims_diameter_server 
[avp_helper.c:60]: avp2json(): AVP(0x7ff827634210 < 0x7ff8276342c0 
>(nil));code=85,flags=40;
2024-12-11T10:52:39.193286132+00:00 stderr F DataType=0;VendorID=0;DataLen=4;
2024-12-11T10:52:39.193612877+00:00 stderr F 11(19) INFO: <script>: 
[event_route]: Reply to diameter request is: '<null>'





Is there something I miss to set/configure?



Thanks,

Daniel









Daniel Grotti



Development Team Leader, Private 5G

daniel.gro...@hpe.com<mailto:daniel.gro...@hpe.com>

Hewlett Packard Enterprise

HPE.com
[cid:image001.png@01DB4BEB.F4681060]


__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- 
sr-users@lists.kamailio.org
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to