[OpenSIPS-Users] Location table - how to use socket
Bogdan-Andrei Iancu
bogdan at opensips.org
Mon May 29 06:32:11 EDT 2017
Hi John,
the only way to share records via DB is to use DB only - the other modes
are using the DB just for restart persistence reason (they do not read
from DB at runtime, only once, at startup). In DB-only mode, all reads
and writes (related to contacts) are done against the DB.
In regards to $(branch(socket)[N]) - do you use it after a
lookup(location) ? are you sure that the N'th branch exists and have a
socket ?
You may consider saving some extra attributes next to the contact ( see
http://www.opensips.org/html/docs/modules/2.2.x/registrar.html#idp5568288)
to identify the pop/host which produced that record.
Best regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
OpenSIPS Bootcamp 2017, Huston, US
http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
On 05/26/2017 07:38 PM, John Quick wrote:
> Hi Bogdan,
>
> Yes. I tried with db_mode=1 and it behaved very strangely so I changed it to db_mode=3 (DB only).
>
> Also tried $(branch(socket)[N]) to read the socket data within my script, but it always returns <null>.
>
> I am now thinking it will be necessary to have one location table per site, but perhaps you could consider adding options in future releases to allow the lookup function to only select contacts where the socket matches one that this server is listening on.
>
> John Quick
> Smartvox Limited
>
>
> -----Original Message-----
> From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
> Sent: 26 May 2017 17:30
> To: john.quick at smartvox.co.uk; OpenSIPS users mailling list <users at lists.opensips.org>
> Subject: Re: [OpenSIPS-Users] Location table - how to use socket
>
> Hi John,
>
> I suppose you are using usrloc with DB-only to share registrations between multiples sites, otherwise the socket filter will not make sense, right ?
>
> Best regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
> OpenSIPS Bootcamp 2017, Huston, US
> http://opensips.org/training/OpenSIPS_Bootcamp_2017.html
>
> On 05/25/2017 06:16 PM, John Quick wrote:
>> The socket field in the location table sometimes contains very useful
>> information such as:
>> - to see which server received the Registration in a dual site
>> scenario
>> - to see if the UA registered over UDP, TCP or TLS
>>
>> However, there does not seem to be any mechanism for using the socket
>> information in the USRLOC or REGISTRAR modules.
>> For example, it is not possible to call lookup and filter for contacts
>> made on the local server's socket or for contacts that used TLS.
>>
>> Please could the developers look at options to leverage this useful
>> data, especially for the lookup function.
>>
>> Are there any tricks I could employ to achieve the same result. For
>> example, if I set a branch flag to indicate which site received this
>> registration would it then be possible to filter the results returned
>> by lookup and extract the registrations received at site A while
>> discarding those received at site B?
>>
>> To give a practical example: Dual site; Shared location table; User's
>> device is registered at site B; Call arrives at site A so I want to
>> use 302 redirect to send it over to site B, but I cannot tell from the
>> results of a lookup whether the registration was made at A or B even
>> though the data is there in the socket field.
>>
>> John Quick
>> Smartvox Limited
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
More information about the Users
mailing list