In advance of the 5.5.2 release, note that for full IPv6 addresses with proto, brackets, and a full 5-digit port, the `varchar(50)` is too small to hold the information in `fromip` and `toip`. Also, it appears (at least for PostgreSQL) that Kamailio stores to the `message` column as `bytea`, rather than text, so perhaps that should be reflected in the table setup scripts.
The postgres script (utils/kamctl/postgres/siptrace-create.sql) has type TEXT for msg field. I do not use postgres to be able to comment more, if something needs to be changed, a PR is appreciated.
For the fromip/toip, I increased the size in schema definition, but the sizes of columns can be adjusted as needed per deployment, there is no real constraint on size, as some db engines are size-less (eg., dbtext, db_berkeley) -- for those that have a size in the definition is more like what was commonly ok-ish so far.
Closed #2831.
Thank you @miconda. I'll take a deeper look into the PostgreSQL TEXT type for the `msg` field and create a pull request if necessary. I was looking through other scripts that use `bytea` for message body-type fields, such as msilo, presence, and rls. They all seem to insert the [bytea Hex format](https://www.postgresql.org/docs/current/datatype-binary.html#id-1.5.7.12.9) rather than text, but I'll have to investigate more.
I vaguely remember there was another similar discussion about postgres and some time of encoding for specific columns ... not sure it was here on tracker or on mailing lists, you may try to search the archives and see if something pops up.
As I understand what need to do for PostgreSQL
1) use XML datatype where is possible; 2) switch to use default bytea_output and implement proper handling for bytea values
More details https://github.com/kamailio/kamailio/issues/1255
On Tue, Aug 24, 2021 at 9:09 AM Daniel-Constantin Mierla < ***@***.***> wrote:
I vaguely remember there was another similar discussion about postgres and some time of encoding for specific columns ... not sure it was here on tracker or on mailing lists, you may try to search the archives and see if something pops up.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/2831#issuecomment-904351115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATRRQMGXRYP2A27YRXYEGDT6MZSXANCNFSM5CTIV7BQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
In the case of sip_trace, I don't think Kamailio is a consumer of the data it places there, so a simple change to the column type works on my end--that allows other programs to use `convert_from(msg, 'UTF-8')` properly in selecting the output. It also keep PostgreSQL from using escape encoding on the text field (which is just inefficient).
As I stated, I'll do more digging to see if anything else (other than updating the column type) would need updating in Kamailio (but it doesn't look like it so far).