<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.18.3">
</HEAD>
<BODY>
Guys, you rock ! <IMG SRC="cid:1227261812.24113.0.camel@anice.longphone.fr" ALIGN="middle" ALT=":-)" BORDER="0"><BR>
<BR>
On Fri, 2008-11-21 at 01:44 +0100, Jan Janak wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On 21-11 00:59, Andrei Pelinescu-Onciul wrote:
&gt; On Nov 20, 2008 at 23:44, Daniel-Constantin Mierla &lt;<A HREF="mailto:miconda@gmail.com">miconda@gmail.com</A>&gt; wrote:
&gt; &gt; 
&gt; &gt; 
&gt; &gt; On 11/20/08 22:36, Andrei Pelinescu-Onciul wrote:
&gt; &gt; &gt;siputils is the first kamailio module that did succesfully run on
&gt; &gt; &gt;sip-core.
&gt; &gt; &gt;
&gt; &gt; &gt;I did only 2 small changes:
&gt; &gt; &gt;- added DEFS+=-DKAMAILIO_MOD_INTERFACE to the Makefile
&gt; &gt; &gt;- s/MIN/MIN_int 
&gt; &gt; &gt;
&gt; &gt; &gt;There are a few modules that would need a little bit more changes, like
&gt; &gt; &gt;everything using core send functions (they changed a bit in ser),
&gt; &gt; &gt;do_action() and build_*, but in all this cases these are minor updates.
&gt; &gt; &gt;
&gt; &gt; &gt;More will be compileable as soon as we unify the fixups, but I think the
&gt; &gt; &gt;biggest problem right now is the DB interface (from a module point
&gt; &gt; &gt;of view, we still  haven't unified the config file).
&gt; &gt; &gt;  
&gt; &gt; I think both of them can co-exists. I see no other conflicts than naming 
&gt; &gt; space -- so we need at least renaming of the db directory. Also they can 
&gt; &gt; be moved as library.
&gt; 
&gt; I did some quick experimental work: 
&gt; - copied kamailio db/* to sip-router/lib/sk_dbk
&gt; - edited the lib/print Makefile: changed name to sk_dbk and
&gt;  added INCLUDES=-I.. (hack so I don'thave to change all the includes
&gt;  , like ../str.h to ../../str.h)
&gt; 
&gt; - modifiedkamailio db_mysql:
&gt;  - Makefile - added:
&gt;  DEFS+=-DKAMAILIO_MOD_INTERFACE
&gt;  SERLIBPATH=../../lib
&gt;  SER_LIBS=$(SERLIBPATH)/sr_dbk/sr_dbk
&gt; 
&gt;  - changed all the ../../db/*.h includes to ../../lib/sk_dbk/*.h :
&gt;   perl -i.bak -pe &quot;s#/db/#/lib/sr_dbk/#&quot; *.[ch]
&gt; 
&gt;  
&gt;  and then it compiled! It even loads (I haven't tested if it actually
&gt;  works but probably it does).
&gt; 
&gt; Next I tried speeddial:
&gt;  - same Makefile changes as above
&gt;  - same perl: perl -i.bak -pe &quot;s#/db/#/lib/sr_dbk/#&quot; *.[ch]
&gt;  - replace act.elem[] with act.val[]
&gt;  - update do_action() call:
&gt;    + struct run_act_ctx h;
&gt;    + init_run_actions_ctx(&amp;h);
&gt;    - if (do_action(&amp;act, _m) &lt; 0)
&gt;    + if (do_action(&amp;h, &amp;act, _m) &lt; 0)
&gt; 
&gt; So with very little work (add 3 lines to the makefile and run perl one
&gt; liner) one can convert a kamailio db module to libsr_dbk
&gt;  (kamailio db interface in a library form).
&gt; 
&gt; Luckily there don't seem to be any symbol name conflicts between the 
&gt; ser db api and the kamailio db api so they could coexist in theory
&gt;  (e.g. load both ser mysql and k db_mysql and then you could mix ser db
&gt;  using modules with k db using module).
&gt; 
&gt; Shall I commit the lib, or do we try the hard part and write a 
&gt;  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
<A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
<A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<B><FONT SIZE="2"><FONT COLOR="#808080">J&#233;r&#244;me Martin </FONT></FONT></B><B><FONT SIZE="2"><FONT COLOR="#bebebe">| </FONT></FONT></B><B><FONT SIZE="2"><FONT COLOR="#99cc00">LongPhone</FONT></FONT></B><BR>
<B><FONT SIZE="2"><FONT COLOR="#808080">Responsable Architecture R&#233;seau</FONT></FONT></B><BR>
<FONT SIZE="2"><FONT COLOR="#bebebe">122, rue la Boetie | 75008 Paris </FONT></FONT><BR>
<FONT SIZE="2"><FONT COLOR="#bebebe">Tel :&nbsp; +33 (0)1 56 26 28 44</FONT></FONT><BR>
<FONT SIZE="2"><FONT COLOR="#bebebe">Fax : +33 (0)1 56 26 28 45</FONT></FONT><BR>
<FONT COLOR="#c0c0c0">Mail :</FONT><FONT COLOR="#99cc00"> </FONT><FONT COLOR="#99cc00"><B><FONT SIZE="2">jmartin</FONT></B></FONT><FONT SIZE="2"><FONT COLOR="#bebebe">@longphone.fr</FONT></FONT><BR>
<FONT COLOR="#c0c0c0">Web :</FONT><FONT COLOR="#99cc00"> <A HREF="http://www.longphone.com">www.longphone.com</A></FONT><BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>