<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Brett,</div><div><br></div>I can't answer how it's *supposed* to work, but I can explain how I've made it work.<div><br></div><div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (t_check_status("302")) {</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(!get_redirects("*")) {</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;route(20); &nbsp; &nbsp; &nbsp;# No redirects, junk the call&nbsp;(send an error to the caller, other than 302)</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Brett, these two may be your key</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;serialize_branches(1);</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;next_branches();&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setbflag(3); &nbsp; &nbsp;# 302 in progress</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_on_failure("4"); &nbsp; &nbsp; &nbsp;# This failure_route</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_on_branch("1"); &nbsp; &nbsp; &nbsp;# Not sure why I need this, but it used to fail without I think</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;resetflag(1);</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;route(23); &nbsp; &nbsp; &nbsp;# Send request (some wrappers around a t_relay, nothing relevant to the 302)</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (isbflagset(3)) {</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (next_branches()) {</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_on_failure("4"); &nbsp;# This failure_route</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;resetflag(22);</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;route(23); &nbsp; &nbsp; &nbsp;# Send request</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;resetbflag(3); &nbsp;# The 302's over</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;setflag(22); &nbsp; &nbsp;# Make sure there's failure accounting</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;route(20); &nbsp; &nbsp; &nbsp;# Done trying, fail the call (send an error to the caller, other than 302)</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span></font></font></div><div><font class="Apple-style-span" face="Monaco"><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; }</span></font></font></div><div><br></div><div>This is some older config of mine. &nbsp;I haven't revisited it because it works, but I would imagine there are efficiency improvements to be had.</div><div><br></div><div><br></div><div>- Jeff</div><div><br></div><div><br></div><div><div>On Mar 24, 2010, at 10:41 PM, Brett Nemeroff wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello All,<div>I have a question about 302 redirects.Maybe I'm just misunderstanding how it's supposed to work..</div><div><br></div><div>I get the following redirect:</div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier">

</p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">SIP/2.0 302 Moved temporarily.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">Via:SIP/2.0/UDP 192.168.21.10;branch=z9hG4bK6cd5.ae1f6c43.0,SIP/2.0/UDP 10.10.10.11:5060;branch=z9hG4bK-a96e3-4baac9a7-8c685c67-5898d54b.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">From:&lt;<a href="http://sip:+5125551212@10.10.10.11:5060/">sip:+5125551212@10.10.10.11:5060</a>&gt;;tag=a9d5ed0-13c4-4baac9a7-8c685c67-19c2a61a.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">To:&lt;<a href="http://sip:15205551212@192.168.21.10:5060/">sip:15205551212@192.168.21.10:5060</a>&gt;;tag=100063687-1269483944267.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; "><a href="mailto:Call-ID%3ACXC-410-65762490-a9d5ed0-13c4-4baac9a7-8c685c67-17d5873c@10.10.10.11">Call-ID:CXC-410-65762490-a9d5ed0-13c4-4baac9a7-8c685c67-17d5873c@10.10.10.11</a>.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">CSeq:1 INVITE.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">Record-Route:&lt;<a href="sip:192.168.21.10;lr=on;did=f8d.623e93f6">sip:192.168.21.10;lr=on;did=f8d.623e93f6</a>&gt;.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">Contact:&lt;<a href="sip:5205551212@192.168.50.10:5060;user=phone">sip:5205551212@192.168.50.10:5060;user=phone</a>&gt;;q=0.5,&lt;<a href="sip:5205551212@192.168.30.10:5060;user=phone">sip:5205551212@192.168.30.10:5060;user=phone</a>&gt;;q=0.25.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">Content-Length:0.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">

And in my failure route I have:</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (t_check_status("302")) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">

&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get_redirects("*");</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t_relay();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 13px/normal Courier; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div><br></div><div>Now when I watch a sip trace, right after the 302, an INVITE fires off to BOTH 192.168.50.10 and 192.168.30.10 at the exact same time. The q values are different, shouldn't they be serial?</div>

<div><br></div><div>I'm not entirely sure how much "magic" is handled in the q-value and how much needs to be scripted.. But I was under the impression that this magic was "fully automatic"</div><div>

<br></div><div>Thanks!</div><div>-Brett</div><div><br></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div></div>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></blockquote></div><br></div></body></html>