Hi
I'm trying to change the lifetime timer on a KDMQ dialog message before handing it with dmq_handle_message();
if(has_body("application/json") && $fU == 'dialog') { if (jansson_get("lifetime", $rb, "$var(lifetime)")) { xlog("L_INFO", "$cfg(route): DIALOG JSON action: $var(action) state: $var(state) lifetime: $var(lifetime)\n"); $var(new_lifetime) = $var(lifetime) + 60; $var(newrb) = $rb; jansson_set("integer", "lifetime", $var(new_lifetime), "$var(newrb)"); xlog("L_INFO", "$cfg(route): DIALOG JSON NEW: $var(newrb)\n"); set_body("$var(newrb)","application/json"); msg_apply_changes(); } } dmq_handle_message(); exit;
The JSON string looks good after that manipulation, it contains the updated lifetime.
But dmq_handle_message() does not seem to get the body anymore. So I wonder what set_body() exactly does. Is it replacing the body or appending to it?
Is there a way to crank up debug output in the dialog and/or dmq module?
Mit freundlichen Grüssen
-Benoît Panizzon-
Is there a way to crank up debug output in the dialog and/or dmq module?
debug=3 is what I was looking for.
And that looks good:
DEBUG: dialog [dlg_dmq.c:142]: dlg_dmq_handle_msg(): body: {"action":2,"h_entry":3217,"h_id":4523,"state":4,"start_ts":1700748833,"lifetime":43265, ...
That is the updated lifetime...
DEBUG: dialog [dlg_dmq.c:160]: dlg_dmq_handle_msg(): found field: lifetime
so my altered lifetime is received on the DMQ peer. But why don't I see it inserted?
Mit freundlichen Grüssen
-Benoît Panizzon-