<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.16.3">
</HEAD>
<BODY>
Hi Bogdan,<BR>
<BR>
Here is a full trace, breakdown is like this<BR>
<BR>
.2 INVITES to .164<BR>
.164 INVITES TO .168<BR>
.168 sends a 302 to .164<BR>
.164 sends .2 a 503 followed by a 302<BR>
<BR>
.2 should never know about the 302 at all, but it's still getting back to the originating proxy.<BR>
<BR>
We are not using get_redirects() to do anything with the 302 - from some Googling and such it appears that might be needed, just not sure how it would be used.<BR>
<BR>
Thanks for looking at this.<BR>
<BR>
 69.xxx.xxx.2:5060 -&gt; 72.xxx.xxx.164:5060<BR>
INVITE sip:6021112222@72.xxx.xxx.164 SIP/2.0.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;branch=z9hG4bK03578afa;rport.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;.<BR>
Contact: &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 INVITE.<BR>
User-Agent: None.<BR>
Max-Forwards: 70.<BR>
Remote-Party-ID: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;privacy=off;screen=no.<BR>
Date: Tue, 24 Aug 2010 12:01:35 GMT.<BR>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.<BR>
Supported: replaces.<BR>
Content-Type: application/sdp.<BR>
Content-Length: 281.<BR>
.<BR>
v=0.<BR>
o=root 2921 2921 IN IP4 69.xxx.xxx.2.<BR>
s=session.<BR>
c=IN IP4 69.xxx.xxx.2.<BR>
t=0 0.<BR>
m=audio 12570 RTP/AVP 18 0 101.<BR>
a=rtpmap:18 G729/8000.<BR>
a=fmtp:18 annexb=no.<BR>
a=rtpmap:0 PCMU/8000.<BR>
a=rtpmap:101 telephone-event/8000.<BR>
a=fmtp:101 0-16.<BR>
a=silenceSupp:off - - - -.<BR>
a=ptime:20.<BR>
a=sendrecv.<BR>
<BR>
<BR>
U 72.xxx.xxx.164:5060 -&gt; 69.xxx.xxx.2:5060<BR>
SIP/2.0 100 Giving a try.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;branch=z9hG4bK03578afa;rport=5060.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 INVITE.<BR>
Server: OpenSIPS (1.6.2-notls (x86_64/freebsd)).<BR>
Content-Length: 0.<BR>
.<BR>
<BR>
<BR>
U 72.xxx.xxx.164:5060 -&gt; 72.xxx.xxx.168:5060<BR>
INVITE sip:6021112222@72.xxx.xxx.168 SIP/2.0.<BR>
Record-Route: &lt;<A HREF="sip:72.xxx.xxx.164">sip:72.xxx.xxx.164</A>;lr=on;ftag=as4f36ab60;did=36f.3f41d571&gt;.<BR>
Via: SIP/2.0/UDP 72.xxx.xxx.164;branch=z9hG4bK23ef.2faf83c4.0.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;received=69.xxx.xxx.2;branch=z9hG4bK03578afa;rport=5060.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;.<BR>
Contact: &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 INVITE.<BR>
User-Agent: None.<BR>
Max-Forwards: 69.<BR>
Remote-Party-ID: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;privacy=off;screen=no.<BR>
Date: Tue, 24 Aug 2010 12:01:35 GMT.<BR>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.<BR>
Supported: replaces.<BR>
Content-Type: application/sdp.<BR>
Content-Length: 281.<BR>
.<BR>
v=0.<BR>
o=root 2921 2921 IN IP4 69.xxx.xxx.2.<BR>
s=session.<BR>
c=IN IP4 69.xxx.xxx.2.<BR>
t=0 0.<BR>
m=audio 12570 RTP/AVP 18 0 101.<BR>
a=rtpmap:18 G729/8000.<BR>
a=fmtp:18 annexb=no.<BR>
a=rtpmap:0 PCMU/8000.<BR>
a=rtpmap:101 telephone-event/8000.<BR>
a=fmtp:101 0-16.<BR>
a=silenceSupp:off - - - -.<BR>
a=ptime:20.<BR>
a=sendrecv.<BR>
<BR>
<BR>
U 72.xxx.xxx.168:5060 -&gt; 72.xxx.xxx.164:5060<BR>
SIP/2.0 100 Giving a try.<BR>
Via: SIP/2.0/UDP 72.xxx.xxx.164;branch=z9hG4bK23ef.2faf83c4.0.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;received=69.xxx.xxx.2;branch=z9hG4bK03578afa;rport=5060.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 INVITE.<BR>
Server: OpenSIPS (1.6.2-notls (i386/freebsd)).<BR>
Content-Length: 0.<BR>
.<BR>
<BR>
<BR>
U 72.xxx.xxx.168:5060 -&gt; 72.xxx.xxx.164:5060<BR>
SIP/2.0 302 Moved Temporarily.<BR>
Via: SIP/2.0/UDP 72.xxx.xxx.164;branch=z9hG4bK23ef.2faf83c4.0.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;received=69.xxx.xxx.2;branch=z9hG4bK03578afa;rport=5060.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;;tag=1235203116.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 INVITE.<BR>
Content-Type: application/csv.<BR>
Contact: <A HREF="sip:rn">sip:rn</A>=6024810000;npdi;6021112222@72.xxx.xxx.168.<BR>
User-Agent: eXosip/3.1.0.<BR>
Content-Length: 0.<BR>
.<BR>
<BR>
<BR>
U 72.xxx.xxx.164:5060 -&gt; 72.xxx.xxx.168:5060<BR>
ACK sip:6021112222@72.xxx.xxx.168 SIP/2.0.<BR>
Via: SIP/2.0/UDP 72.xxx.xxx.164;branch=z9hG4bK23ef.2faf83c4.0.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;;tag=1235203116.<BR>
CSeq: 102 ACK.<BR>
Max-Forwards: 70.<BR>
User-Agent: OpenSIPS (1.6.2-notls (x86_64/freebsd)).<BR>
Content-Length: 0.<BR>
.<BR>
<BR>
<BR>
U 72.xxx.xxx.164:5060 -&gt; 69.xxx.xxx.2:5060<BR>
SIP/2.0 503 No more routes<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;branch=z9hG4bK03578afa;rport=5060.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;;tag=f254695ad980185f5ba46cc313375d56.4b85.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 INVITE.<BR>
Server: OpenSIPS (1.6.2-notls (x86_64/freebsd)).<BR>
Content-Length: 0.<BR>
.<BR>
<BR>
<BR>
U 72.xxx.xxx.164:5060 -&gt; 69.xxx.xxx.2:5060<BR>
SIP/2.0 302 Moved Temporarily.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;received=69.xxx.xxx.2;branch=z9hG4bK03578afa;rport=5060.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;;tag=1235203116.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 INVITE.<BR>
Content-Type: application/csv.<BR>
Contact: <A HREF="sip:rn">sip:rn</A>=6024810000;npdi;6021112222@72.xxx.xxx.168.<BR>
User-Agent: eXosip/3.1.0.<BR>
Content-Length: 0.<BR>
.<BR>
<BR>
<BR>
U 69.xxx.xxx.2:5060 -&gt; 72.xxx.xxx.164:5060<BR>
ACK sip:6021112222@72.xxx.xxx.164 SIP/2.0.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;branch=z9hG4bK03578afa;rport.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;;tag=f254695ad980185f5ba46cc313375d56.4b85.<BR>
Contact: &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 ACK.<BR>
User-Agent: None.<BR>
Max-Forwards: 70.<BR>
Remote-Party-ID: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;privacy=off;screen=no.<BR>
Content-Length: 0.<BR>
.<BR>
<BR>
<BR>
U 69.xxx.xxx.2:5060 -&gt; 72.xxx.xxx.164:5060<BR>
ACK sip:6021112222@72.xxx.xxx.164 SIP/2.0.<BR>
Via: SIP/2.0/UDP 69.xxx.xxx.2:5060;branch=z9hG4bK03578afa;rport.<BR>
From: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;tag=as4f36ab60.<BR>
To: &lt;<A HREF="sip:6021112222@72.xxx.xxx.164">sip:6021112222@72.xxx.xxx.164</A>&gt;;tag=1235203116.<BR>
Contact: &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;.<BR>
Call-ID: <A HREF="mailto:7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.">7b3d78d644ab1f7d52ced54236154da3@69.xxx.xxx.2.</A><BR>
CSeq: 102 ACK.<BR>
User-Agent: None.<BR>
Max-Forwards: 70.<BR>
Remote-Party-ID: &quot;Test&quot; &lt;<A HREF="sip:500@69.xxx.xxx.2">sip:500@69.xxx.xxx.2</A>&gt;;privacy=off;screen=no.<BR>
Content-Length: 0.<BR>
<BR>
On Tue, 2010-08-24 at 10:57 +0300, Bogdan-Andrei Iancu wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi Brad,</FONT>

