sip-router
23 hours agopkg/kamailio/deb: fix bookworm and sid build master
Victor Seva [Sat, 4 Dec 2021 15:52:26 +0000 (16:52 +0100)]
pkg/kamailio/deb: fix bookworm and sid build

* no python2 and dh-systemd package available

42 hours agolrkproxy:some features add to lrkproxy module
Mojtaba Esfandiari.S [Fri, 3 Dec 2021 21:11:51 +0000 (00:41 +0330)]
lrkproxy:some features add to lrkproxy module

add 'gt' option for optimization port resource allocation
add 'custom_sdp_ip_avp' option for handling NAT client

2 days agotsilo: reworked checking ruri and contact parameters
Daniel-Constantin Mierla [Thu, 2 Dec 2021 15:12:01 +0000 (16:12 +0100)]
tsilo: reworked checking ruri and contact parameters

- removed module name from log messages

2 days agosqlite: module group creation
JailBird [Wed, 24 Nov 2021 09:50:59 +0000 (03:50 -0600)]
sqlite: module group creation

- Add sqlite as an option to Makefile.groups
- Add sqlite to INSTALL documentation

2 days agopkg/kamailio/deb: Add bookworm support
Victor Seva [Fri, 3 Dec 2021 09:59:33 +0000 (10:59 +0100)]
pkg/kamailio/deb: Add bookworm support

4 days agocore: reworked string-number conversion to catch out of limits values
Daniel-Constantin Mierla [Wed, 1 Dec 2021 08:34:28 +0000 (09:34 +0100)]
core: reworked string-number conversion to catch out of limits values

5 days agocore: added #!defenvs preprocessor directive
Daniel-Constantin Mierla [Tue, 30 Nov 2021 10:10:43 +0000 (11:10 +0100)]
core: added #!defenvs preprocessor directive

- similar to #!defenv, but the value is enclosed in double quotes to
make it covenient to be used as a string token

5 days agoMerge pull request #2960 from apogrebennyk/apogrebennyk/db_redis_update
Andreas Granig [Tue, 30 Nov 2021 10:03:07 +0000 (11:03 +0100)]
Merge pull request #2960 from apogrebennyk/apogrebennyk/db_redis_update

db_redis: don't leave unconsumed redis replies in case of error

5 days agopv: extend $cnt to work with $xavp
Nicolas C [Thu, 18 Nov 2021 12:40:07 +0000 (13:40 +0100)]
pv: extend $cnt to work with $xavp

