I can see TM API is exposing

tmb.t_get_reply_totag(msg, &to_tag);

looking at what can be done from acc_logic.c

on_missed

/* set env variables */
env_set_to( get_rpl_to(t,reply) );
env_set_code_status( code, reply);
...

On Thu, Jul 30, 2020 at 11:51 PM Julien Chavanton <jchavanton@gmail.com> wrote:
Hi, considering this example :


modparam("acc_json", "acc_missed_flag", 6)

failure_route[test] {
setflag(6); // MISSED_ACC, the failure will be recorded by ACC
t_flush_flags(); // This will set the flags in the newly created transaction
t_reply("500", "Service Unavailable");
}

This does generate an ACC event, however the to-tag is not populated, my guess this is because the TM callback is done before the to-tag is generated.
I wonder if there is a way to populate the to-tag immediately ?

I will dig it further, but maybe there is a trick I am missing