<h3>Description</h3>
<p>It was discovered  that the function t_newtran() is causing a conflict with the transaction flags. When calling it before setting transaction flags, the flags are apparently lost, so for instance when using the ACC module, if the ACC flags are set after the t_newtran, these flags seems to get lost and no ACC entries are saved....<br>
Some discussion around the t_newtran usage was already held in the past and it seems the function is not needed anymore to help detecting retransmissions, given the t_precheck_trans() can do this job without having to have an early creation of the transaction.<br>
Not sure if the t_newtran is necessary in any other scenario, but if it is not I think it should be deprecated.</p>
<h3>Reproduction</h3>
<p>Create simple script which uses ACC and the setflag to save ACC entries in DB. Verify ACC records are being saved properly.<br>
Before calling the setflag(), add a call to t_newtran(). Make calls and check ACC records are not saved anymore.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code># kamailio -v
version: kamailio 5.2.2 (x86_64/linux) 67f967
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 67f967 
compiled on 11:40:41 Mar 11 2019 with gcc 4.8.5

</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code># cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)
# uname -a
Linux dev1-sbc-01 3.10.0-1062.1.1.el7.x86_64 #1 SMP Fri Sep 13 22:55:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2155?email_source=notifications&email_token=ABO7UZOQOUUXEDDNPW75VA3QV3WWBA5CNFSM4JSM2FH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H4Q764Q">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJ57LDZ6XISQ4GVKSTQV3WWBANCNFSM4JSM2FHQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZIZX6WOIRS2EHFSSU3QV3WWBA5CNFSM4JSM2FH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H4Q764Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2155?email_source=notifications\u0026email_token=ABO7UZOQOUUXEDDNPW75VA3QV3WWBA5CNFSM4JSM2FH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H4Q764Q",
"url": "https://github.com/kamailio/kamailio/issues/2155?email_source=notifications\u0026email_token=ABO7UZOQOUUXEDDNPW75VA3QV3WWBA5CNFSM4JSM2FH2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H4Q764Q",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>