On 4/14/10 7:58 AM, Andrei Pelinescu-Onciul wrote:
On Apr 13, 2010 at 10:11, I??aki Baz
Castillo<ibc(a)aliax.net> wrote:
2010/4/13 Daniel-Constantin
Mierla<miconda(a)gmail.com>om>:
in 3.0 there are some extra functions that may
help figuring out the type of
timeout - t_branch_timeout() and t_branch_replied():
http://kamailio.org/docs/modules/stable/modules/tm.html#t_branch_timeout
It could be valid, yes:
failure_route[0]{
if (t_branch_timeout()){
if (t_branch_replied())
log("timeout after receiving a reply (no answer?)\n");
else
log("timeout, remote side seems to be down\n");
# ...
}
}
However I wonder if the description of the funcion is correct:
------------------
1.5.21. t_branch_replied()
Returns true if the failure route is executed for a branch that did
receive at least one reply in the past (the "current" reply is not
taken into account). It can be used only from the failure_route.
-------------------
What does is mean "Returns true if the failure route is executed for a
branch that ..."?
Perhaps it means "Returns true if the failure route is executed for a
winning branch that ..."?
Yes: returns true if the winning branch received at least one reply in
the past (winning branch == branch for each the failure route is
executed).
but if it is a 408 received, without any prior 1xx, t_branch_replied()
will be false, right?
Maybe a new function t_is_local_reply() would be good to return true if
it is a local generated (faked) reply or false for received reply.
Cheers,
Daniel
Andrei
P.S.: you might also want to check: t_any_replied(), t_any_timeout() and
t_grep_status() (other related new functions from a k< 3.0 point of view).
--
Daniel-Constantin Mierla *
http://www.asipto.com/ *
http://twitter.com/miconda *
http://www.linkedin.com/in/danielconstantinmierla