Do not reload trusted table sources in hash buckets,
when the db cache mode is disabled.
This prevents sudden attempt to actually initialize hash buckets,
when the mode is 0.
Change-Id: I3e911905f1d73b94883d1f5550b6638b43b47b9f
Upstream forced static linking of tlsa against libz.a,
because they wanted to statically link towards OpenSSL
(`libssl.a` and `libcrypto.a`).
Hence the transitive linkage was required towards `-l:libz.a`
and turns out on the debian trixie the libz isn't actually
PIC-safe.
See GH #4552
Change-Id: I226858505edff2a9b80fc187b87cc887e3e0613c
db_redis module implicitly supports conversion
of <null> key values into empty "" strings.
Remove empty-string/zero-length guards introduced
previously, because they break this behavior.
E.g.: dialog and usrloc modules can in fact
handle <null> key values.
Additionally: introduce the memcpy() guard.
Change-Id: I96515b8a4dfea6eef16a05b5d9f970946a9fc915
Introduce a list of improvements for size overflow
protection:
- change func signatures to work with `size_t` only
- check the raw pointer and its length
- introduce optional max allowed keys size
This measure will protect inserts from extremely
large key size (e.g. negative length that then
gets into integer overflow) and from triggering
the stack canary.
Change-Id: I7e07e28b0ae398675f9980f42fe2b0f8ed61d51f
Processing a trickle ICE SDP fragment requires the "flags" list to be
present, regardless of how other flags are being processed or if other
flags are even set at all. Create the "flags" list unconditionally as
it's a cheap operation and eliminates a few case distinctions in the
code.
Change-Id: I6e8278b38a869202206e973d06c4a1587db482f5
This commit removes error loglines into kamailio log file in case
dlg_get_var() receives a dlg_var() as fifth variable or more in general
when PVT_OTHER is selected (which is not avp or var).
vars -> id 15
avps -> id 4
xavps -> 17
Change-Id: I727ae5aea12e88b71f73a5e0bb3223fe68e535dc
This reverts commit 2000c2e5b5.
Reason for revert: The problem seems to be with the AVP on the configuration. Also, this check is already done before arriving at this place.
Change-Id: I0be5dd920c0cff606d4d5758908214c9fd5c7446
This patch check if the name passed to $avp was correctly initialized.
If not initialized it will print an error message and return 0 (no match).
Change-Id: Icc84f0ff1103eb759b2282bd76951a8410225910
The function mark_presentity_for_delete() is responsible for flagging
a record in the presentity table for later removal.
Previously, this was done by overwriting the etag field with a fixed, hardcoded string:
static str str_offline_etag_val = str_init("*#-OFFLINE-#*");
However, the etag is intended to uniquely identify each PUBLISH message.
Overwriting it with a constant value violates the following MySQL uniqueness constraint:
UNIQUE KEY presentity_idx (username, domain, event, etag)
For example, when handling multiple PUBLISH messages (e.g., for legA and legB of the same call),
the fields:
- username
- domain
- event
are identical, and uniqueness is ensured solely by the etag.
Replacing it with a fixed string may cause key collisions and trigger MySQL errors.
To address this without altering the database schema or indexes,
str_offline_etag_val is now appended to etag to retain its uniqueness.
Change-Id: Icfff5da5dbaae1c47b4a0f33904a64f3b98ea957
Always use to-tag for NG message with rtpp-flags,
if presented. This change is caused by the processing
logic being moved to rtpengine with rtpp-flags.
Change-Id: Ib656fdccbd366053bab37ef04c48659a6fd3acc1
We are seeing a lot of error messages like:
> ERROR: pua [pua_db.c:895]: get_record_puadb(): Too many rows found (2)
After some investigation I come up with a couple of fixes:
* pua: improve the query to support caller|callee with same pres_id (same dialog)
* pua_dialoginfo: support uuid to generate pres_id to improve randomness
Change-Id: I43d5c58fe20c776b03af217f644443d800c9453e
If the module uses an SDP taken from a pvar, and the current message
uses a multipart content, don't replace the entire message body with the
rewritten SDP, but only the part of the body that is SDP.
Change-Id: I9e43a7c2179c4887f16213c1a2fa2d2bf76b7764
Introduce new function: `allow_register_include_port()`
to be able to check the whole Contact header including port.
Example, register.deny content is:
ALL : "^sip:.*127.0.0.1:5062"
If the Contact is: "Contact: <sip:testuser1004@127.0.0.1:5062>"
then this will check the Contact hf including port of it.
Otherwise if usual `allow_register()` function is used,
then only the "testuser1004@127.0.0.1" will be taken into
account, which will lead the regex to be failing.
The func `allow_register_include_port()` works similarly
as `allow_register()` except it checks Contact's port.
Change-Id: I47820627e8ef91a09d7564d0848d5c356b3017d9
Introduce a versatile behavior of the rtpengine module
in terms of ability to parse flags on the daemon side,
instead of module. Previous behavior is also kept.
General points:
- rtpengine daemon supports rtpp flags processing from now on
- module still provides in the bencode (when calling daemon):
call-id, to/from tags, viabranch (so identification call data)
- even though the module's interface is updated,
a backwards compatibility is given, so no obligatory changes
from kamailio script users required
- each rtpengine module's function which takes rtpp flags
as a parameter, now is able to get a third parameter `viabranch`,
which is used to detect, which approach to use (older/newer):
- without the viabranch - older one used
- with the viabrnach - new one used, so rtpp flags parsing on
the daemoin side
The goal is to deprecate processing of option flags on the module
side and only parse them on the daemon side.
This brings a list of benifits, such as:
- no need to keep in sync daemon and module (for specific flags)
- support of different rtpp flag string formats (raw), so that,
for example, kamailio script users can use plain text or
bencode dictionary like format
Change-Id: I2e7874a6e425d0f25556a45645fa9417cc9f459d