<div dir="ltr"><div><span style="font-family:verdana,sans-serif">I can not find the explanation on why the data memory is different once I return from the function.</span></div><div><span style="font-family:monospace"><span style="font-family:verdana,sans-serif">This is the same process and the same memory address.</span><br></span></div><div><span style="color:rgb(11,83,148)"><span style="font-family:monospace">  </span></span></div><div><span style="color:rgb(11,83,148)"><span style="font-family:monospace"></span></span></div><div><div><div><span style="font-family:monospace"><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">code :</span></span><br></span></div><div><br><span style="font-family:monospace"></span></div><div><span style="font-family:monospace">void get_rpl_totag(struct cell *t, struct sip_msg *reply, str *totag) {<br>        if (reply==FAKED_REPLY || !reply || !reply->to) {<br>                tmb.t_get_reply_totag(t->uas.request, totag);<br>        }<br>        if (totag && totag->s) {<br>                LM_ERR("reply_totag ok [%p][%d][%*.s]\n", totag->s, totag->len, totag->len, totag->s);<br>        }<br>}<br><br>str ttag = STR_NULL;<br>get_rpl_totag(t, reply, &ttag);<br>LM_ERR(">>> to-tag[%p][%d][%.*s]\n", acc_env.to_tag.s, acc_env.to_tag.len, acc_env.to_tag.len, acc_env.to_tag.s);</span><br><br><div><br></div><div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">outputs :</span></span></div><div><br></div><div><span style="font-family:monospace"> 0(25216) ERROR: acc [acc_logic.c:97]: get_rpl_totag(): reply_totag ok [0x7fa6a79d81e0][41][                                         ]<br> 0(25216) ERROR: acc [acc_logic.c:525]: on_missed(): >>>>>>>>>>> to-tag[0x7fa6a79d81e0][41][594d50c3218065a60bb91fd47a70fbc1-857d6855]<br></span></div><div><br></div><div><br></div><div><br></div><br><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 31, 2020 at 8:33 AM Julien Chavanton <<a href="mailto:jchavanton@gmail.com">jchavanton@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Seems to work, I will complete the modifications and make an MR ...<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 31, 2020 at 12:30 AM Julien Chavanton <<a href="mailto:jchavanton@gmail.com" target="_blank">jchavanton@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I can see TM API is exposing <br><br>tmb.t_get_reply_totag(msg, &to_tag);<br><br></div><div>looking at what can be done from acc_logic.c<br></div><div><br></div>on_missed<br><br>/* set env variables */<br>env_set_to( get_rpl_to(t,reply) );<br>env_set_code_status( code, reply);<br>...<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 30, 2020 at 11:51 PM Julien Chavanton <<a href="mailto:jchavanton@gmail.com" target="_blank">jchavanton@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><pre style="box-sizing:inherit;margin:4px 0px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;white-space:pre-wrap;word-break:normal;border-radius:4px;color:rgb(29,28,29);font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-family:verdana,sans-serif">Hi, considering this example :<br></span><br><br>modparam("acc_json", "acc_missed_flag", 6)<br><br>failure_route[test] {<br>    setflag(6); // MISSED_ACC, the failure will be recorded by ACC<br>    t_flush_flags(); // This will set the flags in the newly created transaction<br>    t_reply("500", "Service Unavailable");<br>}<br><br><span style="font-family:verdana,sans-serif">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.<br></span></pre><pre style="box-sizing:inherit;margin:4px 0px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;white-space:pre-wrap;word-break:normal;border-radius:4px;color:rgb(29,28,29);font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-family:verdana,sans-serif">I wonder if there is a way to populate the to-tag immediately ?<br><br></span></pre><pre style="box-sizing:inherit;margin:4px 0px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;white-space:pre-wrap;word-break:normal;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;border-radius:4px;color:rgb(29,28,29);font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-family:verdana,sans-serif">I will dig it further, but maybe there is a trick I am missing </span><br></pre></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>