Hello,
there is no special operator for it, but you could use a regular
expression to match the first line, something like this:
if (search("^SIP/2\.0 4[0-9][0-9].*$")) {
# 4xx response
};
You will need to load textops.so module to enable this.
Note: the condition will match only requests generated by the callee --
i.e. requests that really have arrived over the network.
For example 4xx generated when fr_inv_timer hits and request is being
cancelled is generated locally and the condition will not match such a
response.
So you should do something like this:
if (search(^SIP/2\.0 4[0-9][0-9].*$")) {
# Negative response returned
} else {
# Request timed out
};
Note 2: I haven't tried this so it is without guarantee, let me know if
that works or not.
Jan.
On 12-05 11:28, Tirpák Miklós wrote:
Hi,
Is there any way to check the returned status code of the response in
"failure_route[1]"? Or how can i decide if the request timed out or
negative response returned?
I would like to use a backup SIP-ISDN gateway. So if the master fails i
would like to resend the requests to the backup. The reason of the negative
replay (or timeout) matters in this case.
Thanks,
Miklos
Jan Janak wrote:
On 08-05 09:51, Andrzej Radke wrote:
The request is not forwarded to another sip
address after specific time (
i.e. 10 s)
Isn't forwarded never.
Maybe something wrong with my configuration script ??
Could You look into my configuration file
http://lists.iptel.org/pipermail/serusers/2003-May/001276.html
I just tried and it worked. Attached find a simple configuration
file that I used. I set fr_inv_timer to 10s (default value is 120s)
and tried to call a user. If the user didn't pick up in 10s then the
original call was cancelled and another invite was sent to user 7271.
Jan.
------------------------------------------------------------------------
#
# $Id: ser.cfg,v 1.18 2003/05/06 16:19:15 janakj Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters ------------------------
debug=9 # debug level (cmd line: -dddddddddd)
fork=no
log_stderror=yes # (cmd line: -E)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
listen=195.37.78.191
loadmodule "./modules/tm/tm.so"
modparam("tm", "fr_inv_timer", 10)
route {
if (method=="INVITE") {
t_on_failure("1");
};
t_relay();
}
failure_route[1] {
log("!!!!!!!!!!!!!!! HIT\n");
revert_uri();
setuser("7271");
append_branch();
t_relay();
}
--
---------------------------------------------------------------------------
Miklos Tirpak
Computer and Automation Research Institute e-mail : mtirpak(a)sztaki.hu
of the Hungarian Academy of Sciences phone : (361) 279-6011
H-1132. Budapest, Victor Hugo u 18-22 fax : (361) 279-6021
_______________________________________________
Serusers mailing list
serusers(a)lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers