[OpenSIPS-Users] Shared 'location' table?

Chris Maciejewski chris at wima.co.uk
Mon Apr 26 13:52:39 CEST 2010


Hi Bogdan,

I am aware each opensips instance can only ping it's *own* contacts.
What I wanted to achieve is to avoid OpenSIPs1 pinging UA2, as shown
in my diagram:

http://wima.co.uk/2x_opensips.pdf

I have now solved my problem in the following way:

Opensips 1: modparam("usrloc", "db_url", "userloc1")
Opensips 2: modparam("usrloc", "db_url", "userloc2")

Web server: "web_db" with the following MySQL View:

CREATE VIEW sip_location AS
(SELECT location.username, location.contact, location.user_agent,
location.last_modified, location.expires, location.socket,
location.methods FROM userloc1.location)
UNION
(SELECT location.username, location.contact, location.user_agent,
location.last_modified, location.expires, location.socket,
location.methods FROM userloc2.location);

and now my web application can run the following query to get all contacts:

"SELECT * FROM sip_location"

So no need for a custom path (but thanks a lot for your offer to write one).

Best regards,
Chris

On 26 April 2010 11:29, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
> Hi Chris,
>
> A quick one - with such a configuration, the NAT traversal will not work
> (due the restriction on destination of the NAT pinhole) - so why pinging
> them ?....
>
> I can make a small patch to you to set nathelper for pinging only if the
> record socket is local, if not, no pinging - this may solve the pinging
> problem, but overall, it will make no difference I guess.
>
> Regards,
> Bogdan
>
> Chris Maciejewski wrote:
>> Hi,
>>
>> I made a diagram showing what I am trying to achieve:
>>
>> http://wima.co.uk/2x_opensips.pdf
>>
>> Is this possible at all?
>> Can we make two OpenSIPs share the same 'location' table, yet each
>> dealing only with it's "own" contacts?
>>
>> Regards,
>> Chris
>>
>>
>> On 22 April 2010 18:47, Brett Nemeroff <brett at nemeroff.com> wrote:
>>
>>> Just a quick question here.. can some of this be taken care of with a
>>> t_replicate for the register?
>>>
>>> Just a thought..
>>> -Brett
>>>
>>>
>>> On Thu, Apr 22, 2010 at 12:36 PM, Chris Maciejewski <chris at wima.co.uk> wrote:
>>>
>>>> On 22 April 2010 18:11, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
>>>>
>>>>> Chris Maciejewski wrote:
>>>>>
>>>>>> On 22 April 2010 18:00, Bogdan-Andrei Iancu <bogdan at voice-system.ro> wrote:
>>>>>>
>>>>>>
>>>>>>> Hi Chris,
>>>>>>>
>>>>>>> running 2 opensips with different IPs ? because opensips saves in
>>>>>>> location table its own socket (where the REGISTER was received), and if
>>>>>>> the other server will try to use it, it will not recognize this socket
>>>>>>> (as it is a different IP).
>>>>>>>
>>>>>>> Before going further, note that multiple opensips  sharing  the same
>>>>>>> location table has some flows (due how SIP works) - like if you are
>>>>>>> using multiple interfaces, of different port ; also NAT traversal will
>>>>>>> not work.
>>>>>>>
>>>>>>> In the end, if you do not have NAT and using a single interface, you can
>>>>>>> simply ignore those warnings.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Bogdan
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> Hi Bogdan,
>>>>>>
>>>>>> Thanks for clarification. I am aware due to NAT traversal etc.
>>>>>> multiple SIP registrar servers sharing the same location table will
>>>>>> not work.
>>>>>>
>>>>>> I was just worried this WARNINGs might have some negative impact, but
>>>>>> in that case I will just ignore them.
>>>>>>
>>>>>>
>>>>> If opensips finds a non-local socket in a usrloc records, it will fire
>>>>> the warning and use one of its own sockets for dealing with that contact.
>>>>>
>>>>> Regards,
>>>>> Bogdan
>>>>>
>>>>>
>>>> Ah, I see now.
>>>>
>>>> When UA1 registered at Proxy1 only, Nathelper OPTIONs are sent from
>>>> both Proxy1 and Proxy2. This is not what I wanted :(
>>>>
>>>> Is there any way to make Proxy2 completely ignore UA1?
>>>>
>>>> Regards,
>>>> Chris
>>>>
>>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
> --
> Bogdan-Andrei Iancu
> www.voice-system.ro
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list