[SR-Dev] Both database interfaces integrated
Daniel-Constantin Mierla
miconda at gmail.com
Tue Feb 17 18:35:37 CET 2009
Hello Jan,
lot of work, thanks.
Practically now main components are integrated, with the reserve that
the statistics part from kamailio would need a better integration with
atomics ops in ser. It is why I haven't merge it in master branch yet.
Still to do:
- integrate the other db drivers, as you mentioned
- core extensions in kamailio - Andrei already did the while and
completing switch is on the pipe
- tm extensions to get the other kamailio modules depending on tm work
properly
Then we are done ... looks not much but still some work ...
Cheers,
Daniel
On 02/17/2009 02:32 PM, Jan Janak wrote:
> Hello,
>
> I am happy to announce that I just managed to run sip-router with both
> versions of the database interface, single db_mysql merged from both projects
> and modules from both ser and kamailio at the same time.
>
> I loaded sqlops (kamailio) and avp_db (ser) modules and tried to use them from
> the same script and they both worked, using libsr1 and libsr2
> respectively. Both modules used single db_mysql.
>
> Here is a very simple configuration file which demonstrates how modules from
> both projects can be used together:
>
> -------------------
> loadmodule "./modules/db_mysql/db_mysql.so"
> loadmodule "./modules/domain/domain.so"
> loadmodule "./modules/avp_db/avp_db.so"
> loadmodule "./modules/sqlops/sqlops.so"
> loadmodule "./modules/xlog/xlog.so"
> loadmodule "./modules/avp/avp.so"
>
> modparam("domain|avp_db", "db_url", "db_mysql://ser:heslo@localhost/ser")
> modparam("sqlops","sqlcon","ca=>mysql://ser:heslo@localhost/ser")
>
> route {
> log(1, "ERR: Request received\n");
> sql_query("ca", "select * from domain", "ra");
> if($dbr(ra=>rows)>0) {
> log(1, "ERR:Some data found\n");
> } else {
> log(1, "ERR:No data found\n");
> }
> sql_result_free("ra");
>
> load_attrs("$fu", "100");
>
> if ($fu.test && ($fu.test == "abc")) {
> log(1, "ERR: Attribute loaded\n");
> } else {
> log(1, "ERR: Attribute NOT loaded\n");
> }
> dump_attrs();
> }
> -------------
>
> As the merged db_mysql module seems to work fine, I merged it from
> janakj/mysql into the master branch and I would like to encourage others to
> give it a spin.
>
> I am quite happy about the merge of db_mysql, we preserved histories from both
> projects, kamailio files are prefixed with km_ and it didn't that that many
> changes to make it work :-). I think this is the way to go for other database
> drivers as well.
>
> On the other hand porting kamailio modules to sip-router takes more tweaks
> than I expected. There are several subsystems which are not compatible (avps)
> and also kamailio seems to have more functions and data structures in the
> core, some of them are missing in the sip-router core. So expect more work
> when you try to port kamailio modules to sip-router.
>
> Jan.
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
--
Daniel-Constantin Mierla
http://www.asipto.com
More information about the sr-dev
mailing list