As suggested in previous PR (#2936).
This is much more flexible as we also handle sub XAVPs and indexes.

5 days agomodules: readme files regenerated - presence ... [skip ci]
Kamailio Dev [Tue, 30 Nov 2021 07:46:13 +0000 (08:46 +0100)]
modules: readme files regenerated - presence ... [skip ci]

5 days agopresence: docs - note the version for default behaviour change on 202 reply
Daniel-Constantin Mierla [Tue, 30 Nov 2021 07:32:16 +0000 (08:32 +0100)]
presence: docs - note the version for default behaviour change on 202 reply

5 days agomodules: readme files regenerated - presence ... [skip ci]
Kamailio Dev [Tue, 30 Nov 2021 07:31:19 +0000 (08:31 +0100)]
modules: readme files regenerated - presence ... [skip ci]

5 days agopresence: return 200 instead of 202 by default
Laurențiu Nicola [Mon, 22 Nov 2021 17:29:25 +0000 (19:29 +0200)]
presence: return 200 instead of 202 by default

5 days agodispatcher: Not possible to deactivate probing of destination by reload
Morten Tryfoss [Sat, 27 Nov 2021 20:14:41 +0000 (21:14 +0100)]
dispatcher: Not possible to deactivate probing of destination by reload

If ds_probing_mode is set to 3, flag in the dispatcher entry needs to include 8
for probing to happen.

Changing a destination to not include this anymore while the destination do
not respond to OPTIONS will cause the probing flag to be re-added because of the
delayed response. A restart will fix it.

We need to check against the probing flag in the CB function to determine if
we should continue probing this destination. If probing is deativated while
waiting for a reply, we should abort.

5 days agomodules: readme files regenerated - tm ... [skip ci]
Kamailio Dev [Mon, 29 Nov 2021 16:46:20 +0000 (17:46 +0100)]
modules: readme files regenerated - tm ... [skip ci]

5 days agoFix TM Module Doc unmatched_cancel param
Zion Dials [Sat, 27 Nov 2021 16:42:27 +0000 (11:42 -0500)]
Fix TM Module Doc unmatched_cancel param

6 days agocore: protect for unsigned int value overflow on string convert
Daniel-Constantin Mierla [Mon, 29 Nov 2021 10:24:51 +0000 (11:24 +0100)]
core: protect for unsigned int value overflow on string convert

6 days agocore: protect for int value overflow on string convert
Daniel-Constantin Mierla [Sun, 28 Nov 2021 16:51:05 +0000 (17:51 +0100)]
core: protect for int value overflow on string convert

6 days agocore: flags - use unsigned literal for bit shifting operations
Daniel-Constantin Mierla [Sun, 28 Nov 2021 09:39:02 +0000 (10:39 +0100)]
core: flags - use unsigned literal for bit shifting operations

6 days agonat_traversal: declare flag literal as unsigned
Daniel-Constantin Mierla [Sat, 27 Nov 2021 14:24:45 +0000 (15:24 +0100)]
nat_traversal: declare flag literal as unsigned

- GH #2954

7 days agodb_redis: don't leave unconsumed redis replies in case of error on update 2960/head
Andrii Pogrebennyk [Sun, 28 Nov 2021 07:34:36 +0000 (08:34 +0100)]
db_redis: don't leave unconsumed redis replies in case of error on update

Execute db_redis_consume_replies on failed update same as in db_redis_insert:
if db_redis_perform_update encounters an error it was leaving unconsumed data
thus causing unexpected reply later on when reading from the same connection.

8 days agomodules: readme files regenerated - uac_redirect ... [skip ci]
Kamailio Dev [Fri, 26 Nov 2021 21:46:22 +0000 (22:46 +0100)]
modules: readme files regenerated - uac_redirect ... [skip ci]

9 days agouac_redirect: use inter-module acc api instead of config export lookup
Daniel-Constantin Mierla [Fri, 26 Nov 2021 14:32:54 +0000 (15:32 +0100)]
uac_redirect: use inter-module acc api instead of config export lookup

- use acc functions via inter-module acc api, intead of config file
function export lookup, to get the right signature and avoid workaround
of fixing a modparam like a function param and improper access of
expected fields by offset
- GH #2953

10 days agoacc: expose accounting functions via inter-module api
Daniel-Constantin Mierla [Thu, 25 Nov 2021 12:36:59 +0000 (13:36 +0100)]
acc: expose accounting functions via inter-module api

10 days agotls: get local/remote issuer line via $tls(key)
Daniel-Constantin Mierla [Thu, 25 Nov 2021 08:55:31 +0000 (09:55 +0100)]
tls: get local/remote issuer line via $tls(key)

- new keys: m_issuer_line, p_issuer_line

11 days agotls: new config variable $tls(key)
Daniel-Constantin Mierla [Wed, 24 Nov 2021 08:30:22 +0000 (09:30 +0100)]
tls: new config variable $tls(key)

- return attributes related to tls communication
- first implemented keys:
  - m_subject_line - return local (my) certificate subject line
  - p_subject_line - return remote (peer) certificate subject line

11 days agotls: update DH initialization for OpenSSL 1.1.x
SPChan [Mon, 22 Nov 2021 14:55:30 +0000 (22:55 +0800)]
tls: update DH initialization for OpenSSL 1.1.x

For OpenSSL 3.x, this will fix a deprecation warning.

11 days agocore: clarification for -b cli parameter
Daniel-Constantin Mierla [Tue, 23 Nov 2021 16:22:42 +0000 (17:22 +0100)]
core: clarification for -b cli parameter

11 days agocore: print udp sock fd in debug messages of probe_max_receive_buffer()
Daniel-Constantin Mierla [Tue, 23 Nov 2021 16:12:48 +0000 (17:12 +0100)]
core: print udp sock fd in debug messages of probe_max_receive_buffer()

12 days agoMerge pull request #2934 from kamailio/nats-connection-ptr
Emmanuel Schmidbauer [Tue, 23 Nov 2021 12:59:26 +0000 (07:59 -0500)]
Merge pull request #2934 from kamailio/nats-connection-ptr

nats: move nats connection handling into a struct in order to extend features

12 days agomisc: update ims pcscf register example
Aleksandar Yosifov [Mon, 22 Nov 2021 16:28:28 +0000 (18:28 +0200)]
misc: update ims pcscf register example

- Updated ims pcscf register script file
with removing of ck/ik in 401 Challenge reply.

12 days agotls: fix wrong macro used to detect OpenSSL 1.1.0+
SPChan [Mon, 22 Nov 2021 13:59:12 +0000 (21:59 +0800)]
tls: fix wrong macro used to detect OpenSSL 1.1.0+

12 days agopv: added {val.ne} transformation
Daniel-Constantin Mierla [Mon, 22 Nov 2021 17:54:02 +0000 (18:54 +0100)]
pv: added {val.ne} transformation

- return empty string if the variable value is $null

13 days agotls: try to print sni on tls error
Daniel-Constantin Mierla [Sun, 21 Nov 2021 18:21:01 +0000 (19:21 +0100)]
tls: try to print sni on tls error

13 days agoapp_python3: Python >= 3.7 call PyOS_AfterFork_Parent in main context after all forks
Anthony Alba [Mon, 22 Nov 2021 03:46:25 +0000 (11:46 +0800)]
app_python3: Python >= 3.7 call PyOS_AfterFork_Parent in main context after all forks

2 weeks agonats: move nats connection handling into a struct in order to extend features nats-connection-ptr 2934/head
Emmanuel Schmidbauer [Fri, 19 Nov 2021 12:24:29 +0000 (07:24 -0500)]
nats: move nats connection handling into a struct in order to extend features

2 weeks agomodules: readme files regenerated - kazoo ... [skip ci]
Kamailio Dev [Fri, 19 Nov 2021 11:46:21 +0000 (12:46 +0100)]
modules: readme files regenerated - kazoo ... [skip ci]

2 weeks agokazoo: Allow optional AMQP-headers in kazoo_query and kazoo_publish
mihovilkolaric [Tue, 9 Nov 2021 22:25:02 +0000 (23:25 +0100)]
kazoo: Allow optional AMQP-headers in kazoo_query and kazoo_publish
- implements GH #2895

2 weeks agoMerge pull request #2879 from ErhanOnur/fix_ims_usrloc_pcscf_protocol
carstenbock [Fri, 19 Nov 2021 09:26:20 +0000 (10:26 +0100)]
Merge pull request #2879 from ErhanOnur/fix_ims_usrloc_pcscf_protocol

ims_usrloc_pcscf:  fix on saving protocol info into DB

2 weeks agomodules: readme files regenerated - tsilo ... [skip ci]
Kamailio Dev [Fri, 19 Nov 2021 08:31:15 +0000 (09:31 +0100)]
modules: readme files regenerated - tsilo ... [skip ci]

2 weeks agotsilo: Merge similar functions in ts_append.c
Donat Zenichev [Wed, 17 Nov 2021 14:27:37 +0000 (16:27 +0200)]
tsilo: Merge similar functions in ts_append.c

We need to merge similar functions in ts_append.c implementation
to give less work for maintaining similar code.
Furthermore the purpose of them is quite the same,
but differes just in some details (usage of TM's API).

Merged functions are:
- ts_append() and ts_append_by_contact()
- ts_append_to() and ts_append_by_contact_to()

Now all appending in TSILO happens only through ts_append() / ts_append_to()
An implementation in tsilo.c has been updated accordingly.

Usage.
In case we do not want to append based on specific Contact (location),
the contact parameter being passed to either ts_append() or ts_append_to()
must be set to zero.
In case we do want to append by a specific Contact, then we must
set the Contact parameter of str type beforehand calling ts_append() / ts_append_to().

2 weeks agotsilo: Be compliant with changes in TM, now only t_append_branches()
Donat Zenichev [Sun, 14 Nov 2021 21:13:15 +0000 (23:13 +0200)]
tsilo: Be compliant with changes in TM, now only t_append_branches()

Since of changes in TM's module, where 't_append_branches()' and
't_append_branch_by_contact()' have been merged into one function,
we need to edit all the occurences where TM's API is called
in TSILO.

No logic changes.

2 weeks agotm: merge t_append_branches() and t_append_branch_by_contact()
Donat Zenichev [Sun, 14 Nov 2021 20:59:58 +0000 (22:59 +0200)]
tm: merge t_append_branches() and t_append_branch_by_contact()

Because the implementation of the functions
't_append_branches()' and 't_append_branch_by_contact()' is pretty
much the same, it's proposed to merge them into one:
't_append_branches()'

The way how the function acts now depends on if the contact
parameter of str type is given or not (empty or not).
If the contact parameter is given, then only a desired location
is meant for appending. If not found in the location table,
an append will not happen for this AOR.

Otherwise create branches for all existing location records
of this particular AOR. Search for locations is done in the location table.

2 weeks agotm: API improvement, new function introduced: t_append_branch_by_contact()
Donat Zenichev [Fri, 12 Nov 2021 15:16:37 +0000 (17:16 +0200)]
tm: API improvement, new function introduced: t_append_branch_by_contact()

New module functions introduced:
- t_append_branch_by_contact()

This commit introduces a possibility of TM's API to append a branch
based on specific location (Contact's URI).

Indeed the 't_append_branch_by_contact()' is a corrected copy of
the 't_append_branches()', which instead takes Contact as a parameter
of str type.

The separate function has been introduced, in order to save full
back-compatibility, and not affect existing implementation.

2 weeks agotsilo: Add support of a lookup and branch creating by contact
Donat Zenichev [Fri, 12 Nov 2021 13:30:44 +0000 (15:30 +0200)]
tsilo: Add support of a lookup and branch creating by contact

Improvement of the TSILO module, which allows to run a lookup using the provided RURI,
but only to create a new branch for the Contact, which is set in the currently processed REGISTER.
Or optionally a Contact URI value given as a parameter to the function.
If the Contact URI for a lookup, is given as a parameter,
it is possible to provide it as a pseudo-variable.

Hence it is now possible to append new branch(es) for only UAC(s)
getting REGISTERED at the moment of calling 'ts_append_by_contact()'.

Previously it was only possible to call 'ts_append()' and create new branches
for all previously present location records (for this specific URI), which was in some circumstsances undersired.

New script functions introduced:
- ts_append_by_contact(table, ruri [, contact])

New module functions introduced:
- w_ts_append_by_contact2() / ki_ts_append_by_contact()
- w_ts_append_by_contact3 / ki_ts_append_by_contact_uri()
- ts_append_by_contact() / ts_append_by_contact_to()

Backwards compatibility is saved, the new functionality is not overlapping with
the previously existing implementation, hence it only acts when the new script function
ts_append_by_contact() is used.

The documentation has been updated accordingly.

2 weeks agopv: check source for memcpy
Daniel-Constantin Mierla [Fri, 19 Nov 2021 07:57:25 +0000 (08:57 +0100)]
pv: check source for memcpy

2 weeks agoRevert "pv: handle case when var value ha flag str but null pointer"
Daniel-Constantin Mierla [Fri, 19 Nov 2021 07:45:09 +0000 (08:45 +0100)]
Revert "pv: handle case when var value ha flag str but null pointer"

This reverts commit 6eb67eaa4fc27d1eb7da7b2b674ffe8e7f86ecbc.

2 weeks agoRevert "pv: fix condition in detecting the null string value when setting $var(...)"
Daniel-Constantin Mierla [Fri, 19 Nov 2021 07:44:49 +0000 (08:44 +0100)]
Revert "pv: fix condition in detecting the null string value when setting $var(...)"

This reverts commit ffe311939ebf58e7418940ec6c71bfaf9b21afad.

2 weeks agocore: re - check source of memcpy
Daniel-Constantin Mierla [Fri, 19 Nov 2021 07:25:45 +0000 (08:25 +0100)]
core: re - check source of memcpy

2 weeks agocore: mechanism to execute child_init() for special ranks on demand
Daniel-Constantin Mierla [Thu, 18 Nov 2021 13:33:28 +0000 (14:33 +0100)]
core: mechanism to execute child_init() for special ranks on demand

- new special rank PROC_POSTCHILDINIT, to execute child_init() for main
process only when ksr_module_set_flag(KSRMOD_FLAG_POSTCHILDINIT) is
executed in mod_init()

2 weeks agonathelper: fix_nated_sdp added ignoring RFC3605-param if omitted vseva/2768
Dmitry Wagin [Tue, 15 Jun 2021 12:58:12 +0000 (15:58 +0300)]
nathelper: fix_nated_sdp added ignoring RFC3605-param if omitted

- doesn't throw an error while "a=rtcp" param is omitted (RFC1889 behavior) or address is omitted
- replace_sdp_ip() returns 0 on omitted IP-address
- added param can_omit to replace_sdp_ip()

fixes #2784 regression introduced by #2497

2 weeks agopv: new transformation class {val}
Daniel-Constantin Mierla [Wed, 17 Nov 2021 16:16:17 +0000 (17:16 +0100)]
pv: new transformation class {val}

- {val.n0} - return int 0 instead of $null value, or existing value
- {val.json} - if value is $null, return empty string; if value is
  string, then it is escaped for use as json value (without surrounding
  quotes)

2 weeks agocore: relocate str json escape function to strutils
Daniel-Constantin Mierla [Wed, 17 Nov 2021 11:49:56 +0000 (12:49 +0100)]
core: relocate str json escape function to strutils

2 weeks agopv: new variable $rsi - return status code for replies and 0 for requests
Daniel-Constantin Mierla [Tue, 16 Nov 2021 08:10:38 +0000 (09:10 +0100)]
pv: new variable $rsi - return status code for replies and 0 for requests

2 weeks agocore: new flag p for json logging
Daniel-Constantin Mierla [Tue, 16 Nov 2021 07:38:43 +0000 (08:38 +0100)]
core: new flag p for json logging

- prefix is printed as it is in the root json, expected to be a list of
json field starting with comma

2 weeks agomodules: readme files regenerated - presence ... [skip ci]
Kamailio Dev [Mon, 15 Nov 2021 18:16:14 +0000 (19:16 +0100)]
modules: readme files regenerated - presence ... [skip ci]

2 weeks agopresence: add option to return 200 instead of 202 on subscriptions
Laurențiu Nicola [Thu, 11 Nov 2021 16:51:59 +0000 (18:51 +0200)]
presence: add option to return 200 instead of 202 on subscriptions

RFC6665 mandates 200 return codes, although 202 seems mandated by
RFC3265. We add a new parameter, `subs_respond_200`, to control this.

2 weeks agomodules: readme files regenerated - permissions ... [skip ci]
Kamailio Dev [Mon, 15 Nov 2021 09:46:22 +0000 (10:46 +0100)]
modules: readme files regenerated - permissions ... [skip ci]

2 weeks agopermissions: add trusted_cleanup_interval documentation [skip ci]
Victor Seva [Mon, 15 Nov 2021 09:29:59 +0000 (10:29 +0100)]
permissions: add trusted_cleanup_interval documentation [skip ci]

2 weeks agopermissions: trusted_cleanup_interval
Victor Seva [Thu, 4 Nov 2021 14:11:12 +0000 (15:11 +0100)]
permissions: trusted_cleanup_interval

cleanup old data of trusted hash_table by timer function.

2 weeks agopermissions: don't remove old data at the end of the reload process
Victor Seva [Thu, 4 Nov 2021 13:34:47 +0000 (14:34 +0100)]
permissions: don't remove old data at the end of the reload process

2 weeks agoctl: use unsigned int for bit left shifting
Daniel-Constantin Mierla [Sun, 14 Nov 2021 19:23:08 +0000 (20:23 +0100)]
ctl: use unsigned int for bit left shifting

- deal with runtime error: left shift of X by N places cannot be represented in type 'int'

3 weeks agoacc: set again the type of db vals
Daniel-Constantin Mierla [Sat, 13 Nov 2021 19:31:38 +0000 (20:31 +0100)]
acc: set again the type of db vals

- work properly when nullable modparam is set and var can be null on
some transactions

3 weeks agocore: json logging - apply j flag for prefix field
Daniel-Constantin Mierla [Fri, 12 Nov 2021 13:17:18 +0000 (14:17 +0100)]
core: json logging - apply j flag for prefix field

3 weeks agocore: new option for json logging to print message in json format
Daniel-Constantin Mierla [Fri, 12 Nov 2021 09:38:04 +0000 (10:38 +0100)]
core: new option for json logging to print message in json format

- option 'j' - if the log message starts with '{' and ends with '}',
then it is expected to be a json document, printed as it is in the
message value, otherwise it is printed as field "text"

3 weeks agocore: io wait - remove log level string from debug message
Daniel-Constantin Mierla [Fri, 12 Nov 2021 09:15:07 +0000 (10:15 +0100)]
core: io wait - remove log level string from debug message

3 weeks agoacc: simplify index shifting for adding time variants in db accounting
Daniel-Constantin Mierla [Thu, 11 Nov 2021 19:39:10 +0000 (20:39 +0100)]
acc: simplify index shifting for adding time variants in db accounting

3 weeks agoacc: debug messages to print the type of extra acc attrs
Daniel-Constantin Mierla [Thu, 11 Nov 2021 11:59:11 +0000 (12:59 +0100)]
acc: debug messages to print the type of extra acc attrs

3 weeks agoctl: use unsigned literals for left bit shifting
Daniel-Constantin Mierla [Wed, 10 Nov 2021 19:09:24 +0000 (20:09 +0100)]
ctl: use unsigned literals for left bit shifting

3 weeks agopv: fix condition in detecting the null string value when setting $var(...)
Daniel-Constantin Mierla [Tue, 9 Nov 2021 18:04:16 +0000 (19:04 +0100)]
pv: fix condition in detecting the null string value when setting $var(...)

- issue introduced in previous commit

3 weeks agomodules: readme files regenerated - posops ... [skip ci]
Kamailio Dev [Mon, 8 Nov 2021 12:01:18 +0000 (13:01 +0100)]
modules: readme files regenerated - posops ... [skip ci]

3 weeks agoposops: docs for pos_set_char()
Daniel-Constantin Mierla [Mon, 8 Nov 2021 11:46:53 +0000 (12:46 +0100)]
posops: docs for pos_set_char()

3 weeks agoposops: added posops_set_char() function
Daniel-Constantin Mierla [Sun, 7 Nov 2021 17:17:21 +0000 (18:17 +0100)]
posops: added posops_set_char() function

4 weeks agokamctl: srv modules subcommand
Daniel-Constantin Mierla [Sat, 6 Nov 2021 21:11:37 +0000 (22:11 +0100)]
kamctl: srv modules subcommand

- list the loaded modules

4 weeks agopkg/kamailio/obs: packaged nats module
Sergey Safarov [Sat, 6 Nov 2021 09:31:21 +0000 (12:31 +0300)]
pkg/kamailio/obs: packaged nats module

4 weeks agomodules: readme files regenerated - acc ... [skip ci]
Kamailio Dev [Fri, 5 Nov 2021 10:46:16 +0000 (11:46 +0100)]
modules: readme files regenerated - acc ... [skip ci]

4 weeks agoacc: updated docs for acc_extra_size and cdr_extra_size
Daniel-Constantin Mierla [Fri, 5 Nov 2021 10:37:22 +0000 (11:37 +0100)]
acc: updated docs for acc_extra_size and cdr_extra_size

4 weeks agobuild: detect GCC 11
Anthony Alba [Fri, 5 Nov 2021 09:38:24 +0000 (17:38 +0800)]
build: detect GCC 11

4 weeks agoapp_python3: for Python >= 3.7 call pre-fork hook
Anthony Alba [Fri, 5 Nov 2021 09:31:34 +0000 (17:31 +0800)]
app_python3: for Python >= 3.7 call pre-fork hook

4 weeks agocore: reorder fields of struct _cfg_group for better alignment
Daniel-Constantin Mierla [Thu, 4 Nov 2021 16:15:12 +0000 (17:15 +0100)]
core: reorder fields of struct _cfg_group for better alignment

4 weeks agopkg/kamailio/deb: version set 5.6.0~dev2
Victor Seva [Thu, 4 Nov 2021 10:31:41 +0000 (11:31 +0100)]
pkg/kamailio/deb: version set 5.6.0~dev2

4 weeks agopua_dialoginfo: fix memory corruption
Victor Seva [Thu, 4 Nov 2021 10:07:49 +0000 (11:07 +0100)]
pua_dialoginfo: fix memory corruption

* don't use SRUID_SIZE, just reserve the proper generated size
* call sruid_init() at child_init too

4 weeks agopv: handle case when var value ha flag str but null pointer
Daniel-Constantin Mierla [Thu, 4 Nov 2021 07:24:06 +0000 (08:24 +0100)]
pv: handle case when var value ha flag str but null pointer

4 weeks agoMakefile.defs: version set to 5.6.0-dev2
Daniel-Constantin Mierla [Thu, 4 Nov 2021 07:06:31 +0000 (08:06 +0100)]
Makefile.defs: version set to 5.6.0-dev2

4 weeks agodrouting: remove unused trim function
Daniel-Constantin Mierla [Wed, 3 Nov 2021 12:27:20 +0000 (13:27 +0100)]
drouting: remove unused trim function

4 weeks agoxhttp_pi: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:57:53 +0000 (21:57 +0100)]
xhttp_pi: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agonat_traversal: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:51:24 +0000 (21:51 +0100)]
nat_traversal: use TIME_T_FMT

The size of the time_t destination is unknown as it is depending on the
platform. So we "read into a known-size integer (either int or long
long) and then assign the value to a time_t as a second step" (quote
from [1]).

