<HTML dir=ltr><HEAD><TITLE>Re: [OpenSIPS-Users] UAC_REDIRECT : get_redirects does not rewrite host</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6001.18148" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText62042 dir=ltr>
<DIV dir=ltr><FONT face=Verdana color=#000000 size=2>Hi Bogdan, </FONT></DIV>
<DIV dir=ltr><FONT face=Verdana size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Verdana color=#000000 size=2>version: opensips 1.5.1-notls (x86_64/linux) </FONT></DIV>
<DIV dir=ltr><FONT face=Verdana size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Verdana size=2>failure_route[1] {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sip_trace();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (t_check_status("302")) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "***FAILURE ROUTE - REDIRECT ru[$ru]**\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get_redirects("6:2","redirect");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("L_NOTICE", "***FAILURE ROUTE - REDIRECTED TO: $ru]**\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_relay();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV dir=ltr><FONT face=Verdana size=2>}</FONT></DIV>
<DIV dir=ltr><FONT face=Verdana size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Verdana size=2>Aug 13 18:44:17 osip /usr/local/sbin/opensips[16565]: ***FAILURE ROUTE - REDIRECT ru[sip:777@10.0.1.73:57226;rinstance=c699f35c276783d3]** <BR>Aug 13 18:44:17 osip /usr/local/sbin/opensips[16565]: ***FAILURE ROUTE - REDIRECTED TO: ru[sip:new_target@10.0.1.73:57226]**</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> users-bounces@lists.opensips.org on behalf of Bogdan-Andrei Iancu<BR><B>Sent:</B> Thu 13/08/2009 6:29 PM<BR><B>To:</B> OpenSIPS users mailling list<BR><B>Subject:</B> Re: [OpenSIPS-Users] UAC_REDIRECT : get_redirects does not rewrite host<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Hi Julien,<BR><BR>The get_redirects() function does replace the entire RURI with the<BR>contact URI. My feeling is you (by mistake) rewrite the domain part<BR>after the new RURI is set - try printing the RURI just after the<BR>get_redirects() function.<BR><BR>BTW, what version of opensips are you using?<BR><BR>Regards,<BR>Bogdan<BR><BR>Julien Chavanton wrote:<BR>&gt; I am looking to handle redirect 302 request, get_redirect does not<BR>&gt; replace the domain/host part of the new target ?<BR>&gt;&nbsp;<BR>&gt; How do we handle redirection to a different IP address ?<BR>&gt;&nbsp;<BR>&gt;&nbsp;<BR>&gt; Example :<BR>&gt;&nbsp;<BR>&gt; U 10.0.4.44:5060 -&gt; 10.0.1.73:57226<BR>&gt; INVITE sip:777@10.0.1.73:57226;rinstance=c699f35c276783d3 SIP/2.0.<BR>&gt;&nbsp;<BR>&gt; U 10.0.1.73:57226 -&gt; 10.0.4.44:5060<BR>&gt; SIP/2.0 302 Moved Temporarily.<BR>&gt; Contact: &lt;sip:new_target@10.0.1.1:5060&gt;.<BR>&gt;&nbsp;<BR>&gt; U 10.0.4.44:5060 -&gt; 10.0.1.73:57226<BR>&gt; INVITE sip:new_target@10.0.1.73:57226 SIP/2.0.<BR>&gt; ------------------------------------------------------------------------<BR>&gt;<BR>&gt; _______________________________________________<BR>&gt; Users mailing list<BR>&gt; Users@lists.opensips.org<BR>&gt; <A href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A><BR>&gt;&nbsp;&nbsp;<BR><BR><BR>_______________________________________________<BR>Users mailing list<BR>Users@lists.opensips.org<BR><A href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A><BR></FONT></P></DIV></BODY></HTML>