Re: [SR-Users] Using static entries with usrloc

2019-09-23 Thread Daniel-Constantin Mierla

On 20.09.19 16:52, Daniel Tryba wrote:
> On Fri, Sep 20, 2019 at 04:37:20PM +0300, George Diamantopoulos wrote:
>> Am I right in thinking that merely INSERTing respective rows in kamailio's
>> location DB backend will do the trick? Is there anything I need to worry
>> about, like contacts being periodically purged? If yes, how do I prevent
>> that from happening? And will kamailio always query the DB when performing
>> location lookup or do I need to restart upon inserting new records (to
>> purge caches, for example)?
> I did the same (as in clients can choose to setup their endpoints this
> way, but nobody is doing it at this moment).
>
> This depends on what dbmode you have set. db_mode 3 will cache nothing
> and do a DB lookup for all actions. This is also safe for what you are
> wanting to to (in my experience).
>
>> Lastly, I'm not sure how to treat some fields present in usrloc tables like
>> ruid, expires (can I set this to NULL?), callid and cseq (which is
>> irrelevant since there's no REGISTER), flags, cflags and methods.
> ruid: doesn't matter (I set it to username)


Just a note: the ruid should be unique per record, it is fine if you
have one registration per username. It might not have impact if you do
not use gruu extensions of some functions that need the ruid (e.g.,
unregister by ruid, location record attribtues), but it would be safer
to just set it to a unique random value.

Cheers,
Daniel

> expires: I have it set to just before the end of the current unix time,
>  2018-01-01 00:00:00
> callid: a unique random string (substr(md5(time().rand()),0,16))
> cseq: 1
> flags: 0 (?)
> cflag: 128 (?)
> methods: 6879 (?)
>
> But doing it through kamcmd might be the better answer that is already
> given.
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- 
https://asipto.com/u/kat


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-23 Thread George Diamantopoulos
Thank you all for your input. I'll most likely use the RPC command to add
entries expiring at the end of linux time and see how it goes. Cheers!

On Fri, 20 Sep 2019 at 16:37, George Diamantopoulos 
wrote:

> Hello,
>
> Normally I wouldn't be asking this but I was surprised to find no
> reference to anyone doing this online. I need to have a few AoRs with
> static entries in kami's location table, which will always be reachable at
> their contacts without ever having to register with Kamailio.
>
> Am I right in thinking that merely INSERTing respective rows in kamailio's
> location DB backend will do the trick? Is there anything I need to worry
> about, like contacts being periodically purged? If yes, how do I prevent
> that from happening? And will kamailio always query the DB when performing
> location lookup or do I need to restart upon inserting new records (to
> purge caches, for example)?
>
> Lastly, I'm not sure how to treat some fields present in usrloc tables
> like ruid, expires (can I set this to NULL?), callid and cseq (which is
> irrelevant since there's no REGISTER), flags, cflags and methods.
>
> Thanks,
> George
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-20 Thread Daniel Tryba
On Fri, Sep 20, 2019 at 03:00:34PM +, Henning Westerholt wrote:
> > expires: I have it set to just before the end of the current unix time,
> >   2018-01-01 00:00:00
> 
> Hello,
> 
> you mean probably end of unix time at 03:14:07 UTC on 19 January 2038.

Doh, yes :)


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-20 Thread Henning Westerholt
Am 20.09.19 um 16:52 schrieb Daniel Tryba:
On Fri, Sep 20, 2019 at 04:37:20PM +0300, George Diamantopoulos wrote:
>> Am I right in thinking that merely INSERTing respective rows in kamailio's
>> location DB backend will do the trick? Is there anything I need to worry
>> about, like contacts being periodically purged? If yes, how do I prevent
>> that from happening? And will kamailio always query the DB when performing
>> location lookup or do I need to restart upon inserting new records (to
>> purge caches, for example)?
> I did the same (as in clients can choose to setup their endpoints this
> way, but nobody is doing it at this moment).
>
> This depends on what dbmode you have set. db_mode 3 will cache nothing
> and do a DB lookup for all actions. This is also safe for what you are
> wanting to to (in my experience).
>
>> Lastly, I'm not sure how to treat some fields present in usrloc tables like
>> ruid, expires (can I set this to NULL?), callid and cseq (which is
>> irrelevant since there's no REGISTER), flags, cflags and methods.
> ruid: doesn't matter (I set it to username)
> expires: I have it set to just before the end of the current unix time,
>   2018-01-01 00:00:00

Hello,

you mean probably end of unix time at 03:14:07 UTC on 19 January 2038.

Henning

> callid: a unique random string (substr(md5(time().rand()),0,16))
> cseq: 1
> flags: 0 (?)
> cflag: 128 (?)
> methods: 6879 (?)
>
> But doing it through kamcmd might be the better answer that is already
> given.

-- 
Kamailio Merchandising - https://skalatan.de/merchandising/
Kamailio services - https://skalatan.de/services
Henning Westerholt - https://skalatan.de/blog/

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-20 Thread Daniel Tryba
On Fri, Sep 20, 2019 at 04:37:20PM +0300, George Diamantopoulos wrote:
> Am I right in thinking that merely INSERTing respective rows in kamailio's
> location DB backend will do the trick? Is there anything I need to worry
> about, like contacts being periodically purged? If yes, how do I prevent
> that from happening? And will kamailio always query the DB when performing
> location lookup or do I need to restart upon inserting new records (to
> purge caches, for example)?

I did the same (as in clients can choose to setup their endpoints this
way, but nobody is doing it at this moment).

This depends on what dbmode you have set. db_mode 3 will cache nothing
and do a DB lookup for all actions. This is also safe for what you are
wanting to to (in my experience).

> Lastly, I'm not sure how to treat some fields present in usrloc tables like
> ruid, expires (can I set this to NULL?), callid and cseq (which is
> irrelevant since there's no REGISTER), flags, cflags and methods.

ruid: doesn't matter (I set it to username)
expires: I have it set to just before the end of the current unix time,
 2018-01-01 00:00:00
callid: a unique random string (substr(md5(time().rand()),0,16))
cseq: 1
flags: 0 (?)
cflag: 128 (?)
methods: 6879 (?)

But doing it through kamcmd might be the better answer that is already
given.

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-20 Thread Henning Westerholt
Hello George,

if you have a static mapping from a AoR to an IP address you could also just 
route this in the cfg or with another database table (e.g. with a sqlops 
query). More or less the whole point of the usrloc/registrar modules is to have 
people register to your server and then maintain this mapping.

About the expiration - the easist would be to just enter a value that is in the 
future. This is e.g. the default value of the location table: 
DEFAULT_LOCATION_EXPIRES "2030-05-28 21:32:15"

Cheers,

Henning

Am 20.09.19 um 15:37 schrieb George Diamantopoulos:
Hello,

Normally I wouldn't be asking this but I was surprised to find no reference to 
anyone doing this online. I need to have a few AoRs with static entries in 
kami's location table, which will always be reachable at their contacts without 
ever having to register with Kamailio.

Am I right in thinking that merely INSERTing respective rows in kamailio's 
location DB backend will do the trick? Is there anything I need to worry about, 
like contacts being periodically purged? If yes, how do I prevent that from 
happening? And will kamailio always query the DB when performing location 
lookup or do I need to restart upon inserting new records (to purge caches, for 
example)?

Lastly, I'm not sure how to treat some fields present in usrloc tables like 
ruid, expires (can I set this to NULL?), callid and cseq (which is irrelevant 
since there's no REGISTER), flags, cflags and methods.

Thanks,
George



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Kamailio Merchandising - https://skalatan.de/merchandising/
Kamailio services - https://skalatan.de/services
Henning Westerholt - https://skalatan.de/blog/
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using static entries with usrloc

2019-09-20 Thread David Villasmil
Hello George,

You’re better off inserting a permanently, do it like:

kamctl rpc ul.add location usern...@localdomain.com
sip:USERNAME@IP_PERMANENT:5060 0 1 . 0 0 13279 . .

https://kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.r.add

4.6.  ul.add

Adds a new contact for an user AOR.

Parameters:

   -

   *table name* - table where the contact will be added (Ex: location).
   -

   *AOR* - user AOR in username[@domain] format (domain must be supplied
   only if use_domain option is on).
   -

   *contact* - contact string to be added
   -

   *expires* - expires value of the contact
   -

   *Q* - Q value of the contact
   -

   *path* value with the Path vector (use '0' or '.' if it should not be
   set)
   -

   *flags* - internal USRLOC flags of the contact
   -

   *cflags* - per branch flags of the contact
   -

   *methods* - mask with supported requests of the contact
   -

   *received* (optional) value with the received-from address (source
   address) (use '0' or '.' if it should not be set). Format:
   sip:srcip:srcport;transport=abc
   -

   *socket* (optional) value with the local socket address (use '0' or '.'
   if it should not be set). Format: proto:localip:localport

Note: the position of parameters is relevant, in the case of optional
parameters, use '0' or '.' for parameters that should not be set which are
positioned before any parameter that has to be set.

Hope that helps,

David


On Fri, 20 Sep 2019 at 14:40, George Diamantopoulos 
wrote:

> Hello,
>
> Normally I wouldn't be asking this but I was surprised to find no
> reference to anyone doing this online. I need to have a few AoRs with
> static entries in kami's location table, which will always be reachable at
> their contacts without ever having to register with Kamailio.
>
> Am I right in thinking that merely INSERTing respective rows in kamailio's
> location DB backend will do the trick? Is there anything I need to worry
> about, like contacts being periodically purged? If yes, how do I prevent
> that from happening? And will kamailio always query the DB when performing
> location lookup or do I need to restart upon inserting new records (to
> purge caches, for example)?
>
> Lastly, I'm not sure how to treat some fields present in usrloc tables
> like ruid, expires (can I set this to NULL?), callid and cseq (which is
> irrelevant since there's no REGISTER), flags, cflags and methods.
>
> Thanks,
> George
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Using static entries with usrloc

2019-09-20 Thread George Diamantopoulos
Hello,

Normally I wouldn't be asking this but I was surprised to find no reference
to anyone doing this online. I need to have a few AoRs with static entries
in kami's location table, which will always be reachable at their contacts
without ever having to register with Kamailio.

Am I right in thinking that merely INSERTing respective rows in kamailio's
location DB backend will do the trick? Is there anything I need to worry
about, like contacts being periodically purged? If yes, how do I prevent
that from happening? And will kamailio always query the DB when performing
location lookup or do I need to restart upon inserting new records (to
purge caches, for example)?

Lastly, I'm not sure how to treat some fields present in usrloc tables like
ruid, expires (can I set this to NULL?), callid and cseq (which is
irrelevant since there's no REGISTER), flags, cflags and methods.

Thanks,
George
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users