<FONT COLOR="#000000">Maybe I do not fully understand your case, but opensips is not sending a </FONT>
<FONT COLOR="#000000">302 after 200 OK...Maybe you can post the call flow (a SIP trace) from </FONT>
<FONT COLOR="#000000">the SIP server showing the entire scenario.</FONT>

<FONT COLOR="#000000">Regards,</FONT>
<FONT COLOR="#000000">Bogdan</FONT>

<FONT COLOR="#000000">Brad Bendy wrote:</FONT>
<FONT COLOR="#000000">&gt; Hi,</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; Im having a heck of a time figuring this out:</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; INVITE comes to our switch, we send a INVITE to another proxy that </FONT>
<FONT COLOR="#000000">&gt; responds with a 302, we parse that 302 in failure route then use a </FONT>
<FONT COLOR="#000000">&gt; route() command to go to another route block which does some other </FONT>
<FONT COLOR="#000000">&gt; processing (will send out more INVITE's, do certain things on failure, </FONT>
<FONT COLOR="#000000">&gt; etc), if the original call does get canceled or completes successfully </FONT>
<FONT COLOR="#000000">&gt; with a 200 OK the originating proxy receives the original 302 request </FONT>
<FONT COLOR="#000000">&gt; plus what ever our final failure response code we want to send.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; The behavior does seem correct as openSIPs is just forwarding  the </FONT>
<FONT COLOR="#000000">&gt; 302, but in this case I want it to send only the final response code </FONT>
<FONT COLOR="#000000">&gt; back to the originating client.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; The initital route block which sends the INVITE to get the 302 is very </FONT>
<FONT COLOR="#000000">&gt; simple, we just write the rU and rd and send via t_relay, </FONT>
<FONT COLOR="#000000">&gt; onreply_route does a little parsing then failure_route sends to a new </FONT>
<FONT COLOR="#000000">&gt; block.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; Any help on this would be great, I think it's my logic in the switch </FONT>
<FONT COLOR="#000000">&gt; that is wrong somewhere.</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; Thanks!</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; ------------------------------------------------------------------------</FONT>
<FONT COLOR="#000000">&gt;</FONT>
<FONT COLOR="#000000">&gt; _______________________________________________</FONT>
<FONT COLOR="#000000">&gt; Users mailing list</FONT>
<FONT COLOR="#000000">&gt; <A HREF="mailto:Users@lists.opensips.org">Users@lists.opensips.org</A></FONT>
<FONT COLOR="#000000">&gt; <A HREF="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A></FONT>
<FONT COLOR="#000000">&gt;   </FONT>


</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Brad Bendy<BR>
Chief Technical Officer<BR>
<A HREF="mailto:brad.bendy@benganetworks.com">brad.bendy@benganetworks.com</A><BR>
<BR>
Benga Networks, LLC.<BR>
10115 E. Bell Rd, Ste. 107-451<BR>
Scottsdale, AZ 85260-2189<BR>
<BR>
Toll Free: &nbsp;&nbsp; 877-44-BENGA<BR>
Local:&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 480-970-5200<BR>
Cell:&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 602-550-4004<BR>
Fax:&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 866-852-4468
</TD>
</TR>
</TABLE>
</BODY>
</HTML>