<html><body>
<p>Hi Guys,<br>
<br>
I don't understand why you need to do any of this (bflags,setting $fs). We listen on both port 5060 and 5062 of our public interface, and the registrar module handles all this internally. Specifically, we can receive an REGISTER on either port, and when an INVITE comes in for that user and it goes thru lookup(), then the outgoing INVITE will be sent on the same socket on which the REGISTER was received.<br>
<br>
In registrar module, the save() function stores the received socket into the usrloc module, and the lookup() function retrieves it and stores that into the force_send_sock. The only thing I can see that would mess this up is if you use the 's' flag to save(), which will then try extracting the received sock from a header rather than using the actual received socket.<br>
<br>
The relevant code registrar/save.c:240 and registrar/lookup.c:288.<br>
<br>
Could you help me understand what it is you are attempting to do that the registrar module doesn't handle internally?<br>
<br>
Thanks,<br>
Kennard<br>
<br>
<br>
<br>
<img width="16" height="16" src="cid:1__=07BBFD37DFCFE0838f9e8a93df9@logitech.com" border="0" alt="Inactive hide details for Stefano Pisani ---09/18/2010 02:52:37 AM--- Hi, I solved it using field socket in location table and"><font color="#424282">Stefano Pisani ---09/18/2010 02:52:37 AM--- Hi, I solved it using field socket in location table and using $fs = this</font><br>
<br>
<font size="2" color="#5F5F5F">From:        </font><font size="2">Stefano Pisani <stefano.pisani@omnianet.it></font><br>
<font size="2" color="#5F5F5F">To:        </font><font size="2">OpenSIPS users mailling list <users@lists.opensips.org></font><br>
<font size="2" color="#5F5F5F">Date:        </font><font size="2">09/18/2010 02:52 AM</font><br>
<font size="2" color="#5F5F5F">Subject:        </font><font size="2">Re: [OpenSIPS-Users] How opensis can manage different ports.</font><br>
<font size="2" color="#5F5F5F">Sent by:        </font><font size="2">users-bounces@lists.opensips.org</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt> Hi,<br>
I solved it using field socket in location table and using $fs = this <br>
socket before t_relay()<br>
just in case of local lookup<br>
<br>
Il 18/09/2010 06:43, Andrew Pogrebennyk ha scritto:<br>
> On 18.09.2010 07:36, mayamatakeshi wrote:<br>
>> If you are dealing with more than 2 ports, this might get complicated.<br>
>> But in case of just 2 ports, you could check the ReceivedPort and set<br>
>> a bflag during handling of the REGISTER request:<br>
>><br>
>> if($Rp == 5060) {<br>
>> setbflag(BFLAG_RECEIVED_ON_PORT_5060);<br>
>> }<br>
> That's correct. It will also work with more than 2 ports, but you need<br>
> to enumerate each socket with a flag.<br>
><br>
<br>
_______________________________________________<br>
Users mailing list<br>
Users@lists.opensips.org<br>
</tt><tt><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></tt><tt><br>
</tt><br>
</body></html>