On 10/02/2010 06:23 PM, Daniel-Constantin Mierla wrote:
On 10/2/10 4:40 PM, Iñaki Baz Castillo wrote:
Hi, I want to create a transaction prior to
performing some DB queries
or any other type of communication with external processes. I want to
create the transaction manually (t_newtrans) before invoking t_relay,
so if something blocks the request processing for a while, a
retransmission would not trigger all the DB queries again.
The problem is that changes to the transaction done after invoking
t_newtrans() are not saved within the transaction (this is: adding
headers, setting flags, AVP's....) which makes t_newtrans() function
really ugly and anti-user-friendly.
So my question is: couldn't t_relay() update transaction information
in case there are changes after calling t_newtrans()?
According to t_save_lumps()
doc, t_relay() should update transaction
with changes to headers:
http://kamailio.org/docs/modules/devel/modules/tm.html#t_save_lumps
Yes, the default setting is that the first t_relay() function call saves
the header modifications in shared memory. You do not need
t_save_lumps() unless you would like to force this earlier.
Regarding AVPs and flags, I do not think that you will have any problem,
the script still works on the global AVP list and global flags during
request processing.
Miklos
In <=v1.5.x, it was no save indeed, iirc.
Cheers,
Daniel