I'm trying to play around with the current cvs head but can't get it to
work. I wonder if somebody could give me a hint!
I built a redirect server:
It basically does:
rewritehost("ab5350.node-1.com");
sl_send_reply("302", "Redirect");
I forward to the redirect server setting up a failure block:
if(is_method("INVITE"))
{
_QLOG(L_INFO, OUTBOUNDCALL, OUT);
t_on_failure("3");
record_route();
setflag(1);
setflag(2);
rewritehostport(_QSTR
(REDIRECTOBGATEWAYIP:REDIRECTOBGATEWAYPORT));
if(!t_relay())
{
sl_reply_error();
}
}
The response below comes back from my redirect server:
SIP/2.0 302 Redirect
Via: SIP/2.0/UDP 12.46.104.47;branch=z9hG4bKa86.09801851.0
Via: SIP/2.0/UDP 12.46.104.62:5061;branch=z9hG4bKa86.191c2c81.0
Via: SIP/2.0/UDP 12.46.104.59;branch=z9hG4bKa86.dafc0771.0
Via: SIP/2.0/UDP 71.252.176.37:5060;branch=z9hG4bK-d0702751
From: +19722200434 <sip:+19722200434@var-2.com>;tag=3a553a2b9373c699
To: <sip:2143357976@var-2.com>;tag=5531b0101f56e37a4889ece4b0eb40fa.417f
Call-ID: f27483a5-50532031(a)71.252.176.37
CSeq: 101 INVITE
Contact: sip:+12143357976@ab5350.node-1.com:5060
Content-Length: 0
My failure_route block picks up the routing:
failure_route[3]
{
_QLOG(L_WARN, FAILUREROUTE, here we are);
if(status =~ "3[0-9][0-9]")
{
_QLOG(L_WARN, FAILUREROUTE, status is 3xx);
get_redirects("*");
serialize_branches(0);
}
if(next_branches())
{
_QLOG(L_WARN, FAILUREROUTE, next branch);
t_on_failure("3");
t_relay();
}
_QLOG(L_WARN, FAILUREROUTE, no branches left);
if(!t_reply("404", "Not Found"))
{
_QLOG(L_WARN, FAILUREROUTE, Error);
}
}
My syslog shows QLOG messages.
I see the 'status is 3xx' message, which shows the
next command to be get_redirects("*");
The next output I see in my syslog is 'no branches left', which
indicates that the
serialize_branches(0) and next_branches() aren't working as I expected.
I've also tried getting rid of the serialize_branches and next_branches and just
doing a t_relay() after the get_redirects(), that doesn't work either.
Since I'm trying to simulate the redirect server, and the redirect
client, I'm sure I
got one of them wrong. Can somebody give me a hint?
Thanks!
-g
--
Greg Fausak
greg(a)thursday.com