Daniel, I want to ask you for some help with my idea. Just for some advices
and explanations of some structures.
Thanks for help.
The first of all:
I think not write to create new module for integration of usrloc and redis.
I thing it is good idea to add new features to existing usrloc and use
ndb_redis module for connection.
As I undersand when learning source code of usrloc module - this module use
/kamailio/lib/srdb1/db.h
This header implements 2 structures that i see at ul_mod files:
extern db1_con_t* ul_dbh; extern db_func_t ul_dbf;
This structures handle SQL connections.
I ask this because at the README i see
modparam("usrloc", "db_url",
"dbdriver://username:password@dbhost/dbname")
Looking at the API documentation I find API that use DB detection, then I
look at db.c at my kamailio ( kamailio 4.3.0-dev5 (x86_64/linux) e172b7
) too but can not find any strings about mongo.
The second As I see - location not working with redis because it use API
for DB and API not omplement redis integration. So I thing it is write way
to rewrite module with external connection to redis, not using API, Isn't
it?
Thanks once again
2015-03-27 0:51 GMT+03:00 Daniel-Constantin Mierla <miconda(a)gmail.com>om>:
Hello,
might worth reading the devel guide:
-
http://www.asipto.com/pub/kamailio-devel-guide/
It is for an older version, but still good.
Then, if you want to implement a db_redis module (a module that can be
used instead of other db modules, such as db_mysql), maybe checking
db_mongodb is good to learn by example, given the mongodb is nosql system
as well.
I think for redis the main things to sort out is how you serialize the
structures that are going to be saved (maybe using serialized json will
allow reusing code from mongodb) and what will be the key value, as redis
is practically a (key, value) storage. Maybe storing a redis hash structure
is an alternative. Then, how the expressions to select records are built to
match in redis system.
Not being very familiar with redis, I cannot assert properly the
complexity to get the above sorted out nicely.
Cheers,
Daniel
On 26/03/15 22:27, Yuriy Gorlichenko wrote:
Daniel, hello. Our service need to translate location table to redis, and
we want start to write own module for kamailio. Akn you give us some
advices and documentation for API of kamailio, that we may to use for
creation own module.
Thks
_______________________________________________
sr-dev mailing
listsr-dev@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
--
Daniel-Constantin
Mierlahttp://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany -
http://www.kamailioworld.com
_______________________________________________
sr-dev mailing list
sr-dev(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev