New upstream version 5.7.2

mr12.0 upstream/5.7.2
Victor Seva 2 years ago
parent 088172471d
commit f3fa76d96b

@ -1,3 +1,278 @@
===================== 2023-09-27 Version 5.7.2 Released =====================
===================== Changes Since Version 5.7.1 ===========================
commit 0a91d8a6f25c83094e0ff7cc0f16ecfe3488b378
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Sep 27 09:00:32 2023 +0200
Makefile.defs: version set to 5.7.2
commit 5b31a87cb90c4f81bc48b4f0f1fbd52825967de3
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Sep 27 08:45:03 2023 +0200
pkg: deb specs updated for v5.7.2
commit 549e7903ef40086d933c756b43e35a1d22a38401
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Sep 27 08:43:49 2023 +0200
pkg: version set to 5.7.2 for rpms and alpine specs
commit 5d07b647680543752512ae89b8ec23fa9a2cbd8a
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Sep 27 08:01:48 2023 +0200
kamctl: updated the version to reflect kamailio series
commit 2f0b2189f52927cdcb17c63087d31e637c4b716f
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Sep 27 08:01:04 2023 +0200
etc/kamailio.cfg: updated the version in comments
commit f764cef139d55adb5d38ffc6a1a65fd14bda5f4c
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Sep 26 08:06:42 2023 +0200
rabbitmq: backport of RABBITMQ_ERR_CREATE needed for handling allocation error
commit e202f597e1725c204eb33fa7b6266d9ce934be09
Author: Kamailio Dev <kamailio.dev@kamailio.org>
Date: Mon Sep 25 20:02:22 2023 +0200
modules: readme files regenerated - modules ... [skip ci]
commit 1f27bdfc5cc25b9d2f06204169131d9843cc252a
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon Sep 25 19:51:26 2023 +0200
Revert "pv_headers: compare result of pvh_set_xavi() with NULL for error cases"
This reverts commit 3bb59945d59ae438897a8f797dc2f06489728459.
commit 9be895a16c91bcf4eb299ce0ffb14624755baa48
Author: Дилян Палаузов <git-dpa@aegee.org>
Date: Fri Aug 25 20:54:52 2023 +0200
[app_lua] clarify the file scripts can be in source or bytecode
(cherry picked from commit a8747aa02ff3fbffd7a63bdc1e5c06188472edfa)
commit 59d0ebe41017c2270b62f6171285bae02673da3a
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Sep 7 14:16:49 2023 +0200
core: parser - set via->params.len when body is finished
(cherry picked from commit 82b0f273e1cf65051b6c50301c5073dce56c1149)
commit 35f0efadeceaecc8e3315f4682d9ac4eba36e363
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Aug 23 13:03:02 2023 +0200
msilo: cast to fix storage size warning
(cherry picked from commit c11fcbbe9ed19bc54b800100d15d9ae269735f0c)
commit 34885ab83c0c259376ffda04b41253eb9271780f
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed Aug 23 10:55:35 2023 +0200
pv_headers: compare result of pvh_set_xavi() with NULL for error cases
- the function returns a pointer
(cherry picked from commit 5633026f90e46f7d6da8c1a658d425e8926f6949)
commit fac1995c8730a83c24036c9d01d52b674291860b
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon Sep 25 19:30:25 2023 +0200
db_redis: free db_keys in case of failure
- backport of 027c2b30b39a7596c8630c06995ddc49bb42d789
commit 3a217af6b9229989b3c7a788a01609e9513024c4
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue Aug 22 17:09:37 2023 +0200
rabbitmq: proper check for allocated pointer
(cherry picked from commit 4d58141ab84cf248e8c44a96181642ad0f187e80)
commit 34a2d87479d1bcc37d74f3d8fcb4186aea90fc84
Author: Rick Barenthin <rick@ng-voice.com>
Date: Tue Aug 15 22:30:58 2023 +0200
core: cfg.y typo in parsing XAVPVIAFIELDS
In the XAVPVIAFIELDS block there is the string written to the wrong variable.
The string is stored in _ksr_xavp_via_params.s but the lenght is stored in _ksr_xavp_via_fields.len. This breaks XAVPVIAPARAMS and XAVPVIAFIELDS.
(cherry picked from commit 722a79a9ba8ca2608e699ec14684ce004ae10d60)
commit 516894e37e53bf17d29a4c95add29df7f70bcb8f
Author: Henning Westerholt <hw@gilawa.com>
Date: Tue Aug 15 14:16:07 2023 +0000
ims_ipsec_pcscf: typo in spi_add function definition, GH #3513
- fix typo in spi_add function definition
- patch from jbipre2, GH #3513
(cherry picked from commit a053bcc391f0680ecd5f458d2512e57f69499d39)
commit 774b464af7c561e49253066e8ce3b4ee55463d9a
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Sat Aug 12 13:30:39 2023 +0200
xhttp: note about available variables during http request processing
(cherry picked from commit 170067e633ef32ea7b17adad46fdfe2c85fadda0)
commit 5b1592900920143c9ce5c188e2835c1afd27d489
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Aug 11 20:16:37 2023 +0200
http_async_client: docs - dependency on libevent
- list style for dependencies and links to projects
(cherry picked from commit f16d2658bbefb7a9f43076cbaa958fb3a27f6a0c)
commit 90bd4424e17bc07a9073fd50bbd6d8b608ad4da9
Author: Дилян Палаузов <git-dpa@aegee.org>
Date: Sat Jul 22 14:15:09 2023 +0200
etc/ typos
(cherry picked from commit 6e9335ff2245596b74bc1c749d1e7805bf186f02)
commit 9276342ea90acffc3d631c6175c1f70c5c4fbacc
Author: Дилян Палаузов <git-dpa@aegee.org>
Date: Wed Jun 21 21:29:41 2023 +0200
mohqueue: typo
(cherry picked from commit 0dcaaed5148cba775cebfd88d8e4a593f8c4297d)
commit 3e197c7c41c97badece29cbc6477119180b8dcad
Author: MVONDO Eric OBS/OINIS <bycl2332@orange.com>
Date: Tue Jun 20 10:22:48 2023 +0100
siptrace: fix pseudo var direction attribute length
(cherry picked from commit 508886c3054a8470fe4469e78e63aa37ae93922d)
commit 1b42a7036714a0e50bc61bd9e0619f9a2d36bcf8
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Jul 7 17:41:15 2023 +0200
registrar: increase max size for user and domain building aor
- renamed max aor lenght define to match the user and domain style
(cherry picked from commit b1356efd61e56eaa3426d8e2e813ea6730b4f2c9)
commit ba7b3155611fd983f7d3d244e7b525a483998d3f
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu Jul 6 21:26:28 2023 +0200
kex: safety checks when iterating stats list
- GH #3186
(cherry picked from commit 883f6b77211a76b35a9df570a8ddbbc344b05472)
commit b59009089ad2b7cc33af27b637a81396b240660d
Author: Henning Westerholt <hw@gilawa.com>
Date: Wed Jul 5 07:04:46 2023 +0000
tm: remove obselete comment, add clarification for reply_wait mode 2
(cherry picked from commit 2dbaa727a38e29da0f887fa5d0d8d20392839f9b)
commit 80b26beb7d4f9cd4b3858e9e2dae4588feec8e28
Author: Norbert Koppány Legyes <norbert.legyes@protonmail.com>
Date: Tue Jul 4 17:27:17 2023 +0200
xlog: fix docs example for modparam methods_filter
(cherry picked from commit b5a37683e364f596b6c5b4ebbba1fff951d7be84)
commit e681aa8236b502de31ad6600932517a259b6b62e
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri Jun 30 08:49:19 2023 +0200
jansson: print unknown type in log message
(cherry picked from commit b8cae4fbcd026ffb81e8242500212582d9672ad5)
commit 704cc393dd310c9db6db34214597e3134b40367f
Author: Stefan-Cristian Mititelu <stefan-cristian.mititelu@1and1.ro>
Date: Fri Aug 18 10:59:57 2023 +0300
ims_dialog: kemi export some functions
(cherry-picked from commit 3994410)
commit c51bc6c05428e8d66ddd6addcc1c0b4bbf4705f1
Author: Stefan-Cristian Mititelu <stefan-cristian.mititelu@1and1.ro>
Date: Wed Aug 16 11:01:08 2023 +0300
ims_qos: kemi export
(cherry picked from commit eb23e6b)
commit 1cf389829bebad2013a6cf3b4ab919fa6b78a7c2
Author: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu Jul 20 14:04:30 2023 +0200
crypto: SHA1_Init deprecated at openssl 3.0
From https://www.openssl.org/docs/man3.0/man7/migration_guide.html
> Use of low-level digest functions such as SHA1_Init(3) have been informally
> discouraged from use for a long time. Applications should instead use the
> high level EVP APIs EVP_DigestInit_ex(3), EVP_DigestUpdate(3) and
> EVP_DigestFinal_ex(3), or the quick one-shot EVP_Q_digest(3).
related to #3502
(cherry picked from commit e55a6ed0f24c9b81d8d3ad27ba25d4d88c474483)
commit 20be29ab3638d803341ec376b02edd7c14a9174a
Author: Stefan Mititelu <stefan-cristian.mititelu@1and1.ro>
Date: Wed Jul 19 13:48:09 2023 +0300
dialog: set cbs list to NULL after destroying
(cherry picked from commit 6881faadec45dd16dd896b13db44862e7df70422)
commit 44130062640ccbbc7e796cc748d432fe3382c328
Author: Stefan Mititelu <stefan-cristian.mititelu@1and1.ro>
Date: Wed Jul 5 13:56:21 2023 +0300
ims_qos: check and log for NULL sessionId
(cherry picked from commit 1b291315b43da1148cee5f3821ddbe49b0c86b7f)
commit 7630473f57c7c0ad600067cea7a89693d9926a81
Author: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Mon Jul 3 08:26:07 2023 +0200
http_client: use LIBCURL_VERSION_NUM instead of CURL_AT_LEAST_VERSION
- older distros have compilers that don't cope with the later
(cherry picked from commit 7cd32bf9631a81c7c4382d45f498bdc9c7f9b34c)
===================== 2023-06-28 Version 5.7.1 Released ===================== ===================== 2023-06-28 Version 5.7.1 Released =====================
===================== Changes Since Version 5.7.0 =========================== ===================== Changes Since Version 5.7.0 ===========================

