<div dir="ltr"><font color="#3366ff"><font><font face="tahoma,sans-serif">Thank you for your reply. I tried what you suggested.</font></font></font><div><font color="#3366ff"><font><font face="tahoma,sans-serif"><br></font></font></font></div>



<div><font color="#3366ff"><font><font face="tahoma,sans-serif">The problem is when there are multiple locations/registrations per AOR on different ports and doing parallel forking.</font></font></font></div><div><font color="#3366ff"><font><font face="tahoma,sans-serif">Accessing $fs only gives one of the sockets (first or last?), not all of them.</font></font></font></div>

<div><font color="#3366ff" face="tahoma, sans-serif">Accessing $sndfrom gives all of the used outgoing sockets, because it&#39;s populated in the onsedn_route route, which is called for every outgoing packet, but in onsend_route I can&#39;t use record_route functions, neither mangle with the SIP header anymore in any way. It&#39;s too late by the time I get to onsend_route...</font></div>

<div><font color="#3366ff" face="tahoma, sans-serif"><br></font></div><div><font color="#3366ff" face="tahoma, sans-serif">No solution so far..<br></font><div>

<div><font color="#3366ff"><font><font face="tahoma,sans-serif"><br clear="all"></font></font></font><div dir="ltr"><font color="#3366ff" face="tahoma, sans-serif"><br></font><div><font color="#3366ff" face="tahoma, sans-serif">Reda</font></div>



</div><br>
<br><br><div class="gmail_quote">On Tue, Jan 17, 2012 at 21:47, Ovidiu Sas <span dir="ltr">&lt;<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



When you route through usrloc, there is a PV that should be set - forced socket:<br>
<a href="http://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#forced_socket" target="_blank">http://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#forced_socket</a><br>
You can check the socket via &#39;kamctl ul show&#39; command.<br>
If the PV is not populated, check the send attributes:<br>
<a href="http://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#send_address_attributes" target="_blank">http://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#send_address_attributes</a><br>
Based on that, you should know through which interface the INVITE<br>
should be sent and therefore you should be able to set the proper<br>
Record-Route header.<br>
<br>
Regards,<br>
<span><font color="#888888">Ovidiu Sas<br>
<br>
--<br>
VoIP Embedded, Inc.<br>
<a href="http://www.voipembedded.com" target="_blank">http://www.voipembedded.com</a><br>
</font></span><div><div><br>
<br>
On Tue, Jan 17, 2012 at 3:01 PM, Reda Aouad &lt;<a href="mailto:reda.aouad@gmail.com" target="_blank">reda.aouad@gmail.com</a>&gt; wrote:<br>
&gt; I just tried the record_route_advertised_address(&quot;public_ip&quot;).<br>
&gt; It doesn&#39;t add the port number of the outgoing socket.<br>
&gt;<br>
&gt; Any suggestions?<br>
&gt;<br>
&gt; RA<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Jan 16, 2012 at 15:57, Reda Aouad &lt;<a href="mailto:reda.aouad@gmail.com" target="_blank">reda.aouad@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I know about record_route_advertised_address(&quot;ip:port&quot;) function. If I<br>
&gt;&gt; understood correctly, it inserts a top-most RR header with the public IP if<br>
&gt;&gt; double RR is enabled. But that doesn&#39;t solve the multiple ports problem. I<br>
&gt;&gt; would get in the SIP header :<br>
&gt;&gt;<br>
&gt;&gt; Record-Route: &lt;public_ip;lr=on&gt;<br>
&gt;&gt; Record-Route: &lt;private_ip:port;lr=on&gt;<br>
&gt;&gt;<br>
&gt;&gt; If user B sees the first Record-Route header, it remembers port=5060 for<br>
&gt;&gt; future requests.<br>
&gt;&gt; I cannot manually set the port in the config file since it depends on<br>
&gt;&gt; which port user B is registered, which I don&#39;t have a way to find it.<br>
&gt;&gt;<br>
&gt;&gt; RA<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jan 16, 2012 at 15:51, Andrew Pogrebennyk<br>
&gt;&gt; &lt;<a href="mailto:apogrebennyk@sipwise.com" target="_blank">apogrebennyk@sipwise.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 01/16/2012 03:41 PM, Reda Aouad wrote:<br>
&gt;&gt;&gt; &gt; I suggest that the function record_route( ) takes a public IP address<br>
&gt;&gt;&gt; &gt; as<br>
&gt;&gt;&gt; &gt; a parameter, still doing what it does (correct record routing and<br>
&gt;&gt;&gt; &gt; cookie<br>
&gt;&gt;&gt; &gt; addition did=xxx and loose route lr=on), but only replacing the private<br>
&gt;&gt;&gt; &gt; IP address on which Kamailio listens with a public IP address. Or that<br>
&gt;&gt;&gt; &gt; the record_route( ) function uses the advertised_address to construct<br>
&gt;&gt;&gt; &gt; the RR header.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; maybe you are looking for the function record_route_advertised_address()<br>
&gt;&gt;&gt; which is available in git master:<br>
&gt;&gt;&gt; <a href="http://web.archiveorange.com/archive/v/jZFTGE0yjPqCTTcAkzuf" target="_blank">http://web.archiveorange.com/archive/v/jZFTGE0yjPqCTTcAkzuf</a><br>
&gt;&gt;&gt;<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div></div></div></div>