siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes: - added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile - s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
Andrei
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
... and the second (first for me) is xlog, just needs
DEFS+=-DKAMAILIO_MOD_INTERFACE
added to the Makefile
This works with the branch daniel/pv (it includes stuff from Andrei's branches). The only PVs available now are the colors exported by xlog, therefore now you can do color printing of static text using Kamailio/OpenSER's xlog module.
Cheers, Daniel
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
I think both of them can co-exists. I see no other conflicts than naming space -- so we need at least renaming of the db directory. Also they can be moved as library.
BTW, should be there a naming policy for library? Like prefix with sr_ or similar?
-example: libsr_dbk - sip router's library for DB interface compatible with Kamailio
Cheers, Daniel
On Nov 20, 2008 at 23:44, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
I think both of them can co-exists. I see no other conflicts than naming space -- so we need at least renaming of the db directory. Also they can be moved as library.
BTW, should be there a naming policy for library? Like prefix with sr_ or similar?
-example: libsr_dbk - sip router's library for DB interface compatible with Kamailio
Yes, it might be better to have a "sr_" prefix. Right now in ser we have for some (libser_cds, libser_presence) and no prefix for others (libbinrpc).
Normally they will be installed in their own dir (e.g. /usr/lib/sr and the modules in /usr/lib/sr/modules), but having a separate prefix is even safer.
BTW: to quickly create a library just copy the Makefile from lib/print/ and change the name in it, and add your .c and .h files.
To use a library from a module, just add to the module's Makefile:
SERLIBPATH=../../lib # ser libraries, in the format path/shortname , where shortname is # what will be used for -l SER_LIBS=$(SERLIBPATH)/print/print
Compiling the module will re-compile the library automatically if needed (e.g. some change in it). make install will also re-link the module (needed to change the rpath).
Andrei
On 11/21/08 00:00, Andrei Pelinescu-Onciul wrote:
On Nov 20, 2008 at 23:44, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
I think both of them can co-exists. I see no other conflicts than naming space -- so we need at least renaming of the db directory. Also they can be moved as library.
BTW, should be there a naming policy for library? Like prefix with sr_ or similar?
-example: libsr_dbk - sip router's library for DB interface compatible with Kamailio
Yes, it might be better to have a "sr_" prefix. Right now in ser we have for some (libser_cds, libser_presence) and no prefix for others (libbinrpc).
Normally they will be installed in their own dir (e.g. /usr/lib/sr and the modules in /usr/lib/sr/modules), but having a separate prefix is even safer.
BTW: to quickly create a library just copy the Makefile from lib/print/ and change the name in it, and add your .c and .h files.
To use a library from a module, just add to the module's Makefile:
SERLIBPATH=../../lib # ser libraries, in the format path/shortname , where shortname is # what will be used for -l SER_LIBS=$(SERLIBPATH)/print/print
Compiling the module will re-compile the library automatically if needed (e.g. some change in it). make install will also re-link the module (needed to change the rpath).
good to know, thanks, I added to sip-router.org wiki for future references and improvements: http://sip-router.org/wiki/devel/create-library
Cheers, Daniel
On Nov 20, 2008 at 23:44, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
I think both of them can co-exists. I see no other conflicts than naming space -- so we need at least renaming of the db directory. Also they can be moved as library.
I did some quick experimental work: - copied kamailio db/* to sip-router/lib/sk_dbk - edited the lib/print Makefile: changed name to sk_dbk and added INCLUDES=-I.. (hack so I don'thave to change all the includes , like ../str.h to ../../str.h)
- modifiedkamailio db_mysql: - Makefile - added: DEFS+=-DKAMAILIO_MOD_INTERFACE SERLIBPATH=../../lib SER_LIBS=$(SERLIBPATH)/sr_dbk/sr_dbk
- changed all the ../../db/*.h includes to ../../lib/sk_dbk/*.h : perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch]
and then it compiled! It even loads (I haven't tested if it actually works but probably it does).
Next I tried speeddial: - same Makefile changes as above - same perl: perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch] - replace act.elem[] with act.val[] - update do_action() call: + struct run_act_ctx h; + init_run_actions_ctx(&h); - if (do_action(&act, _m) < 0) + if (do_action(&h, &act, _m) < 0)
So with very little work (add 3 lines to the makefile and run perl one liner) one can convert a kamailio db module to libsr_dbk (kamailio db interface in a library form).
Luckily there don't seem to be any symbol name conflicts between the ser db api and the kamailio db api so they could coexist in theory (e.g. load both ser mysql and k db_mysql and then you could mix ser db using modules with k db using module).
Shall I commit the lib, or do we try the hard part and write a wrapper for kamailio db api using ser db api?
Andrei
On 21-11 00:59, Andrei Pelinescu-Onciul wrote:
On Nov 20, 2008 at 23:44, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
I think both of them can co-exists. I see no other conflicts than naming space -- so we need at least renaming of the db directory. Also they can be moved as library.
I did some quick experimental work:
- copied kamailio db/* to sip-router/lib/sk_dbk
- edited the lib/print Makefile: changed name to sk_dbk and
added INCLUDES=-I.. (hack so I don'thave to change all the includes , like ../str.h to ../../str.h)
- modifiedkamailio db_mysql:
- Makefile - added:
DEFS+=-DKAMAILIO_MOD_INTERFACE SERLIBPATH=../../lib SER_LIBS=$(SERLIBPATH)/sr_dbk/sr_dbk
- changed all the ../../db/*.h includes to ../../lib/sk_dbk/*.h :
perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch]
and then it compiled! It even loads (I haven't tested if it actually works but probably it does).
Next I tried speeddial:
- same Makefile changes as above
- same perl: perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch]
- replace act.elem[] with act.val[]
- update do_action() call:
- struct run_act_ctx h;
- init_run_actions_ctx(&h);
- if (do_action(&act, _m) < 0)
- if (do_action(&h, &act, _m) < 0)
So with very little work (add 3 lines to the makefile and run perl one liner) one can convert a kamailio db module to libsr_dbk (kamailio db interface in a library form).
Luckily there don't seem to be any symbol name conflicts between the ser db api and the kamailio db api so they could coexist in theory (e.g. load both ser mysql and k db_mysql and then you could mix ser db using modules with k db using module).
Shall I commit the lib, or do we try the hard part and write a wrapper for kamailio db api using ser db api?
Heh :-), I actually tried the same thing today on my train ride back. I converted both the SER db api and the k. db api into libraries and loaded them at the same time.
I then started working on migrating our ser mysql module with k. db_mysql module, but that already takes some changes because there are conflicts in headers, but these changes are minor.
Please commit what you have, I like this approach myself and I was thinking about doing the same, this way we can make modules from both projects work quickly. I then start working on unifying the db drivers.
Jan.
On 11/21/08 02:44, Jan Janak wrote:
On 21-11 00:59, Andrei Pelinescu-Onciul wrote:
On Nov 20, 2008 at 23:44, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
I think both of them can co-exists. I see no other conflicts than naming space -- so we need at least renaming of the db directory. Also they can be moved as library.
I did some quick experimental work:
- copied kamailio db/* to sip-router/lib/sk_dbk
- edited the lib/print Makefile: changed name to sk_dbk and
added INCLUDES=-I.. (hack so I don'thave to change all the includes , like ../str.h to ../../str.h)
- modifiedkamailio db_mysql:
- Makefile - added:
DEFS+=-DKAMAILIO_MOD_INTERFACE SERLIBPATH=../../lib SER_LIBS=$(SERLIBPATH)/sr_dbk/sr_dbk
- changed all the ../../db/*.h includes to ../../lib/sk_dbk/*.h :
perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch]
and then it compiled! It even loads (I haven't tested if it actually works but probably it does).
Next I tried speeddial:
- same Makefile changes as above
- same perl: perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch]
- replace act.elem[] with act.val[]
- update do_action() call:
- struct run_act_ctx h;
- init_run_actions_ctx(&h);
- if (do_action(&act, _m) < 0)
- if (do_action(&h, &act, _m) < 0)
So with very little work (add 3 lines to the makefile and run perl one liner) one can convert a kamailio db module to libsr_dbk (kamailio db interface in a library form).
Luckily there don't seem to be any symbol name conflicts between the ser db api and the kamailio db api so they could coexist in theory (e.g. load both ser mysql and k db_mysql and then you could mix ser db using modules with k db using module).
Shall I commit the lib, or do we try the hard part and write a wrapper for kamailio db api using ser db api?
Heh :-), I actually tried the same thing today on my train ride back. I converted both the SER db api and the k. db api into libraries and loaded them at the same time.
great work! So now we narrow down a lot what has to me migrated for modules to work. MI and statistics will become libraries as well and then many other modules shall work (some statistics done in core and 1-2 mi commands will miss in the first phase).
Then in comes the second big step, config language update -- after that point we are 70% ready.
I then started working on migrating our ser mysql module with k. db_mysql module, but that already takes some changes because there are conflicts in headers, but these changes are minor.
Please commit what you have, I like this approach myself and I was thinking about doing the same, this way we can make modules from both projects work quickly. I then start working on unifying the db drivers.
Guys, you rock ! :-)
On Fri, 2008-11-21 at 01:44 +0100, Jan Janak wrote:
On 21-11 00:59, Andrei Pelinescu-Onciul wrote:
On Nov 20, 2008 at 23:44, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
siputils is the first kamailio module that did succesfully run on sip-core.
I did only 2 small changes:
- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
- s/MIN/MIN_int
There are a few modules that would need a little bit more changes, like everything using core send functions (they changed a bit in ser), do_action() and build_*, but in all this cases these are minor updates.
More will be compileable as soon as we unify the fixups, but I think the biggest problem right now is the DB interface (from a module point of view, we still haven't unified the config file).
I think both of them can co-exists. I see no other conflicts than naming space -- so we need at least renaming of the db directory. Also they can be moved as library.
I did some quick experimental work:
- copied kamailio db/* to sip-router/lib/sk_dbk
- edited the lib/print Makefile: changed name to sk_dbk and
added INCLUDES=-I.. (hack so I don'thave to change all the includes , like ../str.h to ../../str.h)
- modifiedkamailio db_mysql:
- Makefile - added:
DEFS+=-DKAMAILIO_MOD_INTERFACE SERLIBPATH=../../lib SER_LIBS=$(SERLIBPATH)/sr_dbk/sr_dbk
- changed all the ../../db/*.h includes to ../../lib/sk_dbk/*.h :
perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch]
and then it compiled! It even loads (I haven't tested if it actually works but probably it does).
Next I tried speeddial:
- same Makefile changes as above
- same perl: perl -i.bak -pe "s#/db/#/lib/sr_dbk/#" *.[ch]
- replace act.elem[] with act.val[]
- update do_action() call:
- struct run_act_ctx h;
- init_run_actions_ctx(&h);
- if (do_action(&act, _m) < 0)
- if (do_action(&h, &act, _m) < 0)
So with very little work (add 3 lines to the makefile and run perl one liner) one can convert a kamailio db module to libsr_dbk (kamailio db interface in a library form).
Luckily there don't seem to be any symbol name conflicts between the ser db api and the kamailio db api so they could coexist in theory (e.g. load both ser mysql and k db_mysql and then you could mix ser db using modules with k db using module).
Shall I commit the lib, or do we try the hard part and write a wrapper for kamailio db api using ser db api?
Heh :-), I actually tried the same thing today on my train ride back. I converted both the SER db api and the k. db api into libraries and loaded them at the same time.
I then started working on migrating our ser mysql module with k. db_mysql module, but that already takes some changes because there are conflicts in headers, but these changes are minor.
Please commit what you have, I like this approach myself and I was thinking about doing the same, this way we can make modules from both projects work quickly. I then start working on unifying the db drivers.
Jan.
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Jérôme Martin | LongPhone Responsable Architecture Réseau 122, rue la Boetie | 75008 Paris Tel : +33 (0)1 56 26 28 44 Fax : +33 (0)1 56 26 28 45 Mail : jmartin@longphone.fr Web : www.longphone.com