If we set Diversion in split_headers and we get a header like
> "RULTEST, normalaa" <sip:0046341355354340@whatever.net;user=phone>;reason=unconditional
There was false detection of two Diversion headers.
Skip split marker between double quotes to avoid this
Change-Id: Ib2189bc0029f244fd59f14df5b3d1df745271038
(cherry picked from commit a812be8e0f)
(cherry picked from commit f642443991)
(cherry picked from commit 0d478695f4)
Since we use Redis SETs to simulate non-unique indexes, we can use these
SETs to perform a much faster table scan when an appropriate index
exists. For usrloc expiry query in a typical scenario, this brings the
list of key strings that need to be checked down from 170k to 19k.
Change-Id: I1c4841be5cd28ad42196b4da6b5bb3e6e1b6ed50
(cherry picked from commit d53e856128)
Instead of making the COUNT increase and falloff dependent on the number
of results produced, we make it dependent on the query run time. This is
to prevent Redis being blocked by extended consecutive SCAN queries.
Each individual query should not run longer than 100 ms, and we also add
a short pause before going to the next SCAN to give competing queries a
chance to run.
Change-Id: I6b88cacf795513cf3e0aeefc67fbedef8e1bb8c1
(cherry picked from commit 2a23b94027)
We have value-less master keys to keep track of entries. These keys are
useless when looking for fast-searching keys and are not better than a
full table scan, but are erroneously seen as a better key match than
range-matching keys. Therefore just ignore value-less master keys.
Change-Id: Ibc9ad87a42412b6cf21eac47fbe0ee8e39af4aff
(cherry picked from commit 79b4ac5bb75fe83914fddc104a8fc7c7ce2d0681)
(cherry picked from commit 5542caa855)
A recent Kamailio version update has added an extra field to the end of
the gw list returned by load_gws() (the rule ID), which throws off
lcr_rate() as it looks at the last field in each gw string. Reverse the
approach to instead count the number of fields from the start of the
string to allow possible future extension of the field list.
Change-Id: I143e738553cec57047b19d94b6effa59788c1dc9
(cherry picked from commit c896cdd82b)
We should not be calling async-signal-unsafe functions from within
signal handlers. This is in general bad on a non-threaded program,
but probably way worse with threading enabled.
Change-Id: I2931ce394f703b420c491438136029a670c83207
(cherry picked from commit 3cd4b897a2)
Kamailio always checks configs on start and will NOT start
of configs are NOT OK and/or damaged.
The old kamailio SysV init script also had such check
to prevent kamailio _stop_ in case if configs are not OK.
It is not the case for systemd unit file anyway.
There is no reason to check configs and then start kamailio,
it is just wasting of time (each check 1-2 seconds) on Jenkins VMs.
Change-Id: Ic0d3d8efa0ad2a3fb3f9ea5e13fd1204d95f584f
(cherry picked from commit 3811fc2494)
One instance of replacing the EVAL with EVALSHA was missed.
Change-Id: I683a1714d2d80eb25082b97370517938f6c36d36
(cherry picked from commit df7ad22fd1)
dfks_subs_handler does not set default values for XML elements extracted
from the body and ends up doing a strlen(NULL) if the elements are
missing.
Change-Id: I520f9f0a45c35bfb134fac5a0aa275ee3d2613f3
(cherry picked from commit 9d76dcbce9)
- build long orderless lists in reverse (forward list building has
exponential runtime)
- fix mem leaks
Change-Id: I00aa4d6bfd3eda5b37e04e79143b74b3ebd6224e
(cherry picked from commit a57c14951f)
Adding a value-less key makes it a SET that contains all entry keys,
making it possible to use SCARD to count all entries.
Change-Id: I8da92944dda9df9c381d1a08ce23b142af68a69b
(cherry picked from commit 390981eaf2)
KEYS is considerably faster then SCAN, even with just one iteration, and
since we're always reading the full set of keys in one go anyway,
there's no benefit of using multiple SCAN invocations.
Change-Id: I0771db1b90273bf3bf73cb6b53e7d9ef8c43fcc6
(cherry picked from commit 053e45bdfa)
We introduce a special case handling of range matching (< or > operator)
against timestamp key values, as required by the usrloc module. Without
this, the timer handling the removal of expired location entries would
have to a full table scan every time it runs (including at shutdown).
This feature detects the special case (a usable timestamp key type) and
converts the range match into a series of wildcarded SCAN statements. So
instead of doing a single full table scan which mostly returns non
matching rows, we do a series of more specific table scans, each of
which only returns relevant matching rows, or no rows at all.
Change-Id: I6c77b9d595b5f70aed976bdcd0cae329f198937b
(cherry picked from commit 6df6f8718f)
If an update changes the value of a type key, we must propagate that
updated value to the respective type keys.
Change-Id: I7ad5c85aa9e7540e2ac558ca6b8c3125f2dfec9a
(cherry picked from commit 51196c6b27)
When looking for usable type keys, we must consider only types using the
DB "=" operator. Skip type keys that use any other operator.
Change-Id: I2ef696dc6d4930bc63e102c8251082ef9e3ff6b8
(cherry picked from commit 6111fb0605)
Redis is allowed to return an empty list in response to a SCAN even when
the iteration isn't complete yet. Only a zero cursor value returned from
a SCAN is indicative of the SCAN being complete.
Change-Id: Ib5da589c6944fcd46b2bbdc11c200e6a4f7108cb
(cherry picked from commit a29819349b)
* skip pv_headers processing in the callbacks
if the msg pointer is FAKED_REPLY
Change-Id: I1469708f9112c9510f02c4b1e7af72f32a93adc2
(cherry picked from commit 67446d7fb9)
This reverts commit 1192c499ca.
Reverted because ngcp-check-status-integrity complains about integrity
of Debian package files after changes are applied with ngcpcfg framework.
Change-Id: I7d1e998b226712614a681800082ab94979fcd355
(cherry picked from commit 5fea855f16)
In postinst file add commands to move db_redis table descriptor
in /etc/kamailio folder in oreder to be oevrwritten using ngcpcfg
framework
Change-Id: Id855946b59f65ca36c011949db3dfd01556530da
(cherry picked from commit 1192c499ca)