While testing xflags, i noticed that a regular flag that I set AFTER calling t_newtrans() stays set in onreply_route even when I do not call t_flush_flags().
In a route block:
if (!t_newtran()) { ERROR(Failed to create new transaction for $rm <$ru>); exit; }; if (!isflagset(19)) INFO(******** flag 19 is NOT set after t_newtran()); setflag(19);
and in onreply_route:
if (isflagset(19)) INFO(********* flag 19 is set); else INFO(********* flag 19 is NOT set);
Syslog gets:
Mar 25 11:24:41 trout /usr/bin/sip-proxy[21362]: INFO: ******** flag 19 is NOT set after t_newtran() Mar 25 11:24:41 trout /usr/bin/sip-proxy[21433]: INFO: ********* flag 19 is set
So what is the point of t_flush_flags()?
-- Juha
Juha Heinanen writes:
While testing xflags, i noticed that a regular flag that I set AFTER calling t_newtrans() stays set in onreply_route even when I do not call t_flush_flags().
I made the same test with xflags and they do require t_flush_xflags() call if an xflag is set after t_newtrans(); So the behavior is not the same with flags and xflags.
This is confusing. The flags should behave the same way and I would prefer the flags way in order to avoid the flush call.
I added sr-dev to this thread since it now deals also the new feature.
-- Juha
On 27.03.18 07:40, Juha Heinanen wrote:
Juha Heinanen writes:
While testing xflags, i noticed that a regular flag that I set AFTER calling t_newtrans() stays set in onreply_route even when I do not call t_flush_flags().
I made the same test with xflags and they do require t_flush_xflags() call if an xflag is set after t_newtrans(); So the behavior is not the same with flags and xflags.
This is confusing. The flags should behave the same way and I would prefer the flags way in order to avoid the flush call.
I added sr-dev to this thread since it now deals also the new feature.
Afaik, flags after t_newtran() were supposed not to be moved to transaction if t_flush_flags(), that being the purpose of the later function. Are you doing any other tm operations between creating the new transaction and relaying the request or end of script execution?
Cheers, Daniel
Daniel-Constantin Mierla writes:
Afaik, flags after t_newtran() were supposed not to be moved to transaction if t_flush_flags(), that being the purpose of the later function. Are you doing any other tm operations between creating the new transaction and relaying the request or end of script execution?
After calling t_newtran() I arm failure and onreply routes and then call t_relay(). Flags set after t_newtran() are visible in both those routes without calling t_flush_flags(). Same should happen with xflags.
-- Juha