Re: [OpenSIPS-Users] registrar and kv_store

2022-01-11 Thread Alberto
I'll do that.
Thanks

On Tue, 11 Jan 2022, 12:42 Liviu Chircu,  wrote:

> On 11.01.2022 11:50, Alberto wrote:
>
>
> How do I insert values in the kv_store column?
> It's easy to use the attr_avp, but I need to store a couple more values
> upon registrations and the key-value storage would be the perfect solution.
>
> Hello, Alberto!
>
> The "kv_store" column is for internal purposes, hence there is no way to
> READ or WRITE values to it from the opensips.cfg script.
>
> Regarding attr_avp[1]: why not store your data in JSON format (perhaps
> using the $json_compact[2]) variable?  This way, you can give it
> structure, using as many nesting levels as necessary in order to fit all of
> it.
>
> [1]: https://opensips.org/docs/modules/3.3.x/registrar.html#param_attr_avp
> [2]: https://opensips.org/docs/modules/3.3.x/json.html#pv_json_compact
>
> Best Regards,
>
> --
> Liviu Chircuwww.twitter.com/liviuchircu | www.opensips-solutions.com
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] registrar and kv_store

2022-01-11 Thread Liviu Chircu

On 11.01.2022 11:50, Alberto wrote:


How do I insert values in the kv_store column?
It's easy to use the attr_avp, but I need to store a couple more 
values upon registrations and the key-value storage would be the 
perfect solution.


Hello, Alberto!

The "kv_store" column is for internal purposes, hence there is no way to 
READ or WRITE values to it from the opensips.cfg script.


Regarding attr_avp^[1] : why not store your data in JSON format (perhaps 
using the $json_compact^[2] ) variable?  This way, you can give it 
structure, using as many nesting levels as necessary in order to fit all 
of it.


[1]: https://opensips.org/docs/modules/3.3.x/registrar.html#param_attr_avp
[2]: https://opensips.org/docs/modules/3.3.x/json.html#pv_json_compact

Best Regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] registrar and kv_store

2022-01-11 Thread Alberto
Hi,

I'm testing some features I want to implement, my usrloc and registrar
configuration look like this:

loadmodule "usrloc.so"
modparam("usrloc", "db_url", "unixodbc://opensips:opensipsrw@localhost
/opensips")
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset",
"single-instance-sql-write-through")

loadmodule "registrar.so"
modparam("registrar", "attr_avp", "$avp(finloc)")
modparam("registrar", "max_contacts", 1)

How do I insert values in the kv_store column?
It's easy to use the attr_avp, but I need to store a couple more values
upon registrations and the key-value storage would be the perfect solution.

Thanks
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users