The network trace will help in this case. Seems that the reply coming
from GW has only one Via header, while all replies should have at least
2 Via headers if the request was not initiated by OpenSER.
Cheers,
Daniel
On 07/25/06 19:16, Klaus Darilion wrote:
forwarded to list
-------- Original Message --------
Subject: Re: [Users] newbie - have openser handle 302s
Date: Tue, 25 Jul 2006 08:48:38 -0700 (PDT)
From: Eliezer Ramm <lazerramm(a)yahoo.com>
To: Klaus Darilion <klaus.mailinglists(a)pernau.at>
Hi,
thanx for taking the time to answer.
the scenerio i have is like this
openser sends all numbers that are not registerd to it
to a special GW. the special GW then responds w/ a 302
redirect providing the correct route info for that
number. i need openser to take the info from the 302
and resend the invite to the address in the 302
(contatct field).
i am using a cfg from the uac_redirect sample to make
it as simple as possible.
w/ openser debug=7 i see the following :
6(22001) SIP Request:
6(22001) method: <INVITE>
6(22001) uri: <sip:2127896543@212.25.92.160>
6(22001) version: <SIP/2.0>
6(22001) parse_headers: flags=2
6(22001) Found param type 235, <rport> = <n/a>;
state=6
6(22001) Found param type 232, <branch> =
<z9hG4bK743485B539502E0CEF68B9C9AD6C2DFD>; state=16
6(22001) end of header reached, state=5
6(22001) parse_headers: Via found, flags=2
6(22001) parse_headers: this is the first via
6(22001) After parse_msg...
6(22001) preparing to run routing scripts...
6(22001) grep_sock_info - checking if host==us: 13==9
&& [212.25.92.160] == [127.0.0.1]
6(22001) grep_sock_info - checking if port 6666
matches port 5060
6(22001) grep_sock_info - checking if host==us:
13==13 && [212.25.92.160] == [212.25.92.160]
6(22001) grep_sock_info - checking if port 6666
matches port 5060
6(22001) grep_sock_info - checking if host==us: 13==9
&& [212.25.92.160] == [127.0.0.1]
6(22001) grep_sock_info - checking if port 6666
matches port 5060
6(22001) grep_sock_info - checking if host==us:
13==13 && [212.25.92.160] == [212.25.92.160]
6(22001) grep_sock_info - checking if port 6666
matches port 5060
6(22001) lookup(): '2127896543' Not found in usrloc
6(22001) DEBUG: t_newtran: msg id=1 , global msg id=0
, T on entrance=0xffffffff
6(22001) parse_headers: flags=ffffffffffffffff
6(22001) DEBUG:parse_to:end of header reached,
state=9
6(22001) DEBUG: get_hdr_field: <To> [32];
uri=[sip:2127896543@212.25.92.160]
6(22001) DEBUG: to body
[<sip:2127896543@212.25.92.160>
]
6(22001) get_hdr_field: cseq <CSeq>: <39892> <INVITE>
6(22001) DEBUG: get_hdr_body : content_length=293
6(22001) found end of header
6(22001) parse_headers: flags=78
6(22001) t_lookup_request: start searching:
hash=12315, isACK=0
6(22001) DEBUG: RFC3261 transaction matching failed
6(22001) DEBUG: t_lookup_request: no transaction
found
6(22001) DEBUG: add_param: tag=1071031469
6(22001) DEBUG:parse_to:end of header reached,
state=29
6(22001) DEBUG:tm:t_relay: new INVITE
6(22001) parse_headers: flags=ffffffffffffffff
6(22001) check_via_address(172.16.100.101,
172.16.100.101, 0)
6(22001) WARNING:vqm_resize: resize(0) called
6(22001) DEBUG:tm:_reply_light: reply sent out.
buf=0x8109f18: SIP/2.0 1..., shmem=0xb57725e0: SIP/2.0
1
6(22001) DEBUG:tm:_reply_light: finished
6(22001) DEBUG: mk_proxy: doing DNS lookup...
6(22001) check_via_address(172.16.100.101,
172.16.100.101, 0)
6(22001) DEBUG: add_to_tail_of_timer[4]: 0xb577133c
6(22001) DEBUG: add_to_tail_of_timer[0]: 0xb577134c
6(22001) SER: new transaction fwd'ed
6(22001) DEBUG:destroy_avp_list: destroying list
(nil)
6(22001) receive_msg: cleaning up
7(22002) SIP Reply (status):
7(22002) version: <SIP/2.0>
7(22002) status: <302>
7(22002) reason: <redirect>
7(22002) parse_headers: flags=2
7(22002) get_hdr_field: cseq <CSeq>: <39892> <INVITE>
7(22002) DEBUG: add_param: tag=1
7(22002) DEBUG:parse_to:end of header reached,
state=29
7(22002) DEBUG: get_hdr_field: <To> [38];
uri=[sip:2127896543@212.25.92.160]
7(22002) DEBUG: to body
[<sip:2127896543@212.25.92.160>]
7(22002) Found param type 235, <rport> = <5060>;
state=6
7(22002) Found param type 232, <branch> =
<z9hG4bK743485B539502E0CEF68B9C9AD6C2DFD>; state=6
7(22002) Found param type 235, <rport> = <6666>;
state=6
7(22002) Found param type 234, <received> =
<212.25.92.160>; state=16
7(22002) end of header reached, state=5
7(22002) parse_headers: Via found, flags=2
7(22002) parse_headers: this is the first via
7(22002) After parse_msg...
7(22002) forward_reply: found module tm, passing
reply to it
7(22002) DEBUG: t_check: msg id=1 global id=0 T
start=0xffffffff
7(22002) parse_headers: flags=22
7(22002) parse_headers: flags=8
7(22002) DEBUG: t_reply_matching: failure to match a
transaction
7(22002) DEBUG: t_check: msg id=1 global id=1 T
end=(nil)
7(22002) parse_headers: flags=4
7(22002) DEBUG: get_hdr_body : content_length=0
7(22002) found end of header
7(22002) ERROR: forward_reply: no 2nd via found in
reply
7(22002) DEBUG:destroy_avp_list: destroying list
(nil)
7(22002) receive_msg: cleaning up
10(22005) DEBUG: timer routine:4,tl=0xb577133c
next=(nil)
10(22005) DEBUG: retransmission_handler : request
resending (t=0xb5771220, INVITE si ... )
10(22005) DEBUG: add_to_tail_of_timer[5]: 0xb577133c
10(22005) DEBUG: retransmission_handler : done
8(22003) SIP Reply (status):
the cfg is as follows:
route{
if (uri==myself) {
if (method=="REGISTER") {
save("location");
exit;
};
if (!lookup("location")) {
# sl_send_reply("404", "Not
Found");
# forward( 212.25.94.16, 7777);
rewritehostport ("212.25.94.16:7777");
t_relay();
exit;
};
}
else {
# just do redirect
t_on_failure("1");
}
if (!t_relay()) {
sl_reply_error();
};
}
failure_route[1] {
get_redirects("*");
t_relay();
}
thanx again for your time.
eliezer
--- Klaus Darilion <klaus.mailinglists(a)pernau.at>
wrote:
Take a look at the README of the uac_redirect
module
http://openser.org/docs/
regards
klaus
Eliezer Ramm wrote:
Hi,
> i have a proxy that sends a 302 to my openser.
> what do i need to do to have the openser ack the
302
and send a new invite to the address recieved in
the
302 ? where would i insert it in my cfg file ?
thanx !!
# ------------------ module loading
----------------------------------
# Uncomment this if you want to use SQL database
#loadmodule "/usr/lib/openser/modules/mysql.so"
> loadmodule
"/usr/local/openser-1.0.1/modules/sl/sl.so"
loadmodule
"/usr/local/openser-1.0.1/modules/tm/tm.so"
loadmodule
"/usr/local/openser-1.0.1/modules/rr/rr.so"
loadmodule
>
"/usr/local/openser-1.0.1/modules/maxfwd/maxfwd.so"
loadmodule
>
"/usr/local/openser-1.0.1/modules/usrloc/usrloc.so"
loadmodule
>
"/usr/local/openser-1.0.1/modules/registrar/registrar.so"
"/usr/local/openser-1.0.1/modules/textops/textops.so"
> > loadmodule
> > "/usr/local/openser-1.0.1/modules/enum/enum.so"
> > loadmodule
> > "/usr/local/openser-1.0.1/modules/xlog/xlog.so"
"/usr/local/openser-1.0.1/modules/uac_redirect/uac_redirect.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
#loadmodule "/usr/lib/openser/modules/auth.so"
#loadmodule "/usr/lib/openser/modules/auth_db.so"
> # ----------------- setting module-specific
parameters
---------------
modparam("usrloc", "db_mode", 0)
modparam("rr", "enable_full_lr", 1)
route {
> #
------------------------------------------------------------------------
------------------------------------------------------------------------
> > if
(!mf_process_maxfwd_header("10")) {
sl_send_reply("483",
"Too Many Hops");
exit;
};
> > if (msg:len > max_len) {
sl_send_reply("513", "Message Overflow");
exit;
};
#
------------------------------------------------------------------------
------------------------------------------------------------------------
> > if (method!="REGISTER") {
> > record_route();
> > };
------------------------------------------------------------------------
------------------------------------------------------------------------
if
(loose_route()) {
route(1);
exit;
};
#
------------------------------------------------------------------------
# Call
Type Processing Section
#
------------------------------------------------------------------------
> if (uri!=myself) {
route(1);
exit;
};
#
if (method=="ACK") {
route(1);
exit;
}
if (method=="REGISTER") {
route(2);
exit;
};
> > lookup("aliases");
if (uri!=myself) {
route(1);
exit;
};
> if (!lookup("location")) {
#sl_send_reply("404", "User Not Found");
forward( 10.10.10.10, 5060);
exit;
};
route(1);
}
route[1] {
#
------------------------------------------------------------------------
#
Default Message Handler
#
------------------------------------------------------------------------
if
(!t_relay()) {
sl_reply_error();
};
}
route[2] {
#
------------------------------------------------------------------------
------------------------------------------------------------------------
# simple
no-auth registration
if (save("location")) {
sl_send_reply("200","OK");
};
if (!save("location")) {
sl_reply_error();
};
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
protection around >
http://mail.yahoo.com > >
_______________________________________________
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users