Skip to content

Commit

Permalink
# This is a combination of 23 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

ss7ops: updated with relocation of lib/srutils to core/utils

# This is the commit message #2:

tmrec: updated with relocation of lib/srutils to core/utils

# This is the commit message #3:

topos: updated with relocation of lib/srutils to core/utils

# This is the commit message #4:

uac_redirect: updated with relocation of lib/srutils to core/utils

# This is the commit message kamailio#5:

usrloc: updated with relocation of lib/srutils to core/utils

# This is the commit message kamailio#6:

pkg: obs spec - removed lib/srutils from rpm pacaging

# This is the commit message kamailio#7:

core: crypto, utils - updated comments referencing srutils after relocation

# This is the commit message kamailio#8:

corex: declare nio specific globals in c file

# This is the commit message kamailio#9:

Makefile.defs: add -lm to linker flags

- on some linux distros is not linked by default

# This is the commit message kamailio#10:

pipelimit: make error log debug in rpc command when pipe not found

- error code is returned to rpc command

# This is the commit message kamailio#11:

tls: proper match of config profile by server id

# This is the commit message kamailio#12:

http_client: typo in variable name for network interface

# This is the commit message kamailio#13:

core: dprint - new flags for long engine json

- a: prefix attribute names with application name
- A: do not prefix message attribute with application name (when 'a' is
set)

# This is the commit message kamailio#14:

sipdump: small whitespace fixes

# This is the commit message kamailio#15:

sipdump: option to run event_route[sipdump:msg] on rcv/snd messages

- new modparam mode to control the behaviour, its values can be built
from flags:
  - 1 - write to files (the existing behaviour), default
  - 2 - execute event route
- inside event route, $sipdump(...) variable is available to get the
buffer content and other related attributes
- new modparam event_callback to set the KEMI function to be run instead
of the event route

# This is the commit message kamailio#16:

sipdump: docs for mode and event_callback parameters

# This is the commit message kamailio#17:

sipdump: docs for event route sipdump:msg

# This is the commit message kamailio#18:

modules: readme files regenerated - sipdump ... [skip ci]

# This is the commit message kamailio#19:

sipdump: kemi functions to return buf and tag values

# This is the commit message kamailio#20:

seas: docs - removed mi_fifo from examples

# This is the commit message kamailio#21:

modules: readme files regenerated - seas ... [skip ci]

# This is the commit message kamailio#22:

textops: docs - proper example for append_body_part() with headers

# This is the commit message kamailio#23:

modules: readme files regenerated - textops ... [skip ci]
  • Loading branch information
miconda authored and nickvsnetworking committed Aug 24, 2022
1 parent 781b1cf commit b9fa793
Show file tree
Hide file tree
Showing 36 changed files with 509 additions and 126 deletions.
2 changes: 0 additions & 2 deletions pkg/kamailio/obs/kamailio.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1547,8 +1547,6 @@ fi
%{_libdir}/kamailio/libsrdb1.so.1.0
%{_libdir}/kamailio/libsrdb2.so.1
%{_libdir}/kamailio/libsrdb2.so.1.0
%{_libdir}/kamailio/libsrutils.so.1
%{_libdir}/kamailio/libsrutils.so.1.0
%{_libdir}/kamailio/libtrie.so.1
%{_libdir}/kamailio/libtrie.so.1.0

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ ifeq ($(YACC),)
endif
YACC_FLAGS=-d -b core/cfg
# on solaris add -lxnet (e.g. LIBS= -lxnet)
LIBS= -ldl -lresolv
LIBS= -ldl -lresolv -lm
LIB_PREFIX:=lib
LIB_SUFFIX:=.so

Expand Down
8 changes: 4 additions & 4 deletions src/core/crypto/shautils.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*! @defgroup srutils Various utilities
/*! @defgroup core/crypto Various crypto utilities
*
* Kamailio core library.
*/
/*!
* \file
* \brief srutils :: SHA and other hashing utilities
* \ingroup srutils
* Module: \ref srutils
* \brief core/crypto :: SHA and other hashing utilities
* \ingroup core/crypto
* Module: \ref core/crypto
*/