[1] https://stackoverflow.com/questions/4171478/how-to-read-data-into-a-time-t-variable-using-scanf

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agoims_usrloc_scscf: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:51:03 +0000 (21:51 +0100)]
ims_usrloc_scscf: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agoims_registrar_scscf: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:50:48 +0000 (21:50 +0100)]
ims_registrar_scscf: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agoims_registrar_pcscf: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:50:29 +0000 (21:50 +0100)]
ims_registrar_pcscf: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agoims_icscf: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:50:16 +0000 (21:50 +0100)]
ims_icscf: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agoims_dialog: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:50:02 +0000 (21:50 +0100)]
ims_dialog: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agoims_charging: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:49:45 +0000 (21:49 +0100)]
ims_charging: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agodb_redis: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:49:27 +0000 (21:49 +0100)]
db_redis: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agocdp: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:49:17 +0000 (21:49 +0100)]
cdp: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agoauth_identity: use TIME_T_FMT
Sebastian Kemper [Sun, 31 Oct 2021 20:48:55 +0000 (21:48 +0100)]
auth_identity: use TIME_T_FMT

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agocore: add support for time64 libcs
Sebastian Kemper [Fri, 22 Oct 2021 23:23:40 +0000 (01:23 +0200)]
core: add support for time64 libcs

