Thank you very mucho, Iñaki. Now I see it clearer.<br><br>So, if anybody has any idea of how I can do what I want to do (To send a SIP message from a transport address A:b and expect the reply from another one: X:y), please let me know.<br>
<br>Thanks again,<br><br>Víctor<br><br><br><div><span class="gmail_quote">2008/4/8, Iñaki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
El Martes, 8 de Abril de 2008, Victor Cartes escribió:<br> <br>&gt; It&#39;s just curious that RFC 3261 establishes that with no reliable transport<br> &gt; protocols, if received param in via is specified, UAS should refer to that<br>
 &gt; address to send the reply. But I try with some User Agents, and even when I<br> &gt; set the received param pointing to an specific IP address, they&#39;re still<br> &gt; sending the reply to the origin of the requests. With ports there is no<br>
 &gt; such problems.<br> <br> <br>You are minunderstanding the behaviour of &quot;received&quot; and &quot;rport&quot;.<br> <br> &quot;received&quot; is not (and cannot be) set by the UAC, but just by the UAS. This<br> is:<br>
 <br><br> <a href="http://tools.ietf.org/html/rfc3261#section-18.2.1">http://tools.ietf.org/html/rfc3261#section-18.2.1</a><br> <br>---------------------------------------------------<br> <br>&nbsp;&nbsp; When the server transport receives a request over any transport, it<br>
&nbsp;&nbsp; MUST examine the value of the &quot;sent-by&quot; parameter in the top Via<br>&nbsp;&nbsp; header field value.&nbsp;&nbsp;If the host portion of the &quot;sent-by&quot; parameter<br>&nbsp;&nbsp; contains a domain name, or if it contains an IP address that differs<br>
&nbsp;&nbsp; from the packet source address, the server MUST add a &quot;received&quot;<br>&nbsp;&nbsp; parameter to that Via header field value.&nbsp;&nbsp;This parameter MUST<br>&nbsp;&nbsp; contain the source address from which the packet was received.&nbsp;&nbsp;This<br>
&nbsp;&nbsp; is to assist the server transport layer in sending the response,<br>&nbsp;&nbsp; since it must be sent to the source IP address from which the request<br>&nbsp;&nbsp; came.<br> <br>&nbsp;&nbsp; Consider a request received by the server transport which looks like,<br>
&nbsp;&nbsp; in part:<br> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INVITE sip:bob@Biloxi.com SIP/2.0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Via: SIP/2.0/UDP <a href="http://bobspc.biloxi.com:5060">bobspc.biloxi.com:5060</a><br> <br>&nbsp;&nbsp; The request is received with a source IP address of <a href="http://192.0.2.4">192.0.2.4</a>.<br>
&nbsp;&nbsp; Before passing the request up, the transport adds a &quot;received&quot;<br>&nbsp;&nbsp; parameter, so that the request would look like, in part:<br> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INVITE sip:bob@Biloxi.com SIP/2.0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Via: SIP/2.0/UDP bobspc.biloxi.com:5060;received=<a href="http://192.0.2.4">192.0.2.4</a><br>
 <br>---------------------------------------------------<br> <br> &quot;rport&quot; is the same as &quot;reveiced&quot; but for the IP and it&#39;s defined in<br> <a href="http://tools.ietf.org/html/rfc3581">http://tools.ietf.org/html/rfc3581</a>. But there is a BIG difference:<br>
 The UAC MUST add &quot;rport&quot; (with no value) to its Via header to indicate the UAS<br> that UAC supports RFC 3581. So:<br> <br> 1) A UAC adds &quot;rport&quot; (with no value) to Via of the request and sends it to<br>
 UAS.<br> <br> 2) UAS recives the request and compares the IP in the sent-by field of Via<br> header with the source IP of the received request. If both are different then<br> UAS transport layer adds &quot;received=SOURCE_IP&quot; to the Via header<br>
 <br> 3) Since the received Via includes &quot;rport&quot; it means that the UAC supports RFC<br> 3851. Then UAS transport layer compares port indicated in sent-by field with<br> the real source port of the received request. If they are different then UAS<br>
 transport layer adds the value of real source port as the value of &quot;rport&quot;<br> parameter in Via header.<br> <br> 4) Now UAS can reply, passes the request to transaction layer or UAS core.<br> When it generates a response this will go to &quot;received:rport&quot;.<br>
 <br> If &quot;Via&quot; didn&#39;t include &quot;rport&quot; (with no value) then UAS MUSN&#39;T<br> add &quot;rport=source_port&quot; to Via header and will send replies<br> to &quot;received&quot;:&quot;sent-by-port&quot; (obvisouly this will fail in NAT scenarios).<br>
 <br><br> <br> You said:<br> &gt; It&#39;s just curious that RFC 3261 establishes that with no reliable transport<br> &gt; protocols, if received param in via is specified, UAS should refer to that<br> &gt; address to send the reply<br>
 <br> <br>but you are wrong, a UAC CAN NEVER add &quot;received&quot; to Via, it makes no sense at<br> all since UAC cannot know which will be the real source IP the UAS will<br> receive the request from (there can be SIP proxies, NAT routers...). A UAS<br>
 receiving a request with &quot;received&quot; in Via MUST ignore it completely (or<br> maybe reject the request as malformed).<br> <br> <br> Hope it helps you :)<br> <br> <br> <br> --<br> <br>Iñaki Baz Castillo<br> <br><br>
 _______________________________________________<br> Users mailing list<br> <a href="mailto:Users@lists.openser.org">Users@lists.openser.org</a><br> <a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>
 </blockquote></div><br>