#include "../../core/crypto/md5.h"
Expand Down
6 changes: 3 additions & 3 deletions src/core/crypto/shautils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
/*!
* \file
* \brief srutils :: SHA and other hashing utilities
* \ingroup srutils
* Module: \ref srutils
* \brief core/crypto :: SHA and other hashing utilities
* \ingroup core/crypto
* Module: \ref core/crypto
*/

#ifndef _SHAUTILS_H_
Expand Down
44 changes: 38 additions & 6 deletions src/core/dprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ ksr_slog_f _ksr_slog_func = NULL;
static int _ksr_slog_json_flags = 0;
#define KSR_SLOGJSON_FL_STRIPMSGNL (1<<0)
#define KSR_SLOGJSON_FL_NOLOGNL (1<<1)
#define KSR_SLOGJSON_FL_APPPREFIX (1<<2)
#define KSR_SLOGJSON_FL_NOAPPPREFIXMSG (1<<3)

static void ksr_slog_json_str_escape(str *s_in, str *s_out, int *emode)
{
Expand Down Expand Up @@ -565,11 +567,18 @@ static void ksr_slog_json_str_escape(str *s_in, str *s_out, int *emode)
}

#define KSR_SLOG_SYSLOG_JSON_FMT "{ \"level\": \"%s\", \"module\": \"%s\", \"file\": \"%s\"," \
" \"line\": %d, \"function\": \"%s\", \"logprefix\": \"%.*s\", \"message\": \"%.*s\" }%s"
" \"line\": %d, \"function\": \"%s\", \"logprefix\": \"%.*s\", \"%smessage\": \"%.*s\" }%s"

#define KSR_SLOG_SYSLOG_JSON_PFMT "{ \"" NAME ".level\": \"%s\", \"" NAME ".module\": \"%s\", \"" NAME ".file\": \"%s\"," \
" \"" NAME ".line\": %d, \"" NAME ".function\": \"%s\", \"" NAME ".logprefix\": \"%.*s\", \"%smessage\": \"%.*s\" }%s"

#define KSR_SLOG_STDERR_JSON_FMT "{ \"idx\": %d, \"pid\": %d, \"level\": \"%s\"," \
" \"module\": \"%s\", \"file\": \"%s\"," \
" \"line\": %d, \"function\": \"%s\", \"logprefix\": \"%.*s\", \"message\": \"%.*s\" }%s"
" \"line\": %d, \"function\": \"%s\", \"logprefix\": \"%.*s\", \"%smessage\": \"%.*s\" }%s"

#define KSR_SLOG_STDERR_JSON_PFMT "{ \"" NAME ".idx\": %d, \"" NAME ".pid\": %d, \"" NAME ".level\": \"%s\"," \
" \"" NAME ".module\": \"%s\", \"" NAME ".file\": \"%s\"," \
" \"" NAME ".line\": %d, \"" NAME ".function\": \"%s\", \"" NAME ".logprefix\": \"%.*s\", \"%smessage\": \"%.*s\" }%s"

