[sr-dev] Adding new fields in pcscf.location table

Henning Westerholt hw at skalatan.de
Fri Jun 21 10:04:57 CEST 2019


Hello,

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.

Cheers,

Henning


--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

________________________________
From: Александър Йосифов <alexyosifov at gmail.com>
Sent: Friday, June 21, 2019 8:57:43 AM
To: Henning Westerholt
Cc: sr-dev at lists.kamailio.org
Subject: Re: [sr-dev] Adding new fields in pcscf.location table

Hello Henning,
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.
I already did what you wrote in the first email, but I am a little bit confused.
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.
I did a little experiment:
1. Add a new field in src/lib/srdb1/schema/location.xml file:
    <column>
        <name>partition2</name>
        <type>int</type>
        <size>11</size>
        <default>0</default>
        <description>The value to of the partition2 for keep alive requests</description>
    </column>
2. Execute make dbschmena.
3. Changed files:
        modified:   utils/kamctl/db_berkeley/kamailio/location
        modified:   utils/kamctl/db_redis/kamailio/location
        modified:   utils/kamctl/db_sqlite/usrloc-create.sql
        modified:   utils/kamctl/dbtext/kamailio/location
        modified:   utils/kamctl/mongodb/kamailio/location.json
        modified:   utils/kamctl/mysql/usrloc-create.sql
        modified:   utils/kamctl/oracle/usrloc-create.sql
        modified:   utils/kamctl/postgres/usrloc-create.sql
        modified:   utils/kamctl/xhttp_pi/pi_framework.xml
        modified:   utils/kamctl/xhttp_pi/usrloc-mod
        modified:   utils/kamctl/xhttp_pi/usrloc-table
This works great!
But bolder table is not the right table for ims_usrloc_pcscf 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 src/lib/srdb1/schema/location.xml. I just listed some of them:
#define T_PORTPC_COL        "t_port_pc"
#define T_PORTPS_COL        "t_port_ps"
#define T_PORTUC_COL        "t_port_uc"
#define T_PORTUS_COL        "t_port_us"

I looked in utils/kamctl/mysql folder and I found ims_usrloc_pcscf-create.sql file with the exact fields like in src/modules/ims_usrloc_pcscf/usrloc_db.h.
From my point of view there is no src/lib/srdb1/schema/ims_usrloc_pcscf.xml file to make changes to generate the new ims_usrloc_pcscf-create.sql with the new fields.


On Thu, 20 Jun 2019 at 23:40, Henning Westerholt <hw at skalatan.de<mailto:hw at skalatan.de>> wrote:
Hello,

try to grep the table name in the XML. You should be able to find it.

Editing the generated SQL files will only work for your local deployment, as they will get overwritten by the next change in the repository.

Cheers,

Henning


--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services



Von: Александър Йосифов
Gesendet: Montag, 17. Juni, 15:38
Betreff: Re: [sr-dev] Adding new fields in pcscf.location table
An: Henning Westerholt
Cc: sr-dev at lists.kamailio.org<mailto:sr-dev at lists.kamailio.org>


Hi,
Thank you for the quick response!
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.
Is it enough and correct to edit this file with the new fields and incremented table version?


On Sat, 15 Jun 2019 at 11:37, Henning Westerholt <hw at skalatan.de<mailto:hw at skalatan.de>> wrote:
Hello Alexsandar,

the process is like this:

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
increment the version number for this particular table in the XML as well
you can create the DB specific files locally (needs xsltproc) with "make dbschema"check for the new table version number in the module coding
extend the module code to actually use the new fields
creating a pull request with the XML and coding changes to integrate it into git master
For bigger extensions it might also a good idea to contact the module author to receive some feedback before finishing the implementation. 🙂

Cheers,

Henning
Von: sr-dev <sr-dev-bounces at lists.kamailio.org<mailto:sr-dev-bounces at lists.kamailio.org>> im Auftrag von Александър Йосифов <alexyosifov at gmail.com<mailto:alexyosifov at gmail.com>>
Gesendet: Freitag, 14. Juni 2019 15:56
An: sr-dev at lists.kamailio.org<mailto:sr-dev at lists.kamailio.org>
Betreff: [sr-dev] Adding new fields in pcscf.location table

Hello,
What is the procedure for adding new fields in some DB table?
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.
The new fields 'port_pc', 'port_ps', 't_port_pc' and 't_port_ps' should be added in pcscf.location table.

Thank you for your help!


--
Best Regards,
Aleksandar Yosifov


--
Best Regards,
Aleksandar Yosifov




--
Best Regards,
Aleksandar Yosifov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190621/b7af4c5d/attachment-0001.html>


More information about the sr-dev mailing list