@ -1,6 +1,6 @@
#!KAMAILIO #!KAMAILIO
# #
# Kamailio SIP Server v5.6 - default configuration script # Kamailio SIP Server v5.7 - default configuration script
# - web: https://www.kamailio.org # - web: https://www.kamailio.org
# - git: https://github.com/kamailio/kamailio # - git: https://github.com/kamailio/kamailio
# #
@ -227,7 +227,7 @@ enable_sctp=no
####### Custom Parameters ######### ####### Custom Parameters #########
/* These parameters can be modified runtime via RPC interface /* These parameters can be modified at runtime via RPC interface
* - see the documentation of 'cfg_rpc' module. * - see the documentation of 'cfg_rpc' module.
* *
* Format: group.id = value 'desc' description * Format: group.id = value 'desc' description
@ -389,7 +389,7 @@ modparam("registrar", "path_mode", 0)
modparam("acc", "early_media", 0) modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0) modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0) modparam("acc", "report_cancels", 0)
/* by default ww do not adjust the direct of the sequential requests. /* by default we do not adjust the direct of the sequential requests.
* if you enable this parameter, be sure the enable "append_fromtag" * if you enable this parameter, be sure the enable "append_fromtag"
* in "rr" module */ * in "rr" module */
modparam("acc", "detect_direction", 0) modparam("acc", "detect_direction", 0)

