When a Redis key can be deleted directly, we still need to build the
list of type keys for that table in order to delete dependent entries,
which are the indexes used for faster DB access.
Change-Id: Ib8fdad428946263fc9eba466868347fee219dfbc
* __dialog_created() -> get_dialog_data() -> creates dlg callbacks for
__dialog_sendpublish()
__dialog_sendpublish() can be executed by two different process and
if we use refresh_pubruri_avps_flag shared memory can change in between
Change-Id: Id81b66209c27a900033f557cfa175ca3067aa34c
* remove pvh_remove_xavi()
* rework pvh_set_header():
use core pv_get_spec_*
use PV_IDX_NONE to detect no index case
remove values instead of adding NULL if PV_IDX_ALL
* changes needed from upstream:
https://github.com/kamailio/kamailio/pull/2341
Introducing PV_IDX_NONE so we can know when idx == 0
if $x_hdr(HEADER) or $x_hdr(HEADER[0])
So we can append or set the value
Change-Id: I496d65cc7e0e92167967edfb592fff6a6b0d6e3b
* for split_headers and for applying multi index
headers str_hash_case_get() is now used instead of str_hash_get()
to follow the case insensitive approach
Change-Id: I9c99f91e68836df593e0120596494829aab2363a
* header names are now case insenstitive when used to store
or retrieve values
* check for skip headers should be insensitive too
Change-Id: Ie0f5c45ce5ce24623c6233e342b646525c6081b9
* pv_headers same version from upstream
* move patches contributed upstream from sipwise to upstream
Change-Id: I7a484c589d1c28e869490e2737f94c9daf8bb9ff
Fails due to:
| Traceback (most recent call last):
| File "/usr/lib/x86_64-linux-gnu/kamailio/kamctl/dbtextdb/dbtextdb.py", line 1239, in <module>
| main(sys.argv)
| File "/usr/lib/x86_64-linux-gnu/kamailio/kamctl/dbtextdb/dbtextdb.py", line 1233, in main
| except (Error, e):
| NameError: name 'e' is not defined
Change-Id: I09ed6d0bd1b6fdad5f9b04cd54fef1ee43a44312
* support refreshing info after dlg_manage() is called via a new flag
Find the callee is been resolved way after in our config
* control local identity value via dlg_var
Change-Id: I6c9781626944c427693a30ed0e67d32cc582a714
* don't try to detect branch every time
* reduce use of dynamic memory
* rework reply scenario, keep reply_counter in xavp
* hook to branch event too
Change-Id: I0adf97d4cb2d214e80fae48f8fdc643c1a644cc6
* Modified funtion t_load_contact adding the 'mode' parameter:
- if equals to 0 or missing, it behaves as before (standard behavior)
- if equals to 1, contacts are ordered using a proportional algorithm
that use to q-value to calculate the weight of each contact. Higher
is the q value, higher is the probability to be contacted as first.
* Added new function ki_t_load_contact_mode to be able to set the
'mode' paramenter also from KEMI.
* Additionally a small code refactory has been done in order to
keep the code easier to read and to avoid duplications.
Change-Id: Ic39a70e43004422e2b6e5db4788df68d9e223129
The fix for issues with tls with openssl 1.1.X was not included
on debs due to We set CC_EXTRA_OPTS and LC_EXTRA_OPTS on debian/rules
Change-Id: I5cd35bcbd6f33042a7ef43ddac2c7972273da206
* tls fix is included since 5.2.5
* rename tt41650 patch to more descriptive name
* reorder patches from us
* add upstream links for the ones that have PR
Change-Id: I69c2a7bf8a805744d3eda4ee4294fa1698187b16
* fix sipwise/fix_error_in_cfgt_module.patch:
not_sip needs to be reset for sip messages after non_sip detection
* reorder some patches to avoid confusion
* Let's try to keep the descriptions for patches in order to be
able to track them easily
Change-Id: I11ea589387696f10d2f86b4e65b0dee85175ffbb
* use pvh_ prefix not to collide with pv
* use generic PKG_MEM_ERROR, SHM_MEM_ERROR
* split code into more small files
* create proper source doc
* clang-format with kamailio's settings
Change-Id: I6baaa658ae56763bca48f298e37410966414f270
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
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
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
The upstream parts will get updated when we switch to the next upstream
release as they have already been merged in upstream's master from the
pull request <https://github.com/kamailio/kamailio/pull/2110>.
Change-Id: I6408ee3d47d87be9bbe719b0e6da41e85d875764
It turned out that keep the package name ngcp-kamailio-python-modules,
previous name, after the switch to python3 creates issue during the
building of the related debug symbols.
Issue is solved if we move to the new name ngcp-kamailio-python3-modules.
This is also more consistent to the startard package naming we already
have in use.
Currently during the upgrade to the new kamailo version the new package
have to be installed manually (we never install/use this package in
our standard NGCP systems).
If a customer installed the python2 version of the package should check
itself the compatibility of the created python2 code with python3.
Change-Id: I4e80d11fab53014c0e50848cbafef6e9df16fdce
Necessary because python2 is being removed from Debian, and is
going to be EOL soon enough by python upstream
Change-Id: I98d94cdfdac2d8ebc8d5a22130656d198433f5eb
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
- build long orderless lists in reverse (forward list building has
exponential runtime)
- fix mem leaks
Change-Id: I00aa4d6bfd3eda5b37e04e79143b74b3ebd6224e
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
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
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
If an update changes the value of a type key, we must propagate that
updated value to the respective type keys.
Change-Id: I7ad5c85aa9e7540e2ac558ca6b8c3125f2dfec9a
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
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
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
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
This reduces substantially the debian/rules file, simplifies it, and as
a side-effect also fixes the jobserver warnings previously emitted by
make.
Change-Id: I1347c888ba16aff42be5e0912d03bcd9bf7e919b
When we need to call make from within a Makefile, we should do so by
using the MAKE variable, which has special meaning for make itself.
This makes sure, it will get marked as recursive command, and will
make it possible to use the make jobserver.
Change-Id: I8c37f2906b7e2592cb02912a59c7979b79d33f2a
Since the upgrade to 5.2.3 carrierroute module as been moved to
extra module group, as it don't depends on the libconfuse library
anymore. Thus it can be integrated in the main kamailio package.
Change-Id: Ia904ac665258174c85bd88bfd32c99b9535c0a92
* add modparam=auto_msg that is enabled by default
and if the tm module is also loaded it automatically
collects and applies the headers on incoming request/reply
and when a request/reply is forwarded
* for SIP_REPLY messages the FL_NAME_PV_HDRS_COLLECTED,
FL_NAME_PV_HDRS_COLLECTED flags are applied for the message
of the branch
Change-Id: Ife3a8d92ecd33263c35e554bb8da364ee3f03703
* add $x_rs that gets and sets reply status
(SIP_REPLY only)
* add $x_rr that gets and sets reply reason
(SIP_REPLY only)
Change-Id: I3d8cced49998f7cfb718cdb73038b85caf234cde
* branch indexes start internally from 0 where
0=transaction and 1=branch.0, etc. that is
to comply to the setbflag/isbflagset dset approach
Change-Id: I129a360258e7ec1fdde0736849bd1587b944a5eb
* fix pv_xavp_get_child to correctly pick
either branch headers (if cloned) or ones
from the default transaction
Change-Id: Ibf686042bdf06dc6da688740262d62c0293ea16d
* fix a scenario when multi headers were
duplicated
* adjust pv_single_header() and pv_skip_header()
to return 1 on true and 0 on false instead of 1 and -1
Change-Id: I8c7a316241d503bf67d57c74a104e3edc85690ac
* address a bug where parsed headers for a branch
were cloned from the headers. now parsed
headers are not cloned (they are reparsed in the branch upon
accessing them).
Change-Id: Iea48f1bd58713fbbfda6fbfdd8605ce7ab3a375e
* rework branch index retreival from msg->add_to_branch_s
* branches are stored in the xavp as pv_headers#branch_index
* improve FL_PV_HDRS_COLLECTED and FL_PV_HDRS_APPLIED flags
handling per branches or default transaction
Change-Id: If353c06b9b4351d206fd2d5daf0171a2f21b5f1c
* rvalue in $x_hdr and other pseudovariables
can now be also an integer. it is internally
converted into a string.
* fix a typo with SIP_URI_T type check
Change-Id: I682eae1f436f67fbfe3dd90c4785a82957ac362c
* check for scenarios where either msg->ruid.s
or branch ruid.s is NULL
* adjust collected/applied flags handling,
they are now handled per branch. when headers are applied
for a branch, the applied flag is not set for branches
Change-Id: I2eea6510ce0789deaec209f9c4d194192184a68e
* branches now have isolated modified headers
* headers stored in branches use headers#uid=>.. as
as the xavp name left part where the transaction
as headers=>...
Change-Id: I12e35b1be349281c3ff14548755a91e26ad5c740
We should honor the DEB_BUILD_OPTIONS parallel=N option and enable
paralell builds for all make(1) invocations, not just the main one.
Change-Id: I6aa0ae7e251aa5d9657a44581f4403ad6cfb073d
This is needed when checking if a subscriber is still registered
with a certain parameter in the path.
Change-Id: I698a2f595979885e92336197e9543ba212730f31
* $x_hdr get with a null header name returns $null now
* $x_hdr set with a null header name returns a pv_header
related error instead of pvapi one as it uses
now pv_get_spec_value instead of pv_get_spec_name
* adjust pv_elem_p free up behaviour as it is a pointer
Change-Id: Ib675286e753989b8bf803fabf0a9592ea867cd4b
* $x_hdr now behaves correctly and get/set correct value
if header name in $x_hdr is specified as AVP_NAME_STR
Change-Id: I34978a44a0f8d4af2dd94f7999a561f76729987d
commit 814d5cc1f4f5b1e4b95737108dffc1e7d7bd566f
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Feb 28 20:15:36 2019 +0100
tm: put back t in wait timer if still referenced more than once
- have a safety upper limit for putting back in wait timer
- special credits to Yufei Tao for testing and helping to troubleshoot
Change-Id: I998626945bca5793db84987acf10bbbfb15bb405
* pv_value_t format is now parsed only if the type is PV_VAL_STR
* pv_elem_free() is now called only if pv_value_t string was parsed,
otherwise it causes operation on an invalid pointer
Change-Id: Ic9d58fd5019732f24519d9d59da09c14a426afe6
commit 40d971af44b60b2c14dcc22693d41ec4ee4af33b
topos: execute event_route[topos:sending] with current sip message to be sent
- if drop is used, then the message processing with topos is skipped
- event route is executed after event_route[topos:outgoing]
- new parameter event_mode to control what event_route blocks are executed
Change-Id: I0eb49716c8e88af61470ec262128f30357444bb7
- Kamailio-Proxy requires redis-server for every operation
- Kamailio-LB uses redis only if kamailio.lb.security.topos.enable set to 'yes'
Change-Id: I50f8914d514ffacdf2d84f19b74e8e0af34faec8
* this module enables working with headers
in the kamailio config on the variable level
and only performing the real message header
changes once in the route exit block.
Change-Id: I97ab3ee72a429c3ea92b4bd72f57b822d6091e47
Those are the commits taken from upstream version to fix the issue:
- f21554c6befaddbc82016d5d498e11ab3720c404
- 5b223a2e8a92f351b8eab756f5256fda7645ff21
- 1aad02edc6b9ffb104900cbc624f0853166ae926
- 35dec4c20d78f49ba242229c877894d70c94705c
Change-Id: I538cf7141ad4311520ec9a6ceded71b99fb93626
Quoting from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892538
| kamailio depends or build-depends on GCJ. GCJ has been dropped
| upstream since GCC 7, so we are dropping it from Debian. Thus please
| either drop support for GCJ if you are just building an alternative
| package with GCJ support (e.g. ant-gcj, ecj-gcj) or switch to
| default-jdk / default-jre as appropriate.
Adjusting to Debian's kamailio.git change as of::
| commit 2e2722970a2921dd149156dc7f19cba52299f868
| Author: Victor Seva <linuxmaniac@torreviejawireless.org>
| Date: Thu Mar 22 16:35:14 2018 +0100
|
| remove kamailio-java-modules (closes: #892538, #893701)
Change-Id: Id3e92a376292fd4c1e5f29c7e9a4fb52f2e55f60
Import commit fcf1d3d778a903852b6e21103a23bd7fd6e3bbc9 from upstream that
solves the issue with masking Contact in 302 response from UAS.
Change-Id: I13ffa4d17c80d6dbf2e509d82e30980931e54cbe
- allow_trusted() now can take optional parameter of value to match.
- provided parameter will be used instead of From header in match_res() and match_hash_table()
- documentation extended with 3-arguments allow_trusted() function description
Change-Id: I45226cbba489bd7a60e7d8481777401b4f52024f
* avp_subst(dst, subst_rx)
- "subst_rx" now supports pvars
in addition to the static string
e.g.:
- avp_subst("$avp(s:dst)", "$avp(s:my_subst)");
- avp_subst("$avp(s:dst)", "$(rU{uri.param,my_subst})");
- inline mixed pvars are not supported
- static subst values are precomplied during the module init
(as it was before)
- dynamic pvar subst regex is evaluated and compiled on
each avp_subst() call
- optimise internal param handling for static subst values,
they are stored as (fparam_t*)->type==FPARAM_SUBST
Change-Id: Iea7a91ba87b892edd6fa405aa7cc285d69d9caa9
The function is necessary to extract the FCI code from the
variable instead of reading it from the SIP message.
Change-Id: If8a19d205e1ccad64e44cfa75501daa672165a59
When iterating through entry keys while searching for proper key,
reset manual key count when going to next entry key to avoid
writing beyond manaul key array.
Also fix memleak when deleting via table scan, where scanned
keys and manual keys were not properly deleted.
Also fix memleak when deleting in general, where type keys
were not properly deleted.
Change-Id: I60bb57ec95d863ace89a927341a9031bf67723ad
The kamailio-proxy daemon really requires a mariadb instance running,
otherwise it will fail to even start. It might be able to manage a
mariadb instance disappearing for a short period of time during normal
operation depending on the options given.
Fixes: commit 27c63cdf14
Change-Id: I3d59b48f8054d402a3609fef43a9f617a7d47216
Make sure to not dereference con->con in error handling, as it
could be null due to failed reconnect attempt.
Change-Id: I06c3b1e26803b7ffc05c9c2fcbfbf2d27dc58163
We removed the init script, let's cleanup fully. Remove now obsolete
preinst maintscript. And remove unused and incorrectly named lintian
override file.
Change-Id: Ie08720a5c44d27f698de52f038608b47e5901ce7
The current problem is massive services restart on: systemctl restart glusterd.service
which is not really necessary on NGCP.
Use 'Wants' instead of 'Requires' so dependent services aren't
restarted on restart of remote-fs.target.
Change-Id: Ie2b776b02bdf28f0fba0bdb6301f1d0b4f932daf
Is service B "Requires" service A to be started before B
and B does NOT require B restart on A restart, B should use "Wants=A".
Change-Id: Ie2dce6571d2086f5478e90f726bf0a0cbcdc68c4
This is a revert of what fixed in upstream commit
57c4ec824fdd6c6c797bd7d6bfb3d65159a8d7c6
Exchanging from and to tag was causing a missed notification
to the subscribers.
Change-Id: If10597c4df3927c6fbbbe21c4a585acbbd94a673
When pre-loading e.g. the location table with >50k records,
we have to make sure to:
* scan and process DB_ROWs in batch of 1000 to balance a
trade-of between number of redis commands and memory
consumption
* prepend to list of keys instead of append in order to keep
this operation as O(1)
Change-Id: Ifc4a2318af4a786391bcae4001f658aea28d1099
The files are not copied/installed in the package correctly, probably because
there are different calls to dh_installinit with different --name parameters,
but not any invocation in which "ngcp-kamailio" or the others are used, thus the
files are ignored.
Change-Id: Iec42bf7e78a83f74961af37878a94effd05d1f91
Migrate to use proper systemd unit files for full support, and thus to increase
consistency when bringing up and shutting down the system, or when restarting
services, to have more integration with the init system as a whole.
As part of this change and since we are revamping the init support, we also
remove sysvinit support.
There are systemd-unit files for different distributions under pkg/kamailio, but
we have a special set-up in which "-lb" and "-proxy" are different services.
Change-Id: Ib8b4c335339f6362503f6c74f637058a81a81e51
Hiredis sends queued commands to redis only after first call
of getReply, and if that fails, we need to have the appended
commands queued up, so we can re-queue them and re-execute
again after reconnect.
Also refresh code using upstream fixes, like declaring vars
at the beginning of functions instead of inline in for() loops.
Change-Id: I2de5da00818aaa27d3c10ba81074cfa83083e5b5
In the system there were some naming inconsistency between templates
and init scripts. Move everything to use "minus" convention in order
to have everything name 'kamailio-lb' and 'kamailio-proxy'.
Change-Id: I7bd90a7b5b2af5007c6b368f40d8064852c95966
If we do not wait, and make sure kamailio is not running any more, we
exit and it's still running which means a subsequent start will see the
service is indeed aready running and exit successfully. Add the needed
--retry options to start-stop-daemon.
Change-Id: I4bfbd394ca5233478d68361e4084b36f03afa435
- Update debian/.gitignore file.
- Switch to automatic debug symbol packages.
- Let debhelper handle DEB_BUILD_OPTIONS by itself.
- Do not specify init script runlevels, we use the LSB metadata instead.
Change-Id: I77aab74becf0dedc5922ba7f7c3489c6793495d3
* Switch the init script from sh to bash
* Fix shellcheck warnings
* Rename ngcp-check_active to new ngcp-check-active
Change-Id: I40d2974097f87135ae3900919f47f399427e3720
- Bump debhelper compatibility version 10.
- Switch from Priority extra to optional.
- Canonicalize Homepage URL.
- New debian/.gitignore file.
Change-Id: I41785c6cfafb71b4f012e8bbcc91f6202dadc131
With newer OpenSSL versions it seems a threaded application needs to
cleanup properly, otherwise the now automatic atexit() cleanup handler
will segfault when the pthread variables have been deallocated already
by the pthreads library.
Change-Id: I08ac91cf63b1a74c17a0bd70b40202a5baf7771f
> dpkg-source: info: applying upstream/dialog-check-if-dialog-exists-after-event-route-exec.patch
> patching file modules/dialog/dlg_handlers.c
> Hunk #1 succeeded at 1179 (offset -47 lines).
> Hunk #2 succeeded at 1276 (offset -47 lines).
> Hunk #3 FAILED at 1368.
> 1 out of 3 hunks FAILED
> dpkg-source: info: the patch has fuzz which is not allowed, or is malformed
> dpkg-source: info: if patch 'upstream/dialog-check-if-dialog-exists-after-event-route-exec.patch' is correctly applied by quilt, use 'quilt refresh' to update it
Change-Id: I61458d08945784b7e38fff598fa5aa6cb2c879da
* [to|from]_avp module parameters
* sca_call_info_update() fallback if no Contact
header is present
* implement unsubscribe for call-info
* use rr is_direction() to select tag for search
* fix core on RPC command release_appearance
* fix on-hold detection when direction is upstream
Change-Id: I29c71374da6ae918b82a32987e5d9a52a252e478
* sipwise/tm-deep-cloning-of-the-request-for-fake-environment.patch
introduced a memory leak on reset_path_vector()
Change-Id: Iec8341920e54c769fdc6107765d9a6401a3f64b0
* use server_address as contact of SUBSCRIBE reply too
* use To header info as target of SUBSCRIBE when in-dialog
* fix sca_call_info_update() params
* change onhold_bflag parameter behavior
Change-Id: I5d112e9187ed6eccce0c44422605482530ab7671
> proxy[]: WARNING: db_mysql [km_dbase.c:85]: db_mysql_submit_query(): driver error on ping: Lost connection to MySQL server during query
Change-Id: Ieea5064451ea27a855942f060731d766740bde1a
This is the Kaspch specification for LNP. This is
asynchronous so We've added some pv command helper
functions in order to copy $var -> $xavp and
$xavp -> $var
upstream/pv-pv_var_to_xavp.patch was merged upstream at
https://github.com/kamailio/kamailio/pull/309
upstream/pv-pv-xavp_to_var.patch was merged upstream at
https://github.com/kamailio/kamailio/pull/316
upstream/pv-pv_xavp_to_var.patch was merged upstream at
https://github.com/kamailio/kamailio/pull/320
tcap: added inap_extract_var() in order to get the info
from a var. Info needs to be a binary string in hexadecimal
NO SPACES!!
Change-Id: I346c98a877085feeeff3ca49d3625304dfe5e344