libcs are implementing changes to fix the year 2038 issue on 32 bit
platforms (see [1]). musl libc already went ahead and implemented it,
starting with musl-1.2.0 (see [2]).

This commit adds the groundwork for always using the "lld" format when
dealing with time_t and casting the values to be formatted to (long
long). The aim is to be future proof and portable.

Example warning when not using TIME_T_FMT while compiling for a 32 bit
target using a time64 libc:

In file included from auth_identity.c:50:
auth_identity.c: In function 'check_date':
../../core/dprint.h:316:73: warning: format '%ld' expects argument of type 'long int', but argument 11 has type 'time_t' {aka 'long long int'} [-Wformat=]
  316 |                                                         fprintf(stderr, "%2d(%d) %s: %.*s%s%s%s" fmt, \
      |                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~
../../core/dprint.h:340:25: note: in expansion of macro 'LOG_FX'
  340 |                         LOG_FX(facility, level, lname, prefix, _FUNC_NAME_, fmt, ## args)
      |                         ^~~~~~
../../core/dprint.h:346:25: note: in expansion of macro 'LOG_FL'
  346 |                         LOG_FL(facility, level, NULL, prefix, fmt, ## args)
      |                         ^~~~~~
../../core/dprint.h:349:25: note: in expansion of macro 'LOG_FP'
  349 |                         LOG_FP(DEFAULT_FACILITY, (level), LOC_INFO, fmt, ## args)
      |                         ^~~~~~
auth_identity.c:594:17: note: in expansion of macro 'LOG'
  594 |                 LOG(L_INFO, "AUTH_IDENTITY VERIFIER: Outdated date header value (%ld sec)\n", tnow - tmsg + glb_iauthval);
      |                 ^~~

[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
[2] https://musl.libc.org/time64.html

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 weeks agomodules: readme files regenerated - acc ... [skip ci]
Kamailio Dev [Wed, 3 Nov 2021 12:01:41 +0000 (13:01 +0100)]
modules: readme files regenerated - acc ... [skip ci]

4 weeks agoMerge pull request #2891 from smititelu/increase_defines
Daniel-Constantin Mierla [Wed, 3 Nov 2021 11:59:34 +0000 (12:59 +0100)]
Merge pull request #2891 from smititelu/increase_defines

acc: increase extra and cdr variables

4 weeks agoMerge pull request #2896 from sergey-safarov/GH2892
Daniel-Constantin Mierla [Wed, 3 Nov 2021 11:58:14 +0000 (12:58 +0100)]
Merge pull request #2896 from sergey-safarov/GH2892

core: fixed route hash table cleanup