[sr-dev] Writing a driver for rethinkdb

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 18 12:48:47 CEST 2016


Hello,

On 17/04/16 15:57, Ron wrote:
> Hi,
>
> I need to authenticate against a rethinkdb database. There is
> currently no driver, so I'll start writing one. The databases that
> come closest conceptually are mongodb and cassandra.
> My initial setup will be frontending a few asterisk servers, where
> Kamailio handles SIP registration, and load-balances INVITE requests.
>
> I have the following questions:
>
> - In what way does not supporting raw query limit Kamailio usage?
Raw query is supposed to be used only in kamailio.cfg via sqlops (or
avpops) module. Inside the other modules that bind to DB API, the should
use the API members for query, insert, etc. in order to be used with any
of the DB connectors.

If you write a DB API connector for rethinkdb, you will have to
implement at least the query to make it work for auth_db module. Other
services such as location/usrloc require also the insert, update, delete...

Just for authentication, you can use ndb approach to fetch the password
in a config variable and then use pv_* auth functions from auth module.

> - In what way does not supporting ndb drivers limit Kamailio usage?

Some of the modules need the DB API connector to work with, so just
having ndb modules won't work. The ndb modules are supposed to be used
directly from kamailio.cfg to interact with the backend.

> - Does anyone know of test harnesses/programs that can be used to
> verify correctness of my driver?
>
If you get the new DB API connector module to work with usrloc module
(to handle registrations and to lookup of target users) then you are
pretty much sure that it is going to work for the most of the modules.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com




More information about the sr-dev mailing list