<!-- Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment). -->
### Description
Looking for a mechanism to reload Location attributes at runtime.
Having both registered and permanent Contacts under AoR, with Attributes from `usrloc` to be used for various routing decisions.
This is about attributes of permanent Contacts. Registered ones have `xavp_contact` of `usrloc` to store attributes during registration. **Problem:**
Only way to make it work is: 1. adding a permanent Contact using `rpc ul.add` 2. assigning attributes in DB `location_attr` per RUID (can't find an rpc function for attributes) 3. restart Kamailio
modparam("usrloc", "db_mode", 1) modparam("usrloc", "db_load", 1)
This however is far from ideal, having to restart Kamailio for every change in attributes of a Contact.
### Expected behavior
#### Actual observed behavior
#### Debugging Data
``` (paste your debugging data here) ```
#### Log Messages
<!-- Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site). -->
``` (paste your log messages here) ```
#### SIP Traffic
<!-- If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site). -->
``` (paste your sip traffic here) ```
### Possible Solutions
<!-- If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a improvement. -->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
version: kamailio 5.3.3 (x86_64/linux) 44ccb9
* **Operating System**:
<!-- Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...; Kernel details (output of `uname -a`) -->
``` (paste your output here) ```
Hello, have you tried this function already: https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.f.r...
Hi @henningw ,
I certainly do use `reg_fetch_contacts` to fetch all the Contacts of a caller/callee, it provides access to all the `location` parameters of a Contact (aor, addr, path, received, e.t.c) and that works fine.
Here's the general Lookup flow I use: 1. reg_fetch_contacts("location"); exposes Contact's profile in $ulc pseudo-variable 2. registered("location"); exposes extra attributes from `location_attr` in $xavp(ulattrs)
The name of XAVP storing the attributes per Contact modparam("tm|usrloc", "xavp_contact", "ulattrs")
My quarrel is with the extra attributes. I can't find a way to reload/refresh them at runtime. I have to alter the records in DB table `location_attrs` then restart Kamailio.
Having `db_load=1` loads all Contacts & Attributes on restart, so I thought - may be the function that does that on restart can do the same thing on-demand in some rpc?
Thanks.
I see, does it work in db_mode = 3?
Well, the design of the usrloc db_mode 2 is that the memory is used as write-back cache. So it is not expected to be changed from database. If you are just looking for some variables from a DB, maybe just using sqlops, htable or avpdbops (just to name a few possibilities) are available.
I see. Been using `avpops` for preferences and alike till now. Surely can be done with sqlops. But it's all DB-driven.
Lately, I thought I could unify everything around usrloc, including attributes. In the end - isn't location attributes designed specifically for this purpose? If there was a rpc to add/delete location attributes - I'd gladly use it instead of relying on DB, but it seems like there is no such?
If you want to go the dmq route - htable can be synchronized with it as well. And it provides setting functions over RPC already. And with usrloc_dmq you could go without DB as well. About a RCP to add usrloc attributes, it could be also added, e.g. with a pull request.
Closing it, long time without any activity. A PR can be made if anyone wants to implement it.
Closed #2299 as completed.