Hey Everyone!
I'm currently working on a database module and I've come across some
issues/confusion that I was hoping someone could clear up for me. I've been looking
at the existing modules and the docs online for help but I can't find a definitive
answer for them.
1. I see there are 2 DB APIs (srdb1 and srdb2) and I gather that srdb2 is the newer
version? Should I aim to use srdb2 exclusively or should I also use srdb1?
2. It looks like srdb2 provides a db_uri command that can be used to implement custom
URI parsing but I can't figure out how to hook into it. I added it to my exported
commands but it was never called. When I looked through the code I saw the only place
that ever really uses it is db_ctx, which itself looks to be used in the child_init of
modules. I'm developing a database module that I want to be a drop-in replacement for
others, but it needs multiple hosts specified in the connection uri (similar to the URI
example here
http://docs.mongodb.org/manual/reference/connection-string/) and I can't
figure out the best place to do it. Should I be doing it in db_func_t.init because it has
the full string version of the uri and parse it there? Do I then have to reimplement
everything that db_do_init would be doing?
3. Do I need to implement multiple database interfaces to get full module coverage in
Kamailio? I was looking at db_berkeley as a reference and it looks like it has the
KAMAILIO_MOD_INTERFACE as well as the SER_MOD_INTERFACE implemented.
4. Is there a preferred way to handle the API binding (such as db_ commands vs
db_bind_api)?
Thanks for any help or direction you can give me!
- Erik Davidson
-----------------------------------------
CONFIDENTIALITY NOTICE: The information contained in this e-mail message and any
attachments is for the sole use of the intended recipients and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient and have received this communication in
error, please contact the sender by reply e-mail and destroy all copies of the original
message. Thank you.