<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Hello,<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Not be able to check right now as well, but if I remember correctly there should be two location table definitions there in the XML files. This is a bit unfortunate, the IMS one name should probably be changed.<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Cheers,<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Henning<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
<span id="OutlookSignature">
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
-- <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Henning Westerholt - <a href="https://skalatan.de/blog/">https://skalatan.de/blog/</a><br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">
Kamailio services - <a href="https://skalatan.de/services">https://skalatan.de/services</a></div>
</span><br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Александър Йосифов <alexyosifov@gmail.com><br>
<b>Sent:</b> Friday, June 21, 2019 8:57:43 AM<br>
<b>To:</b> Henning Westerholt<br>
<b>Cc:</b> sr-dev@lists.kamailio.org<br>
<b>Subject:</b> Re: [sr-dev] Adding new fields in pcscf.location table</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hello <span class="gmail-im">Henning,</span></div>
<div><span class="gmail-im">First to say again that I am working on ims_usrloc_pcscf module and I am using the latest kamailio source code 5.3.0-dev6.</span></div>
<div><span class="gmail-im">I already did what you wrote in the first email, but I am a little bit confused.</span></div>
<div><span class="gmail-im">I found the location table in src/lib/srdb1/schema, but the fields inside the location.xml file are completely different from fields in my local pcscf location table.</span></div>
<div><span class="gmail-im">I did a little experiment:</span></div>
<div><span class="gmail-im">1. Add a new field in src/lib/srdb1/schema/location.xml file:</span></div>
<div><span class="gmail-im"> <column><br>
<name>partition2</name><br>
<type>int</type><br>
<size>11</size><br>
<default>0</default><br>
<description>The value to of the partition2 for keep alive requests</description><br>
</column><br>
</span></div>
<div><span class="gmail-im">2. Execute make dbschmena.</span></div>
<div><span class="gmail-im">3. Changed files:</span></div>
<div><span class="gmail-im"> modified: utils/kamctl/db_berkeley/kamailio/location<br>
modified: utils/kamctl/db_redis/kamailio/location<br>
modified: utils/kamctl/db_sqlite/usrloc-create.sql<br>
modified: utils/kamctl/dbtext/kamailio/location<br>
modified: utils/kamctl/mongodb/kamailio/location.json<br>
<b>modified: utils/kamctl/mysql/usrloc-create.sql</b><br>
modified: utils/kamctl/oracle/usrloc-create.sql<br>
modified: utils/kamctl/postgres/usrloc-create.sql<br>
modified: utils/kamctl/xhttp_pi/pi_framework.xml<br>
modified: utils/kamctl/xhttp_pi/usrloc-mod<br>
modified: utils/kamctl/xhttp_pi/usrloc-table</span></div>
<div><span class="gmail-im">This works great!</span></div>
<div><span class="gmail-im">But bolder table is not the right table for <b>ims_usrloc_pcscf</b> module. Into the source code the fields are placed in src/modules/ims_usrloc_pcscf/usrloc_db.h file and they are completely different from the fields in
<span class="gmail-im">src/lib/srdb1/schema/location.xml</span>. I just listed some of them:</span></div>
<div>
<div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:12px;line-height:16px;white-space:pre">
<div><span style="color:rgb(197,134,192)">#define</span><span style="color:rgb(86,156,214)">
</span><span style="color:rgb(220,220,170)">T_PORTPC_COL</span><span style="color:rgb(86,156,214)"> </span><span style="color:rgb(206,145,120)">"t_port_pc"</span></div>
<div><span style="color:rgb(197,134,192)">#define</span><span style="color:rgb(86,156,214)">
</span><span style="color:rgb(220,220,170)">T_PORTPS_COL</span><span style="color:rgb(86,156,214)"> </span><span style="color:rgb(206,145,120)">"t_port_ps"</span></div>
<div><span style="color:rgb(197,134,192)">#define</span><span style="color:rgb(86,156,214)">
</span><span style="color:rgb(220,220,170)">T_PORTUC_COL</span><span style="color:rgb(86,156,214)"> </span><span style="color:rgb(206,145,120)">"t_port_uc"</span></div>
<div><span style="color:rgb(197,134,192)">#define</span><span style="color:rgb(86,156,214)">
</span><span style="color:rgb(220,220,170)">T_PORTUS_COL</span><span style="color:rgb(86,156,214)"> </span><span style="color:rgb(206,145,120)">"t_port_us"</span></div>
</div>
<span class="gmail-im"></span></div>
<div><span class="gmail-im"><br>
</span></div>
<div><span class="gmail-im">I looked in <span class="gmail-im">utils/kamctl/mysql folder and I found ims_usrloc_pcscf-create.sql file with the exact fields like in
<span class="gmail-im">src/modules/ims_usrloc_pcscf/usrloc_db.h.</span></span></span></div>
<div><span class="gmail-im"><span class="gmail-im"><span class="gmail-im">From my point of view there is no
<span class="gmail-im">src/lib/srdb1/schema/ims_usrloc_pcscf.xml file to make changes to generate the new
<span class="gmail-im"><span class="gmail-im">ims_usrloc_pcscf-create.sql with the new fields.</span></span></span><span class="gmail-im"><span class="gmail-im"><span class="gmail-im"></span></span></span></span></span></span></div>
<div><span class="gmail-im"><br>
</span></div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, 20 Jun 2019 at 23:40, Henning Westerholt <<a href="mailto:hw@skalatan.de">hw@skalatan.de</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Hello,<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
try to grep the table name in the XML. You should be able to find it. <br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Editing the generated SQL files will only work for your local deployment, as they will get overwritten by the next change in the repository.<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Cheers,<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Henning<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<span id="gmail-m_-3936596741704432974OutlookSignature">
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
-- <br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Henning Westerholt - <a href="https://skalatan.de/blog/" target="_blank">https://skalatan.de/blog/</a><br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Kamailio services - <a href="https://skalatan.de/services" target="_blank">https://skalatan.de/services</a></div>
</span><br>
<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Von: Александър Йосифов<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Gesendet: Montag, 17. Juni, 15:38<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Betreff: Re: [sr-dev] Adding new fields in pcscf.location table<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
An: Henning Westerholt<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Cc: <a href="mailto:sr-dev@lists.kamailio.org" target="_blank">sr-dev@lists.kamailio.org</a><br>
<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Hi,<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Thank you for the quick response!<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
I couldn't find the xml file for ims p-cscf user location table in src/lib/srdb1/schema, but I found ims_usrloc_pcscf-create.sql file in utils/kamctl/mysql folder.<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Is it enough and correct to edit this file with the new fields and incremented table version?<br>
<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
On Sat, 15 Jun 2019 at 11:37, Henning Westerholt <<a href="mailto:hw@skalatan.de" target="_blank">hw@skalatan.de</a>> wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Hello Alexsandar,<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
the process is like this:<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
extend the XML db source definition in src/lib/srdb1/schemayou will find some general size/type definitions in the entities.xml file, please use them if possible<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
increment the version number for this particular table in the XML as well<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
you can create the DB specific files locally (needs xsltproc) with "make dbschema"check for the new table version number in the module coding<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
extend the module code to actually use the new fields<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
creating a pull request with the XML and coding changes to integrate it into git master
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
For bigger extensions it might also a good idea to contact the module author to receive some feedback before finishing the implementation. 🙂<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Cheers,<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Henning<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<b><font color="#000000">Von:</font></b><font color="#000000"> sr-dev <</font><a href="mailto:sr-dev-bounces@lists.kamailio.org" target="_blank"><font color="#000000">sr-dev-bounces@lists.kamailio.org</font></a><font color="#000000">> im Auftrag von Александър
Йосифов <</font><a href="mailto:alexyosifov@gmail.com" target="_blank"><font color="#000000">alexyosifov@gmail.com</font></a><font color="#000000">></font><br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<b><font color="#000000">Gesendet:</font></b><font color="#000000"> Freitag, 14. Juni 2019 15:56</font><br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<b><font color="#000000">An:</font></b><font color="#000000"> </font><a href="mailto:sr-dev@lists.kamailio.org" target="_blank"><font color="#000000">sr-dev@lists.kamailio.org</font></a><br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<b><font color="#000000">Betreff:</font></b><font color="#000000"> [sr-dev] Adding new fields in pcscf.location table</font>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Hello,<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
What is the procedure for adding new fields in some DB table?<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
In particular, I am working under a feature for multiple tcp connections for IPSEC in P-CSCF and for this purpose new fields are needed to store pcscf client and server ports for each registered contact.<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
The new fields 'port_pc', 'port_ps', 't_port_pc' and 't_port_ps' should be added in pcscf.location table.<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Thank you for your help!<br>
<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
-- <br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Best Regards,<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Aleksandar Yosifov<br>
</div>
</blockquote>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
-- <br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Best Regards,<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Aleksandar Yosifov<br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>Best Regards,<br>
</div>
Aleksandar Yosifov<br>
</div>
</div>
</div>
</body>
</html>