@ -1,7 +1,7 @@
# #
# $Id$ # $Id$
# #
# Example configuration file (simpler then ser-oob.cfg, but more # Example configuration file (simpler than ser-oob.cfg, but more
# complex then ser-basic.cfg). # complex then ser-basic.cfg).
# #
# First start SER sample config script with: # First start SER sample config script with:
@ -73,7 +73,7 @@ rev_dns=no # (cmd. line: -R)
#group=ser #group=ser
#disable_core=yes #disables core dumping #disable_core=yes #disables core dumping
#open_fd_limit=1024 # sets the open file descriptors limit #open_fd_limit=1024 # sets the open file descriptors limit
#mhomed=yes # usefull for multihomed hosts, small performance penalty #mhomed=yes # useful for multihomed hosts, small performance penalty
#disable_tcp=yes #disable_tcp=yes
#tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS) #tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS)
sip_warning=yes sip_warning=yes
@ -172,7 +172,7 @@ modparam("ctl", "binrpc", "tcp:127.0.0.1:2046")
# failed transactions (=negative responses) should be logged to # failed transactions (=negative responses) should be logged to
modparam("acc_db", "failed_transactions", 1) modparam("acc_db", "failed_transactions", 1)
# comment the next line if you dont want to have accounting to DB # comment the next line if you don't want to have accounting to DB
modparam("acc_db", "log_flag", "FLAG_ACC") modparam("acc_db", "log_flag", "FLAG_ACC")
# -- tm params -- # -- tm params --
@ -197,7 +197,7 @@ modparam("tls", "private_key", "ser-selfsigned.key")
# -- xmlrpc params -- # -- xmlrpc params --
# using a sub-route from the module is a lot safer then relying on the # using a sub-route from the module is a lot safer than relying on the
# request method to distinguish HTTP from SIP # request method to distinguish HTTP from SIP
modparam("xmlrpc", "route", "RPC"); modparam("xmlrpc", "route", "RPC");
@ -358,8 +358,8 @@ route[RR]
# particularly good if upstream and downstream entities # particularly good if upstream and downstream entities
# use different transport protocol # use different transport protocol
# if the inital INVITE got the ACC flag store this in # if the initial INVITE got the ACC flag store this in
# an RR AVP cookie. this is more for demonstration purpose # an RR AVP cookie. This is more for demonstration purpose
if (isflagset(FLAG_ACC)) { if (isflagset(FLAG_ACC)) {
$account = "yes"; $account = "yes";
setavpflag($account, "dialog_cookie"); setavpflag($account, "dialog_cookie");
@ -377,7 +377,7 @@ route[DOMAIN]
# check if the callee is at a local domain # check if the callee is at a local domain
lookup_domain("$td", "@ruri.host"); lookup_domain("$td", "@ruri.host");
# we dont know the domain of the caller and also not # we don't know the domain of the caller and also not
# the domain of the callee -> somone uses our proxy as # the domain of the callee -> somone uses our proxy as
# a relay # a relay
if (strempty($t.did) && strempty($f.did)) { if (strempty($t.did) && strempty($f.did)) {
@ -528,7 +528,7 @@ route[INBOUND]
if (lookup_contacts("location")) { if (lookup_contacts("location")) {
append_hf("P-hint: usrloc applied\r\n"); append_hf("P-hint: usrloc applied\r\n");
# we set the TM module timers according to the prefences # we set the TM module timers according to the preferences
# of the callee (avoid too long ringing of his phones) # of the callee (avoid too long ringing of his phones)
# Note1: timer values have to be in ms now! # Note1: timer values have to be in ms now!
# Note2: this makes even more sense if you switch to a voicemail # Note2: this makes even more sense if you switch to a voicemail

@ -4,7 +4,7 @@
# Maintainer: Nathan Angelacos <nangel@alpinelinux.org> # Maintainer: Nathan Angelacos <nangel@alpinelinux.org>
pkgname=kamailio pkgname=kamailio
pkgver=5.7.1 pkgver=5.7.2
pkgrel=0 pkgrel=0
# If building from a git snapshot, specify the gitcommit # If building from a git snapshot, specify the gitcommit

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,3 +1,9 @@
kamailio (5.7.2) unstable; urgency=medium
* version set 5.7.2
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
kamailio (5.7.1) unstable; urgency=medium kamailio (5.7.1) unstable; urgency=medium
* version set 5.7.1 * version set 5.7.1

@ -1,5 +1,5 @@
%define name kamailio %define name kamailio
%define ver 5.7.1 %define ver 5.7.2
%define rel dev1.0%{dist} %define rel dev1.0%{dist}
%if 0%{?fedora} %if 0%{?fedora}

@ -106,7 +106,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
# version number # version number
VERSION = 5 VERSION = 5
PATCHLEVEL = 7 PATCHLEVEL = 7
SUBLEVEL = 1 SUBLEVEL = 2
EXTRAVERSION = EXTRAVERSION =
# memory manager switcher # memory manager switcher

@ -2,6 +2,6 @@
* DO NOT EDIT IT * DO NOT EDIT IT
*/ */
#define REPO_VER "4238e4" #define REPO_VER "29caa1"
#define REPO_HASH "4238e4" #define REPO_HASH "29caa1"
#define REPO_STATE "" #define REPO_STATE ""

@ -886,7 +886,7 @@ assign_stm:
_ksr_xavp_via_params.len=strlen($3); _ksr_xavp_via_params.len=strlen($3);
} }
| XAVPVIAPARAMS EQUAL error { yyerror("string value expected"); } | XAVPVIAPARAMS EQUAL error { yyerror("string value expected"); }
| XAVPVIAFIELDS EQUAL STRING { _ksr_xavp_via_params.s=$3; | XAVPVIAFIELDS EQUAL STRING { _ksr_xavp_via_fields.s=$3;
_ksr_xavp_via_fields.len=strlen($3); _ksr_xavp_via_fields.len=strlen($3);
} }
| XAVPVIAFIELDS EQUAL error { yyerror("string value expected"); } | XAVPVIAFIELDS EQUAL error { yyerror("string value expected"); }

@ -2677,6 +2677,17 @@ endofpacket:
goto error; goto error;
} }
} }
if(vb->params.s != NULL && vb->params.len == 0 && vb->last_param != NULL) {
if(vb->last_param->name.len > 0) {
if(vb->last_param->value.len > 0) {
vb->params.len = vb->last_param->value.s + vb->last_param->value.len
- vb->params.s;
} else {
vb->params.len = vb->last_param->name.s + vb->last_param->name.len
- vb->params.s;
}
}
}
return tmp; return tmp;
nextvia: nextvia:
DBG("parsing via: next via\n"); DBG("parsing via: next via\n");
@ -2691,6 +2702,18 @@ nextvia:
goto error; goto error;
} }
} }
if(vb->params.s != NULL && vb->params.len == 0 && vb->last_param != NULL) {
if(vb->last_param->name.len > 0) {
if(vb->last_param->value.len > 0) {
vb->params.len = vb->last_param->value.s + vb->last_param->value.len
- vb->params.s;
} else {
vb->params.len = vb->last_param->name.s + vb->last_param->name.len
- vb->params.s;
}
}
}
vb->next = pkg_malloc(sizeof(struct via_body)); vb->next = pkg_malloc(sizeof(struct via_body));
if(vb->next == 0) { if(vb->next == 0) {
PKG_MEM_ERROR; PKG_MEM_ERROR;

@ -149,7 +149,7 @@ Chapter 1. Admin Guide
Set the path to the Lua script to be loaded at startup. Then you can Set the path to the Lua script to be loaded at startup. Then you can
use lua_run(function, params) to execute a function from the script at use lua_run(function, params) to execute a function from the script at
runtime. runtime. The script can be in Lua-source or bytecode.
Default value is “null”. Default value is “null”.

@ -117,7 +117,7 @@
<para> <para>
Set the path to the Lua script to be loaded at startup. Then you Set the path to the Lua script to be loaded at startup. Then you
can use lua_run(function, params) to execute a function from the can use lua_run(function, params) to execute a function from the
script at runtime. script at runtime. The script can be in Lua-source or bytecode.
</para> </para>
<para> <para>
<emphasis> <emphasis>

@ -169,14 +169,33 @@ static inline int crypto_format_rfc4122_uuid(char *sbuf, size_t sbuf_len,
*/ */
void crypto_generate_callid(str* callid) void crypto_generate_callid(str* callid)
{ {
#if OPENSSL_VERSION_NUMBER > 0x030000000L
EVP_MD_CTX *crypto_ctx = NULL;
#else
static SHA_CTX crypto_ctx = {0}; static SHA_CTX crypto_ctx = {0};
#endif
static unsigned char crypto_buf[SHA_DIGEST_LENGTH] = {0}; static unsigned char crypto_buf[SHA_DIGEST_LENGTH] = {0};
static char crypto_sbuf[UUID_LEN] = {0}; static char crypto_sbuf[UUID_LEN] = {0};
crypto_inc_counter(crypto_callid_counter, CTR_LEN); crypto_inc_counter(crypto_callid_counter, CTR_LEN);
#if OPENSSL_VERSION_NUMBER > 0x030000000L
if((crypto_ctx = EVP_MD_CTX_new()) == NULL) {
LM_ERR("can't get new context\n");
callid->s = NULL;
callid->len = 0;
return;
}
EVP_DigestInit_ex(crypto_ctx, EVP_sha1(), NULL);
EVP_DigestUpdate(crypto_ctx, crypto_callid_seed, SEED_LEN);
EVP_DigestUpdate(crypto_ctx, crypto_callid_counter, CTR_LEN);
EVP_DigestFinal_ex(crypto_ctx, crypto_buf, NULL);
EVP_MD_CTX_free(crypto_ctx);
#else
SHA1_Init(&crypto_ctx); SHA1_Init(&crypto_ctx);
SHA1_Update(&crypto_ctx, crypto_callid_seed, SEED_LEN); SHA1_Update(&crypto_ctx, crypto_callid_seed, SEED_LEN);
SHA1_Update(&crypto_ctx, crypto_callid_counter, CTR_LEN); SHA1_Update(&crypto_ctx, crypto_callid_counter, CTR_LEN);
SHA1_Final(crypto_buf, &crypto_ctx); SHA1_Final(crypto_buf, &crypto_ctx);
#endif
crypto_format_rfc4122_uuid(crypto_sbuf, sizeof(crypto_sbuf), crypto_format_rfc4122_uuid(crypto_sbuf, sizeof(crypto_sbuf),
crypto_buf, sizeof(crypto_buf)); crypto_buf, sizeof(crypto_buf));
callid->s = crypto_sbuf; callid->s = crypto_sbuf;

@ -2389,6 +2389,8 @@ error:
LM_ERR("failed to perform the update\n"); LM_ERR("failed to perform the update\n");
if (reply) if (reply)
db_redis_free_reply(&reply); db_redis_free_reply(&reply);
if(db_keys)
pkg_free(db_keys);
db_redis_key_free(&query_v); db_redis_key_free(&query_v);
db_redis_key_free(&all_type_keys); db_redis_key_free(&all_type_keys);
db_redis_key_free(&type_keys); db_redis_key_free(&type_keys);

@ -370,8 +370,11 @@ void destroy_dlg(struct dlg_cell *dlg)
if (dlg_db_mode) if (dlg_db_mode)
remove_dialog_from_db(dlg); remove_dialog_from_db(dlg);
if (dlg->cbs.first) if(dlg->cbs.first) {
destroy_dlg_callbacks_list(dlg->cbs.first); destroy_dlg_callbacks_list(dlg->cbs.first);
dlg->cbs.first = NULL;
dlg->cbs.types = 0;
}
if (dlg->profile_links) if (dlg->profile_links)
destroy_linkers(dlg->profile_links); destroy_linkers(dlg->profile_links);

@ -146,7 +146,8 @@ Chapter 1. Admin Guide
The following libraries or applications must be installed before The following libraries or applications must be installed before
running Kamailio with this module loaded: running Kamailio with this module loaded:
* libcurl libev * libcurl - https://curl.se/libcurl/
* libevent - https://libevent.org/
3. Parameters 3. Parameters

@ -48,8 +48,12 @@
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
<emphasis>libcurl</emphasis> <emphasis>libcurl</emphasis> - https://curl.se/libcurl/
<emphasis>libev</emphasis> </para>
</listitem>
<listitem>
<para>
<emphasis>libevent</emphasis> - https://libevent.org/
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>

@ -155,14 +155,16 @@ static int curL_request_url(struct sip_msg *_m, const char *_met,
res = curl_easy_setopt(curl, CURLOPT_URL, _url); res = curl_easy_setopt(curl, CURLOPT_URL, _url);
/* Limit to HTTP and HTTPS protocols */ /* Limit to HTTP and HTTPS protocols */
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0) #if LIBCURL_VERSION_NUM >= 0x075500
/* #if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0) */
res = curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, "http,https"); res = curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, "http,https");
#else #else
res = curl_easy_setopt( res = curl_easy_setopt(
curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
#endif #endif
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0) #if LIBCURL_VERSION_NUM >= 0x075500
/* #if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0) */
res = curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https"); res = curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
#else #else
res = curl_easy_setopt( res = curl_easy_setopt(
@ -392,7 +394,9 @@ static int curL_request_url(struct sip_msg *_m, const char *_met,
if((stat >= 200) && (stat < 500)) { if((stat >= 200) && (stat < 500)) {
double datasize = 0; double datasize = 0;
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 55, 0)
#if LIBCURL_VERSION_NUM >= 0x073700
/* #if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 55, 0) */
curl_off_t dlsize; curl_off_t dlsize;
curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &dlsize); curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &dlsize);
download_size = (double)dlsize; download_size = (double)dlsize;

@ -21,6 +21,7 @@
#include "../../modules/tm/tm_load.h" #include "../../modules/tm/tm_load.h"
#include "../../core/rpc_lookup.h" #include "../../core/rpc_lookup.h"
#include "../../modules/rr/api.h" #include "../../modules/rr/api.h"
#include "../../core/kemi.h"
#include "dlg_hash.h" #include "dlg_hash.h"
#include "dlg_timer.h" #include "dlg_timer.h"
@ -1044,9 +1045,107 @@ static void rpc_end_all_active_dlg (rpc_t *rpc, void *c)
} }
static rpc_export_t rpc_methods[] = { static rpc_export_t rpc_methods[] = {
{"dlg2.list", rpc_print_dlgs, rpc_print_dlgs_doc, 0}, {"dlg2.list", rpc_print_dlgs, rpc_print_dlgs_doc, 0},
{"dlg2.end_dlg", rpc_end_dlg_entry_id, rpc_end_dlg_entry_id_doc, 0}, {"dlg2.end_dlg", rpc_end_dlg_entry_id, rpc_end_dlg_entry_id_doc, 0},
{"dlg2.end_all_active_dlg", rpc_end_all_active_dlg, rpc_end_all_active_dlg_doc, 0}, {"dlg2.end_all_active_dlg", rpc_end_all_active_dlg,
{0, 0, 0, 0} rpc_end_all_active_dlg_doc, 0},
{0, 0, 0, 0}};
static int ki_is_known_dlg(sip_msg_t *msg)
{
return is_known_dlg(msg);
}
static int ki_set_dlg_profile(sip_msg_t *msg, str *sprofile, str *svalue)
{
struct dlg_profile_table *profile = NULL;
pv_elem_t *pvvalue = NULL;
if(sprofile == NULL || sprofile->s == NULL || sprofile->len <= 0) {
LM_ERR("invalid profile identifier\n");
return -1;
}
profile = search_dlg_profile(sprofile);
if(profile == NULL) {
LM_CRIT("profile <%.*s> not defined\n", sprofile->len, sprofile->s);
return -1;
}
if(pv_parse_format(svalue, &pvvalue) || pvvalue == NULL) {
LM_ERR("wrong format [%.*s] for value param!\n", svalue->len,
svalue->s);
return -1;
}
return w_set_dlg_profile(msg, (char *)profile, (char *)pvvalue);
}
static int ki_get_profile_size(
sip_msg_t *msg, str *sprofile, str *svalue, str *spv)
{
struct dlg_profile_table *profile = NULL;
pv_elem_t *pvvalue = NULL;
pv_spec_t *pvs = NULL;
if(sprofile == NULL || sprofile->s == NULL || sprofile->len <= 0) {
LM_ERR("invalid profile identifier\n");
return -1;
}
if(spv == NULL || spv->s == NULL || spv->len <= 0) {
LM_ERR("invalid destination var name\n");
return -1;
}
profile = search_dlg_profile(sprofile);
if(profile == NULL) {
LM_CRIT("profile <%.*s> not defined\n", sprofile->len, sprofile->s);
return -1;
}
if(pv_parse_format(svalue, &pvvalue) || pvvalue == NULL) {
LM_ERR("wrong format [%.*s] for value param!\n", svalue->len,
svalue->s);
return -1;
}
pvs = pv_cache_get(spv);
if(pvs == NULL) {
LM_ERR("cannot get pv spec for [%.*s]\n", spv->len, spv->s);
return -1;
}
if(pvs->type != PVT_AVP && pvs->type != PVT_SCRIPTVAR) {
LM_ERR("return must be an AVP or SCRIPT VAR!\n");
return -1;
}
return w_get_profile_size3(
msg, (char *)profile, (char *)pvvalue, (char *)pvs);
}
/* clang-format off */
static sr_kemi_t sr_kemi_ims_dialog_exports[] = {
{ str_init("ims_dialog"), str_init("is_known_dlg"),
SR_KEMIP_INT, ki_is_known_dlg,
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("ims_dialog"), str_init("set_dlg_profile"),
SR_KEMIP_INT, ki_set_dlg_profile,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("ims_dialog"), str_init("get_profile_size"),
SR_KEMIP_INT, ki_get_profile_size,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
}; };
/* clang-format on */
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
sr_kemi_modules_add(sr_kemi_ims_dialog_exports);
return 0;
}

@ -51,7 +51,7 @@ void destroy_list(spi_list_t *lst)
} }
int spi_add(spi_list_t *list, uint32_t spi_cid, uint32_t spi_sid, int spi_add(spi_list_t *list, uint32_t spi_cid, uint32_t spi_sid,
uint16_t sport, uint16_t cport) uint16_t cport, uint16_t sport)
{ {
if(!list) { if(!list) {
return 1; return 1;

@ -69,6 +69,7 @@
#include "rx_aar.h" #include "rx_aar.h"
#include "ims_qos_mod.h" #include "ims_qos_mod.h"
#include "../../core/parser/sdp/sdp.h" #include "../../core/parser/sdp/sdp.h"
#include "../../core/kemi.h"
#include "../../lib/ims/useful_defs.h" #include "../../lib/ims/useful_defs.h"
#include "ims_qos_stats.h" #include "ims_qos_stats.h"
@ -157,8 +158,14 @@ int rs_default_bandwidth = 0;
int rr_default_bandwidth = 0; int rr_default_bandwidth = 0;
/* commands wrappers and fixups */ /* commands wrappers and fixups */
static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *id, int id_type); static int w_rx_aar(struct sip_msg *msg, char *route, char *dir, char *id,
static int w_rx_aar_register(struct sip_msg *msg, char *route, char* str1, char *bar); int id_type, int cfg_type);
static int w_rx_aar_register(
struct sip_msg *msg, char *route, char *str1, int cfg_type);
static int cfg_rx_aar(
struct sip_msg *msg, char *route, char *dir, char *id, int id_type);
static int cfg_rx_aar_register(struct sip_msg *msg, char *route, char *str1);
struct _pv_req_data { struct _pv_req_data {
struct cell *T; struct cell *T;
@ -196,10 +203,10 @@ static int pv_t_copy_msg(struct sip_msg *src, struct sip_msg *dst)
static cmd_export_t cmds[] = { static cmd_export_t cmds[] = {
{ "Rx_AAR", (cmd_function) w_rx_aar, 4, fixup_aar, 0, REQUEST_ROUTE | ONREPLY_ROUTE}, {"Rx_AAR", (cmd_function)cfg_rx_aar, 4, fixup_aar, 0, ONREPLY_ROUTE},
{ "Rx_AAR_Register", (cmd_function) w_rx_aar_register, 2, fixup_aar_register, 0, REQUEST_ROUTE}, {"Rx_AAR_Register", (cmd_function)cfg_rx_aar_register, 2,
{ 0, 0, 0, 0, 0, 0} fixup_aar_register, 0, REQUEST_ROUTE},
}; {0, 0, 0, 0, 0, 0}};
static param_export_t params[] = { static param_export_t params[] = {
{ "rx_dest_realm", PARAM_STR, &rx_dest_realm}, { "rx_dest_realm", PARAM_STR, &rx_dest_realm},
@ -677,7 +684,14 @@ uint16_t check_ip_version(str ip)
/* Wrapper to send AAR from config file - this only allows for AAR for calls - not register, which uses r_rx_aar_register /* Wrapper to send AAR from config file - this only allows for AAR for calls - not register, which uses r_rx_aar_register
* return: 1 - success, <=0 failure. 2 - message not an AAR generating message (ie proceed without PCC if you wish) * return: 1 - success, <=0 failure. 2 - message not an AAR generating message (ie proceed without PCC if you wish)
*/ */
static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int id_type) static int cfg_rx_aar(
struct sip_msg *msg, char *route, char *dir, char *c_id, int id_type)
{
return w_rx_aar(msg, route, dir, c_id, id_type, 0);
}
static int w_rx_aar(struct sip_msg *msg, char *route, char *dir, char *c_id,
int id_type, int cfg_type)
{ {
int ret = CSCF_RETURN_ERROR; int ret = CSCF_RETURN_ERROR;
@ -702,19 +716,32 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
struct hdr_field *h = 0; struct hdr_field *h = 0;
struct dlg_cell* dlg = 0; struct dlg_cell* dlg = 0;
cfg_action_t* cfg_action = 0; cfg_action_t *cfg_action = 0;
saved_transaction_t* saved_t_data = 0; //data specific to each contact's AAR async call saved_transaction_t *saved_t_data =
char* direction = dir; 0; //data specific to each contact's AAR async call
if (fixup_get_svalue(msg, (gparam_t*) route, &route_name) != 0) { char *direction = dir;
LM_ERR("no async route block for assign_server_unreg\n");
return result; // standard config
if(cfg_type == 0) {
if(fixup_get_svalue(msg, (gparam_t *)route, &route_name) != 0) {
LM_ERR("no async route block for assign_server_unreg\n");
return result;
} }
if (get_str_fparam(&s_id, msg, (fparam_t*) c_id) < 0) { if(get_str_fparam(&s_id, msg, (fparam_t *)c_id) < 0) {
LM_ERR("failed to get s__id\n"); LM_ERR("failed to get s__id\n");
return result; return result;
} }
// kemi config
} else {
route_name.s = route;
route_name.len = strlen(route);
s_id.s = c_id;
s_id.len = strlen(c_id);
}
LM_DBG("Looking for route block [%.*s]\n", route_name.len, route_name.s); LM_DBG("Looking for route block [%.*s]\n", route_name.len, route_name.s);
int ri = route_get(&main_rt, route_name.s); int ri = route_get(&main_rt, route_name.s);
if (ri < 0) { if (ri < 0) {
@ -1154,7 +1181,13 @@ ignore:
} }
/* Wrapper to send AAR from config file - only used for registration */ /* Wrapper to send AAR from config file - only used for registration */
static int w_rx_aar_register(struct sip_msg *msg, char* route, char* str1, char* bar) static int cfg_rx_aar_register(struct sip_msg *msg, char *route, char *str1)
{
return w_rx_aar_register(msg, route, str1, 0);
}
static int w_rx_aar_register(
struct sip_msg *msg, char *route, char *str1, int cfg_type)
{ {
int ret = CSCF_RETURN_ERROR; int ret = CSCF_RETURN_ERROR;
@ -1178,15 +1211,30 @@ static int w_rx_aar_register(struct sip_msg *msg, char* route, char* str1, char*
unsigned short recv_proto; unsigned short recv_proto;
uint16_t ip_version; uint16_t ip_version;
struct via_body* vb; struct via_body *vb;
unsigned short via_port; unsigned short via_port;
unsigned short via_proto; unsigned short via_proto;
udomain_t *d = NULL;
if (fixup_get_svalue(msg, (gparam_t*) route, &route_name) != 0) { // standard config
LM_ERR("no async route block for assign_server_unreg\n"); if(cfg_type == 0) {
return -1; if(fixup_get_svalue(msg, (gparam_t *)route, &route_name) != 0) {
LM_ERR("no async route block for assign_server_unreg\n");
return -1;
} }
// kemi config
} else {
route_name.s = route;
route_name.len = strlen(route);
if(ul.register_udomain((char *)str1, &d) < 0) {
LM_ERR("Error doing kemi fixup");
return -1;
}
str1 = (char *)d;
}
LM_DBG("Looking for route block [%.*s]\n", route_name.len, route_name.s); LM_DBG("Looking for route block [%.*s]\n", route_name.len, route_name.s);
int ri = route_get(&main_rt, route_name.s); int ri = route_get(&main_rt, route_name.s);
if (ri < 0) { if (ri < 0) {
@ -1598,3 +1646,73 @@ int create_return_code(int result)
return rc; return rc;
} }
static int ki_rx_aar(
sip_msg_t *msg, str *route, str *dir, str *c_id, int id_type)
{
if(!msg || !route || !dir || !c_id)
return -1;
if(route->s == NULL || route->len <= 0) {
LM_ERR("invalid or empty route\n");
return -1;
}
if(dir->s == NULL || dir->len <= 0) {
LM_ERR("invalid or empty direction\n");
return -1;
}
// make sure vars can be used as char*
route->s[route->len] = '\0';
dir->s[dir->len] = '\0';
c_id->s[c_id->len] = '\0';
return w_rx_aar(msg, route->s, dir->s, c_id->s, id_type, 1);
}
static int ki_rx_aar_register(sip_msg_t *msg, str *route, str *domain)
{
if(!msg || !route || !domain)
return -1;
if(route->s == NULL || route->len <= 0) {
LM_ERR("invalid or empty route\n");
return -1;
}
if(domain->s == NULL || domain->len <= 0) {
LM_ERR("invalid or empty domain\n");
return -1;
}
// make sure vars can be used as char*
route->s[route->len] = '\0';
domain->s[domain->len] = '\0';
return w_rx_aar_register(msg, route->s, domain->s, 1);
}
/* clang-format off */
static sr_kemi_t sr_kemi_ims_qos_exports[] = {
{ str_init("ims_qos"), str_init("Rx_AAR"),
SR_KEMIP_INT, ki_rx_aar,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR,
SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("ims_qos"), str_init("Rx_AAR_Register"),
SR_KEMIP_INT, ki_rx_aar_register,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};
/* clang-format on */
int mod_register(char *path, int *dlflags, void *p1, void *p2)
{
sr_kemi_modules_add(sr_kemi_ims_qos_exports);
return 0;
}

@ -149,6 +149,11 @@ void async_aar_callback(int is_timeout, void *param, AAAMessage *aaa, long elaps
LM_DBG("Success, received code: [%i] from PCRF for AAR request\n", cdp_result); LM_DBG("Success, received code: [%i] from PCRF for AAR request\n", cdp_result);
counter_inc(ims_qos_cnts_h.successful_media_aars); counter_inc(ims_qos_cnts_h.successful_media_aars);
if(!aaa->sessionId) {
LM_ERR("NULL AAA sessionId from PCRF!\n");
goto error;
}
LM_DBG("Auth session ID [%.*s]", aaa->sessionId->data.len, aaa->sessionId->data.s); LM_DBG("Auth session ID [%.*s]", aaa->sessionId->data.len, aaa->sessionId->data.s);
if(!data->aar_update) { if(!data->aar_update) {
@ -286,6 +291,12 @@ void async_aar_reg_callback(int is_timeout, void *param, AAAMessage *aaa, long e
create_return_code(result); create_return_code(result);
goto done; goto done;
} }
if(!aaa->sessionId) {
LM_ERR("NULL AAA sessionId from PCRF!\n");
goto error;
}
//need to set Rx auth data to say this session has been successfully opened //need to set Rx auth data to say this session has been successfully opened
//This is used elsewhere to prevent acting on termination events when the session has not been opened //This is used elsewhere to prevent acting on termination events when the session has not been opened
//getting auth session //getting auth session

@ -225,7 +225,7 @@ int janssonmod_set(unsigned int append, struct sip_msg* msg, char* type_in,
value = json_null(); value = json_null();
} else { } else {
ERR("unrecognized input type\n"); ERR("unrecognized input type: %.*s\n", type_s.len, type_s.s);
goto fail; goto fail;
} }

@ -88,15 +88,14 @@ static const char* rpc_mod_mem_statsx_doc[2] = {
static int rpc_mod_is_printed_one(mem_counter *stats, mem_counter *current) { static int rpc_mod_is_printed_one(mem_counter *stats, mem_counter *current) {
mem_counter *iter; mem_counter *iter;
if ( stats == NULL || current == NULL ) if(stats == NULL || current == NULL || current->mname == NULL) {
{
LM_ERR("invalid parameter\n"); LM_ERR("invalid parameter\n");
return 1; return 1;
} }
iter = stats; iter = stats;
while (iter && iter != current) { while(iter && iter != current) {
if (strcmp(iter->mname, current->mname) == 0) { if(iter->mname != NULL && strcmp(iter->mname, current->mname) == 0) {
return 1; return 1;
} }
iter = iter->next; iter = iter->next;

@ -327,7 +327,7 @@ $var(mohq) = "operators";
volatile database in memory of call status. If the module is restarted volatile database in memory of call status. If the module is restarted
it loses the internal database and clears the external one. it loses the internal database and clears the external one.
On a reqular basis it checks the external table that defines the queues On a regular basis it checks the external table that defines the queues
to see if the definition has changed. It makes this check under the to see if the definition has changed. It makes this check under the
following conditions: the queue has not been checked in the last 60 following conditions: the queue has not been checked in the last 60
seconds AND no call is currently in queue or transitioning in or out. seconds AND no call is currently in queue or transitioning in or out.

@ -361,7 +361,7 @@ restarted it loses the internal database and clears the external
one. one.
</para> </para>
<para> <para>
On a reqular basis it checks the external table that defines the On a regular basis it checks the external table that defines the
queues to see if the definition has changed. It makes this check queues to see if the definition has changed. It makes this check
under the following conditions: the queue has not been checked in the under the following conditions: the queue has not been checked in the
last 60 seconds <emphasis>AND</emphasis> no call is currently in last 60 seconds <emphasis>AND</emphasis> no call is currently in

@ -755,7 +755,7 @@ static int m_store(sip_msg_t* msg, str *owner_s)
} }
/* current time */ /* current time */
val = (int)time(NULL); val = (int)(unsigned long long)time(NULL);
/* add expiration time */ /* add expiration time */
db_keys[nr_keys] = &sc_exp_time; db_keys[nr_keys] = &sc_exp_time;

@ -563,6 +563,10 @@ static int rabbitmq_connect(amqp_connection_state_t *conn)
// establish a new connection to RabbitMQ server // establish a new connection to RabbitMQ server
*conn = amqp_new_connection(); *conn = amqp_new_connection();
if(!*conn) {
LM_ERR("FAIL: create AMQP connection\n");
return RABBITMQ_ERR_CREATE;
}
log_ret = log_on_amqp_error( log_ret = log_on_amqp_error(
amqp_get_rpc_reply(*conn), "amqp_new_connection()"); amqp_get_rpc_reply(*conn), "amqp_new_connection()");
if(log_ret != AMQP_RESPONSE_NORMAL && log_ret != AMQP_RESPONSE_NONE) { if(log_ret != AMQP_RESPONSE_NORMAL && log_ret != AMQP_RESPONSE_NONE) {

@ -48,6 +48,7 @@ typedef enum {
RABBITMQ_ERR_CHANNEL, RABBITMQ_ERR_CHANNEL,
RABBITMQ_ERR_QUEUE, RABBITMQ_ERR_QUEUE,
RABBITMQ_ERR_PUBLISH, RABBITMQ_ERR_PUBLISH,
RABBITMQ_ERR_CREATE,
RABBITMQ_ERR_SOCK, RABBITMQ_ERR_SOCK,
RABBITMQ_ERR_CONSUME, RABBITMQ_ERR_CONSUME,
RABBITMQ_ERR_NULL, RABBITMQ_ERR_NULL,

@ -34,14 +34,14 @@
#include "common.h" #include "common.h"
#include "config.h" #include "config.h"
#define MAX_AOR_LEN 256 #define AOR_MAX_SIZE 512
/*! \brief /*! \brief
* Extract Address of Record * Extract Address of Record
*/ */
int extract_aor(str* _uri, str* _a, sip_uri_t *_pu) int extract_aor(str* _uri, str* _a, sip_uri_t *_pu)
{ {
static char aor_buf[MAX_AOR_LEN]; static char aor_buf[AOR_MAX_SIZE];
str tmp; str tmp;
sip_uri_t turi; sip_uri_t turi;
sip_uri_t *puri; sip_uri_t *puri;
@ -49,8 +49,8 @@ int extract_aor(str* _uri, str* _a, sip_uri_t *_pu)
str *uri; str *uri;
str realm_prefix = {0}; str realm_prefix = {0};
memset(aor_buf, 0, MAX_AOR_LEN); memset(aor_buf, 0, AOR_MAX_SIZE);
uri=_uri; uri = _uri;
if(_pu!=NULL) if(_pu!=NULL)
puri = _pu; puri = _pu;
@ -63,9 +63,9 @@ int extract_aor(str* _uri, str* _a, sip_uri_t *_pu)
return -1; return -1;
} }
if ( (puri->user.len + puri->host.len + 1) > MAX_AOR_LEN if((puri->user.len + puri->host.len + 2) > AOR_MAX_SIZE
|| puri->user.len > USERNAME_MAX_SIZE || puri->user.len > USERNAME_MAX_SIZE
|| puri->host.len > DOMAIN_MAX_SIZE ) { || puri->host.len > DOMAIN_MAX_SIZE) {
rerrno = R_AOR_LEN; rerrno = R_AOR_LEN;
LM_ERR("Address Of Record too long\n"); LM_ERR("Address Of Record too long\n");
return -2; return -2;

@ -40,10 +40,10 @@
/* if DB support is used, this values must not exceed the /* if DB support is used, this values must not exceed the
* storage capacity of the DB columns! See db/schema/entities.xml */ * storage capacity of the DB columns! See db/schema/entities.xml */
extern int contact_max_size; /* configurable using module parameter "contact_max_size" instead of compile time constant */ extern int contact_max_size; /* configurable using module parameter "contact_max_size" instead of compile time constant */
#define RECEIVED_MAX_SIZE 255 #define RECEIVED_MAX_SIZE 255
#define USERNAME_MAX_SIZE 64 #define USERNAME_MAX_SIZE 248
#define DOMAIN_MAX_SIZE 128 #define DOMAIN_MAX_SIZE 248
#define CALLID_MAX_SIZE 255 #define CALLID_MAX_SIZE 255
#define PATH_MODE_STRICT 2 #define PATH_MODE_STRICT 2
#define PATH_MODE_LAZY 1 #define PATH_MODE_LAZY 1

@ -2659,6 +2659,8 @@ int pv_parse_siptrace_name(pv_spec_t *sp, str *in)
sp->pvp.pvn.u.isname.name.n = 6; sp->pvp.pvn.u.isname.name.n = 6;
else if(strncmp(in->s, "dst_proto", 9)==0) else if(strncmp(in->s, "dst_proto", 9)==0)
sp->pvp.pvn.u.isname.name.n = 7; sp->pvp.pvn.u.isname.name.n = 7;
else if(strncmp(in->s, "direction", 9)==0)
sp->pvp.pvn.u.isname.name.n = 10;
else goto error; else goto error;
break; break;
case 10: case 10:
@ -2666,8 +2668,6 @@ int pv_parse_siptrace_name(pv_spec_t *sp, str *in)
sp->pvp.pvn.u.isname.name.n = 8; sp->pvp.pvn.u.isname.name.n = 8;
else if(strncmp(in->s, "dst_hostip", 10)==0) else if(strncmp(in->s, "dst_hostip", 10)==0)
sp->pvp.pvn.u.isname.name.n = 9; sp->pvp.pvn.u.isname.name.n = 9;
else if(strncmp(in->s, "direction", 10)==0)
sp->pvp.pvn.u.isname.name.n = 10;
else goto error; else goto error;
break; break;
default: default:

@ -622,12 +622,12 @@ static void rpc_uac_block_callback(struct cell* t, int type,
* only if reply_wait is set to 1. Otherwise the rpc reply will be sent * only if reply_wait is set to 1. Otherwise the rpc reply will be sent
* immediately and it will be success if the parameters were ok and t_uac did * immediately and it will be success if the parameters were ok and t_uac did
* not report any error. * not report any error.
* Note: reply waiting (reply_wait==1) is not yet supported.
* @param rpc - rpc handle * @param rpc - rpc handle
* @param c - rpc current context * @param c - rpc current context
* @param reply_wait - if 1 do not generate a rpc reply until final response * @param reply_wait - if 1 do not generate a rpc reply until final response
* for the transaction arrives, if 0 immediately send * for the transaction arrives, if 0 immediately send
* an rpc reply (see above). * an rpc reply (see above). If 2 blocking wait until
* final response for the transaction arrives.
*/ */
static void rpc_t_uac(rpc_t* rpc, void* c, int reply_wait) static void rpc_t_uac(rpc_t* rpc, void* c, int reply_wait)
{ {

@ -83,8 +83,8 @@ Chapter 1. Admin Guide
SIP parser can easily handle HTTP requests just by adding a fake Via SIP parser can easily handle HTTP requests just by adding a fake Via
header. header.
The <module>xmlrpc</module> module uses the same concept. The xHTTP The xmlrpc module uses the same concept. The xHTTP module offers a
module offers a generic way of handling the HTTP protocol, by calling generic way of handling the HTTP protocol, by calling
event_route[xhttp:request] in your config. You can check the HTTP URL event_route[xhttp:request] in your config. You can check the HTTP URL
via the config variable $hu. Note that use of $ru will raise errors via the config variable $hu. Note that use of $ru will raise errors
since the structure of an HTTP URL is not compatible with that of a SIP since the structure of an HTTP URL is not compatible with that of a SIP
@ -222,7 +222,10 @@ event_route[xhttp:request] {
6.1. xhttp:request 6.1. xhttp:request
The event route is executed when a new HTTP request is received. The event route is executed when a new HTTP request is received. Most
of the variables related to a SIP request can be used inside this event
route to get HTTP request attributes (e.g., $si - source IP, $hdr(X) -
body of header X, $rm - request method, $rb - request body, ...).
... ...
tcp_accept_no_cl=yes tcp_accept_no_cl=yes
... ...

@ -22,7 +22,7 @@
Via header. Via header.
</para> </para>
<para> <para>
The <module>xmlrpc</module> module uses the same concept. The xmlrpc module uses the same concept.
The xHTTP module offers a generic way of handling the <acronym>HTTP</acronym> The xHTTP module offers a generic way of handling the <acronym>HTTP</acronym>
protocol, by calling <emphasis>event_route[xhttp:request]</emphasis> protocol, by calling <emphasis>event_route[xhttp:request]</emphasis>
in your config. You can check the HTTP URL via the config variable in your config. You can check the HTTP URL via the config variable
@ -228,7 +228,10 @@ event_route[xhttp:request] {
<function moreinfo="none">xhttp:request</function> <function moreinfo="none">xhttp:request</function>
</title> </title>
<para> <para>
The event route is executed when a new HTTP request is received. The event route is executed when a new HTTP request is received. Most
of the variables related to a SIP request can be used inside this event
route to get HTTP request attributes (e.g., $si - source IP, $hdr(X)
- body of header X, $rm - request method, $rb - request body, ...).
</para> </para>
<programlisting format="linespecific"> <programlisting format="linespecific">
... ...

@ -266,7 +266,7 @@ kamcmd cfg.set_now_int xlog methods_filter 15
Example 1.8. Set methods_filter parameter Example 1.8. Set methods_filter parameter
... ...
modparam("xlog", "long_format", 1) modparam("xlog", "methods_filter", 15)
... ...
5. Functions 5. Functions

@ -256,7 +256,7 @@ kamcmd cfg.set_now_int xlog methods_filter 15
<title>Set <varname>methods_filter</varname> parameter</title> <title>Set <varname>methods_filter</varname> parameter</title>
<programlisting format="linespecific"> <programlisting format="linespecific">
... ...
modparam("xlog", "long_format", 1) modparam("xlog", "methods_filter", 15)
... ...
</programlisting> </programlisting>
</example> </example>

@ -5,7 +5,7 @@
#=================================================================== #===================================================================
### version for this script ### version for this script
VERSION='5.6.0' VERSION='5.7.0'
PATH=$PATH:/usr/local/sbin/ PATH=$PATH:/usr/local/sbin/

Loading…
Cancel
Save