I am trying to understand how tm module works.
I found in http://www.iptel.org/ser/doc/prerelease/x545.html---%3EStateful 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()) { sl_reply_error(); break; };
# 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")) { sl_reply_error(); }; } else { if (!t_reply("699", "I don't want to chat with you")) { sl_reply_error(); }; }; -------------------------------
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 actually?
Thanks!
Younger Wang
At 12:55 AM 6/19/2003, Younger Wang wrote:
I am trying to understand how tm module works.
I found in http://www.iptel.org/ser/doc/prerelease/x545.html---%3EStateful 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 don't think so.
I am quite confused. Take the scripts below for example: _______________________________ if ( !t_newtran()) { sl_reply_error(); break; };
# 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")) { sl_reply_error(); }; } else { if (!t_reply("699", "I don't want to chat with you")) { sl_reply_error(); }; };
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?
I don't know since I don't parse your message quite. If t_newtran returns successfuly, it indicates a new request which should be processed. It is an error otherwise. Retransmissions cause immediate leave of script processing.
-jiri
If wrong, how does it work actually?
Thanks!
Younger Wang
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/
Simplified code:
if(method=="INVITE") { t_newtran(); t_relay(); };
If the same INVITE is received twice, it will be processed only for one time. However if the same INVITE is sent three times, this INVITE will be processed when the second transmission is received. So I wonder, if the third transmission is received, the process will trap in t_newtran() and will never return until a timeout is reached?
Younger Wang
----- Original Message ----- From: "Jiri Kuthan" jiri@iptel.org To: "Younger Wang" wygmail@yeah.net; serusers@lists.iptel.org Sent: Wednesday, June 18, 2003 1:51 PM Subject: Re: [Serusers] More detailed explanation of t_newtran needed.
At 12:55 AM 6/19/2003, Younger Wang wrote:
I am trying to understand how tm module works.
I found in http://www.iptel.org/ser/doc/prerelease/x545.html---%3EStateful 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 don't think so.
I am quite confused. Take the scripts below for example: _______________________________ if ( !t_newtran()) { sl_reply_error(); break; };
# 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")) { sl_reply_error(); }; } else { if (!t_reply("699", "I don't want to chat with you")) { sl_reply_error(); }; };
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?
I don't know since I don't parse your message quite. If t_newtran returns successfuly, it indicates a new request which should be processed. It is an error otherwise. Retransmissions cause immediate leave of script
processing.
-jiri
If wrong, how does it work actually?
Thanks!
Younger Wang
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/
At 06:40 PM 6/19/2003, Younger Wang wrote:
Simplified code:
if(method=="INVITE") { t_newtran(); t_relay(); };
If the same INVITE is received twice, it will be processed only for one time. However if the same INVITE is sent three times, this INVITE will be processed when the second transmission is received.
Sure, when transaction state expires some day, a retransmission will be processed as a new request.
-jiri
So I wonder, if the third transmission is received, the process will trap in t_newtran() and will never return until a timeout is reached?
Younger Wang
----- Original Message ----- From: "Jiri Kuthan" jiri@iptel.org To: "Younger Wang" wygmail@yeah.net; serusers@lists.iptel.org Sent: Wednesday, June 18, 2003 1:51 PM Subject: Re: [Serusers] More detailed explanation of t_newtran needed.
At 12:55 AM 6/19/2003, Younger Wang wrote:
I am trying to understand how tm module works.
I found in http://www.iptel.org/ser/doc/prerelease/x545.html---%3EStateful 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 don't think so.
I am quite confused. Take the scripts below for example: _______________________________ if ( !t_newtran()) { sl_reply_error(); break; };
# 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")) { sl_reply_error(); }; } else { if (!t_reply("699", "I don't want to chat with you")) { sl_reply_error(); }; };
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?
I don't know since I don't parse your message quite. If t_newtran returns successfuly, it indicates a new request which should be processed. It is an error otherwise. Retransmissions cause immediate leave of script
processing.
-jiri
If wrong, how does it work actually?
Thanks!
Younger Wang
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/
-- Jiri Kuthan http://iptel.org/~jiri/
On Jun 18, 2003 at 15:55, Younger Wang wygmail@yeah.net wrote:
I am trying to understand how tm module works.
I found in http://www.iptel.org/ser/doc/prerelease/x545.html---%3EStateful 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()) { sl_reply_error(); break; };
There are 3 possible outcomes of t_newtran: - this is a new transaction => returns true - this is a retransmission => in script it forces a break (it does not return, it just stops script processing) - some error occured (e.g. bad via ) => returns false
The actual module function (the C one, not the script one) will return 1 in the first case, 0 in the second (a module function returning 0 forces a break/drop) and a value <0 in the third case (which is equivalent to false in the script).
Andrei