Hi Daniel,

Thanks for the response. 

In my opinion, I thought RPC commands makes changes in DB as well. So, in that case I was thinking of adding RPC command for subscriber tables.

But as you clear out things that RPC makes changes in memory only then there is no point to add to RPC command for subscriber table. Doing direct DB access will make more sense.

Thanks,

Surabhi Garg

Mobile - 91 783 888 7523 | Skype - surabhi.garg9



From: Daniel-Constantin Mierla <miconda@gmail.com>
Sent: Monday, July 12, 2021 12:04 PM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>; Surabhi Garg <surabhi.garg@outlook.com>
Subject: Re: [SR-Users] Subscriber Management using JSONRPC over HTTP
 

Hello,


the RPC commands usually target to change the data stored in Kamailio memory, like it is for location (kaamilio keeps the records in memory and use them from there, the database storage being only for ability to restore on restart -- well, a matter of db_mode parameter, to be accurate).


If the records are used from database directly, there are no RPC commands, their management has to be done directly to database. This is the case for tables such as subscriber, dbaliases, speeddial.


Also, note that in some cases, when records are loaded from databases and can be changed in memory via RPC, they are not stored back to database, you still need to do that -- for example, dispatcher module.


Personally I do not think is useful to add such feature to Kamailio, it will add complexity and maintenance overhead (given that we support sql, no sql or different other backends like line-based text files), and C is not the most flexible/easiest language to work with databases. Probably is better to have an external HTTP API server for such needs, in the same fashion of:


  * https://github.com/voipxswitch/kamailio-jsonrpc-client


In many cases, at least for subscriber, the table is extended with new columns for having a richer user profile, and used via load_credentials modparam or sqlops.


Cheers,
Daniel


On 09.07.21 10:50, Surabhi Garg wrote:
Hi Alex,

By subscriber management I mean, auth_db module which actually works on subscriber table to add or alter sip account for authentications.
Auth_db Module (kamailio.org)

So, similar like usrloc module which you mentioned having JSONRPC commands to alter Location table. 
I am looking for JSONRPC Command for subscriber module as well.

As far as my understanding, currently there is no JSONRPC command available for subscriber table.
So, if this is currently a known not offered feature / limitation shall we raise it as feature request if others also agree to its usefulness. 
What I'm seeking is more of an acknowledgment that this feature doesn't exist & have it's benefit. As I can see other community members either ends up directly interacting with DB for subscriber table provisioning. Maybe I can contribute on this too.




Surabhi Garg

Mobile - 91 783 888 7523 | Skype - surabhi.garg9





From: sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Alex Balashov <abalashov@evaristesys.com>
Sent: 09 July 2021 01:27
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Subject: Re: [SR-Users] Subscriber Management using JSONRPC over HTTP
 
I am not 100% sure what you mean by subscriber management, but if you mean what I think you mean, these might be the droids you’re looking for:

https://kamailio.org/docs/modules/5.5.x/modules/usrloc.html#idm771

Sent from mobile, with due apologies for brevity and errors.

On Jul 8, 2021, at 3:55 PM, Surabhi Garg <surabhi.garg@outlook.com> wrote:


Hi Team,

Greetings!

I was trying to use HTTP to do the subscriber management (CRUD operations) & for that I am using JSONRPC-S module (JSONRPC over HTTP). But like other modules e.g. dispatcher, location I am unable to find any RPC commands for doing subscriber management (checked in auth_db) module. So is there a way to achieve subscriber management using JSONRPC over HTTP.

Few HTTP examples which I am using for dispatcher module are given below. Similar commands I am looking for subscriber management as well. 

curl http://localhost:8081/RPC -H "Content-Type: application/json" -d " {\"jsonrpc\":\"2.0\",\"method\":\"dispatcher.add\", \"params\":[2, \"sip:127.0.0.1:5061\"], \"id\": \"1\"}"


curl http://localhost:8081/RPC -H "Content-Type: application/json" -d " {\"jsonrpc\":\"2.0\",\"method\":\"dispatcher.remove\”, \"params\":[2, \"sip:127.0.0.1:5061\"], \"id\": \"1\"}"




Surabhi Garg

Mobile - 91 783 888 7523 

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
 * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
 * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * 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