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.
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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
On 17-02 19:35, Daniel-Constantin Mierla wrote:
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 ...
I don't think that's it. You'll probably run into many more issues when you try to port some modules to sip-router. So far I hit:
* Missing functions in core (hash functions from kamailio) * Incompatible avp data structures and functions * ival versus i in fparam/gparam * Several modules in ser depend on domain modules which is different from the domain module in kamailio. * Several modules depend on xlog which is again different in kamailio.
And I only tried two or three modules. These are probably small differences, but they are annoying and require tweaks in many modules.
I guess the question here is how far we want to go with this first merge attempt, if the goal is to allow most modules from both projects work with sip-router then I think we are not there yet.
Jan.
On 17-02 18:50, Jan Janak wrote:
On 17-02 19:35, Daniel-Constantin Mierla wrote:
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 ...
I don't think that's it. You'll probably run into many more issues when you try to port some modules to sip-router. So far I hit:
- Missing functions in core (hash functions from kamailio)
- Incompatible avp data structures and functions
- ival versus i in fparam/gparam
- Several modules in ser depend on domain modules which is different from the domain module in kamailio.
- Several modules depend on xlog which is again different in kamailio.
I forgot to mention that the last two bullets are not show stoppers.
Jan.
On 02/17/2009 07:53 PM, Jan Janak wrote:
On 17-02 18:50, Jan Janak wrote:
On 17-02 19:35, Daniel-Constantin Mierla wrote:
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 ...
I don't think that's it. You'll probably run into many more issues
definitively we are not there yet, otherwise we would be preparing a release, what I mean was that even looks trivial at first sight, still some work to do ...
when you try to port some modules to sip-router. So far I hit:
- Missing functions in core (hash functions from kamailio)
they are easy to fix. I did it with some defines in PV api and statistics, but would be better to add some wrappers for full compatibility.
- Incompatible avp data structures and functions
This should be updated in Kamailio side to use the PV API whenever is possible, so the AVP structure is hidden. There are cases when operations require direct access (e.g., avopos module).
- ival versus i in fparam/gparam
- Several modules in ser depend on domain modules which is different from the domain module in kamailio.
- Several modules depend on xlog which is again different in kamailio.
I forgot to mention that the last two bullets are not show stoppers.
Indeed, there will be some duplicated modules for a while, so in specific cases/config, a set of modules will be from one side only. This is fine for me with the first integration version.
Cheers, Daniel