void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
{
Expand All @@ -580,6 +589,9 @@ void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
str s_in = STR_NULL;
str s_out = STR_NULL;
int emode = 0;
char *prefmsg;
const char *efmt;
const char *sfmt;

va_start(arglist, format);
n = vsnprintf(obuf + s_in.len, KSR_SLOG_MAX_SIZE - s_in.len, format, arglist);
Expand All @@ -601,21 +613,35 @@ void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
if(s_out.s == NULL) {
goto error;
}

if(_ksr_slog_json_flags & KSR_SLOGJSON_FL_APPPREFIX) {
if(_ksr_slog_json_flags & KSR_SLOGJSON_FL_NOAPPPREFIXMSG) {
prefmsg = "";
} else {
prefmsg = NAME ".";
}
efmt = KSR_SLOG_STDERR_JSON_PFMT;
sfmt = KSR_SLOG_SYSLOG_JSON_PFMT;
} else {
prefmsg = "";
efmt = KSR_SLOG_STDERR_JSON_FMT;
sfmt = KSR_SLOG_SYSLOG_JSON_FMT;
}
if (unlikely(log_stderr)) {
if (unlikely(log_color)) dprint_color(kld->v_level);
fprintf(stderr,
KSR_SLOG_STDERR_JSON_FMT, process_no, my_pid(),
efmt, process_no, my_pid(),
kld->v_lname, kld->v_mname, kld->v_fname, kld->v_fline,
kld->v_func, LOGV_PREFIX_LEN, LOGV_PREFIX_STR,
s_out.len, s_out.s,
prefmsg, s_out.len, s_out.s,
(_ksr_slog_json_flags & KSR_SLOGJSON_FL_NOLOGNL)?"":"\n");
if (unlikely(log_color)) dprint_color_reset();
} else {
_km_log_func(kld->v_facility,
KSR_SLOG_SYSLOG_JSON_FMT,
sfmt,
kld->v_lname, kld->v_mname, kld->v_fname, kld->v_fline,
kld->v_func, LOGV_PREFIX_LEN, LOGV_PREFIX_STR,
s_out.len, s_out.s,
prefmsg, s_out.len, s_out.s,
(_ksr_slog_json_flags & KSR_SLOGJSON_FL_NOLOGNL)?"":"\n");
}
if(emode && s_out.s) {
Expand Down Expand Up @@ -655,6 +681,12 @@ void ksr_slog_init(char *ename)
case 'N':
_ksr_slog_json_flags |= KSR_SLOGJSON_FL_NOLOGNL;
break;
case 'a':
_ksr_slog_json_flags |= KSR_SLOGJSON_FL_APPPREFIX;
break;
case 'A':
_ksr_slog_json_flags |= KSR_SLOGJSON_FL_NOAPPPREFIXMSG;
break;
}
p++;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/utils/srjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

/*!
* \file
* \brief srutils :: SRjson - JSON parser in C - MIT License
* \ingroup srutils
* Module: \ref srutils
* \brief core/utils :: SRjson - JSON parser in C - MIT License
* \ingroup core/utils
* Module: \ref core/utils
* - addapted from cJSON to fit better within Kamailio/SER environment
*/

Expand Down
6 changes: 3 additions & 3 deletions src/core/utils/srjson.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
/*!
* \file
* \brief srutils :: SRjson
* \ingroup srutils
* Module: \ref srutils
* \brief core/utils :: SRjson
* \ingroup core/utils
* Module: \ref core/utils
*/

#ifndef _srjson__h_
Expand Down
10 changes: 5 additions & 5 deletions src/core/utils/sruid.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*!
* \file
* \brief srutils :: Unique ID generator
* \ingroup srutils
* Module: \ref srutils
* \brief core/utils :: Unique ID generator
* \ingroup core/utils
* Module: \ref core/utils
*/

#include <stdio.h>
Expand Down
10 changes: 5 additions & 5 deletions src/core/utils/sruid.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*!
* \file
* \brief srutils :: Unique ID generator
* \ingroup srutils
* Module: \ref srutils
* \brief core/utils :: Unique ID generator
* \ingroup core/utils
* Module: \ref core/utils
*/

#ifndef _SRUID_H_
Expand Down
6 changes: 3 additions & 3 deletions src/core/utils/tmrec.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
* Time Recurence Library according to iCalendar (RFC 2445)
* - implemented at FhG Fokus, 2003 - external link:
* https://github.com/miconda/tmrec
* \brief srutils :: <description of this file>
* \ingroup srutils
* Module: \ref srutils
* \brief core/utils :: <description of this file>
* \ingroup core/utils
* Module: \ref core/utils
*/

#include <stdio.h>
Expand Down
8 changes: 8 additions & 0 deletions src/modules/corex/corex_nio.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@

#include "corex_nio.h"

int nio_route_no;
int nio_min_msg_len;
int nio_is_incoming;

str nio_msg_avp_param;
int_str nio_msg_avp_name;
unsigned short nio_msg_avp_type;

/**
* init nio function
*/
Expand Down
12 changes: 6 additions & 6 deletions src/modules/corex/corex_nio.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
#include "../../core/tcp_options.h"
#include "../../core/msg_translator.h"

int nio_route_no;
int nio_min_msg_len;
int nio_is_incoming;
extern int nio_route_no;
extern int nio_min_msg_len;
extern int nio_is_incoming;

str nio_msg_avp_param;
int_str nio_msg_avp_name;
unsigned short nio_msg_avp_type;
extern str nio_msg_avp_param;
extern int_str nio_msg_avp_name;
extern unsigned short nio_msg_avp_type;

int nio_msg_received(sr_event_param_t *evp);
int nio_msg_sent(sr_event_param_t *evp);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/http_client/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ unsigned int default_authmethod =
CURLAUTH_BASIC
| CURLAUTH_DIGEST; /*!< authentication method - Basic, Digest or both */

char *default_netintrface = 0; /*!< local network interface */
char *default_netinterface = 0; /*!< local network interface */

/*!< Default http query result mode
* - 0: return full result
Expand Down
2 changes: 1 addition & 1 deletion src/modules/pipelimit/pl_ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ void rpc_pl_list(rpc_t *rpc, void *c)
if(pipeid.len>0) {
it = pl_pipe_get(&pipeid, 1);
if (it==NULL) {
LM_ERR("no pipe: %.*s\n", pipeid.len, pipeid.s);
LM_DBG("no pipe: %.*s\n", pipeid.len, pipeid.s);
rpc->fault(c, 400, "Unknown pipe id %.*s", pipeid.len, pipeid.s);
return;
}
Expand Down
4 changes: 0 additions & 4 deletions src/modules/seas/README
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,7 @@ loadmodule "/usr/local/lib/kamailio/modules/usrloc.so"
loadmodule "/usr/local/lib/kamailio/modules/registrar.so"
loadmodule "/usr/local/lib/kamailio/modules/textops.so"
loadmodule "/usr/local/lib/kamailio/modules/seas.so"
loadmodule "/usr/local/lib/kamailio/modules/mi_fifo.so"

modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
modparam("usrloc", "db_mode", 0)
modparam("rr", "enable_full_lr", 1)
modparam("seas", "listen_sockets", "127.0.0.1:5080");
Expand Down Expand Up @@ -820,9 +818,7 @@ mpath="/home/elias/src/sipservlet/seas"

loadmodule "modules/tm/tm.so"
loadmodule "modules/seas/seas.so"
loadmodule "modules/mi_fifo/mi_fifo.so"

modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
modparam("seas", "listen_sockets","127.0.0.1:5080")

route{
Expand Down
8 changes: 2 additions & 6 deletions src/modules/seas/doc/seas_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,7 @@ loadmodule "/usr/local/lib/kamailio/modules/usrloc.so"
loadmodule "/usr/local/lib/kamailio/modules/registrar.so"
loadmodule "/usr/local/lib/kamailio/modules/textops.so"
loadmodule "/usr/local/lib/kamailio/modules/seas.so"
loadmodule "/usr/local/lib/kamailio/modules/mi_fifo.so"

modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
modparam("usrloc", "db_mode", 0)
modparam("rr", "enable_full_lr", 1)
modparam("seas", "listen_sockets", "127.0.0.1:5080");
Expand Down Expand Up @@ -759,16 +757,14 @@ port=5060
children=4

reply_to_via=1
listen = tcp:localhost:5060
listen = udp:localhost:5060
listen = tcp:localhost:5060
listen = udp:localhost:5060

mpath="/home/elias/src/sipservlet/seas"

loadmodule "modules/tm/tm.so"
loadmodule "modules/seas/seas.so"
loadmodule "modules/mi_fifo/mi_fifo.so"

modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
modparam("seas", "listen_sockets","127.0.0.1:5080")

route{
Expand Down
Loading

0 comments on commit b9fa793

Please sign in to comment.