With the increased length of src/dst_leg strings, we must also increase
the buffer size for the insert string.
Did I mention that we should really move to dynamic strings here...
Change-Id: I0e77155d36f434055e36124d37bf699179f887b1
This is relevant for records coming from Redis, as the insertion into
the trash and backup tables is done from the strings kept in memory.
Change-Id: I1398f7bfc0d4a0c2da8b8104dc4589ea9d983da7
Strings, in particular call IDs, that are coming from Redis are not
necessarily valid UTF-8 since Redis doesn't really do UTF-8. The MySQL
DB schema expects strings in valid UTF-8 however (even though call IDs
really should be raw binary strings), resulting in an error if an
UTF-8 invalid string is attempted to be inserted.
Solve this by verifying each string's UTF-8 correctness before inserting
it, and forcing it to be interpreted as the 100% permissive latin1
charset if it isn't.
Change-Id: I5a218083bc4e3d7a47d1f77911f7ef9a88ce9bd2
(cherry picked from commit 0b22ffbd52)
medredis_fetch_records() allocates memory for 0 return records, which in
the calling code is understood as "no memory has been allocated",
leading to a slow leak. Returning early is correct as the mem block
pointer is set to NULL in this case.
Change-Id: I69a2d397edd15cb9e4033531a218658c7ca93b12
(cherry picked from commit 96e59f70f5)
This is necessary to avoid issues with ACC records in the
OLD format during an upgrade.
It should be changed to back to -1 in mr9.+
Change-Id: I81097c0823343de066ec436d6f43a4ed279f372f
(cherry picked from commit a99934c121)
Tha value is readed from the last field of the the ACC srcleg.
It contains the ID of the peer_host from where the call was received.
Mediator uses it to find the correct peering_contract_id to write in
the CDR.
Change-Id: I2cfb7d0fadb5ade265fde3c1778475eda431a453
(cherry picked from commit 87ec80a553)
This is necessary to avoid issues with ACC records in the
OLD format during an upgrade.
It should be changed back to -1 in mr8.+
Change-Id: Iebaa7f59fc343fedb46fdfee3381e9349ddd80d6
The DB schema allows for certain columns to be NULL. Handle this
appropriately to elminiate failed assertions from g_strlcpy.
Change-Id: I8768847b96b169dfad94b2ca448cc2af5058d38b
We must distinguish between old-style acc records without an appended
branch ID (key ends in `:<ts>`) and broken new-stype acc records with an
empty branch ID (key ends in `:<ts>:`). Failure to do so results in
leftover entries in the DB that are never trashed and repeatedly
processed.
Change-Id: I61a4086359369e460cf23cacfd53854605a6a955
The db_redis module also writes simulated non-unique keys for acc
records, so we must use handle them appropriately when deleting the
keys, because otherwise we get leftover entries.
Change-Id: Ic080dc5d4520ac548a726440d0b677028bfb6be3
(cherry picked from commit 7618456ec7)
The mediator is doing nothing when maintenance mode is enabled,
it has been implemented in TT#16753 but later after migration to
systemd and after migration to unit 'type=notify' we forget to send READY=1.
Fixing it here, as it cause 90 seconds delay on ngcpcfg apply on
active node if maintenance mode is enabled.
Change-Id: I66c3dc13506f7069ec60c56edcbe875b4a9912e4
(cherry picked from commit aa7536b359)
* cdr_tag_data value is now escaped
* simplified cdr_group group escaping code to
bring in line with how it is in the other places
Change-Id: Ie10242fed9d4430247f8ac534b19679d38206fee
(cherry picked from commit 0bf9cbd660)
* callid that is used in sql statements is now escaped,
for scenarios where there are calls with quotes in callids
Change-Id: I3061a73fe944ec911e84031a1cff40043b7e174c
(cherry picked from commit 024994e45e)
These produce too much output, and spam the log files. Make them debug
level output so that we can still see them if desired, but not shown by
default.
Change-Id: Iec8037c0c60d3f221811a4baeabdbb4daeed95ce
Instead of hardcoding -I/usr/include/mysql for CFLAGS and -lmysqlclient
for LDFLAGS, let's use mariadb_config if available (e.g. on
Debian/buster), try mysql_config otherwise (e.g. on Debian/stretch) or
if neither of them is available, fallback to -I/usr/include/mysql +
-lmysqlclient.
No longer include `m_string.h`, it was moved towards
/usr/include/mariadb/server/m_string.h and is no longer compatible when
used as such:
| /usr/include/mariadb/server/m_string.h:89:23: error: unknown type name 'uchar'; did you mean 'char'?
| extern void bmove_upp(uchar *dst,const uchar *src,size_t len);
Also no longer use libmysqlclient15-dev as alternative Build-Depend,
it's not available in neither stretch nor buster.
While at it drop include for my_global.h, since it shouldn't be included
anymore (and it doesn't seem to be relevant for us, compiling fine as-is
on Debian/stretch and Debian/buster):
| /usr/include/mariadb/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
Change-Id: I74a75ea24f72880adb8117ae5808095f03bc0edb