[Serusers] More detailed explanation of t_newtran needed.

Younger Wang wygmail at yeah.net
Thu Jun 19 00:55:00 CEST 2003

I am trying to understand how tm module works.

I found in http://www.iptel.org/ser/doc/prerelease/x545.html--->Stateful
User Agent Server:
t_newtran shields subsequent code from retransmissions. It returns success
and continues when a new request arrived. It exits current route block
immediately on receipt of a retransmissions.
I found in the README included in tm module:
Name: t_newtran
Params: 0
Desc: creates a new transaction, returns a negative value on
     error; this is the only way a script can add a new transaction
     in an atomic way; typically, it is used to deploy a UAS

I think the two explanations above are inconsistent. I am quite confused.
Take the scripts below for example:
if ( !t_newtran()) {

 # the following log will be only printed on receipt of
 # a new message; retranmissions are absorbed by t_newtran
 log(1, "New Transaction Arrived\n");
 if (uri=~"a@") {
  if (!t_reply("409", "Bizzar Error")) {
 } else {
  if (!t_reply("699", "I don't want to chat with you")) {

My understanding is: If t_newtran() returns successfully, the scripts will
not execute forward until a new message rather than retransmission of the
original message is received. Am I right? If wrong, how does it work


Younger Wang

More information about the sr-users mailing list