Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriy Pylypenko committed Mar 26, 2021
2 parents 83cc7f1 + 3f96487 commit b9ba14d
Show file tree
Hide file tree
Showing 104 changed files with 4,200 additions and 1,115 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: recursive

- name: before_install
run: sh -x scripts/build/install_depends.sh
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "modules/wolfssl/lib/wolfssl"]
path = modules/wolfssl/lib/wolfssl
url = [email protected]:wolfSSL/wolfssl.git
2 changes: 1 addition & 1 deletion Makefile.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#xmpp= Gateway between OpenSIPS and a jabber server. It enables the exchange of IMs between SIP clients and XMPP(jabber) clients. | parsing/building XML files, typically libexpat1-devel
#uuid= UUID generator | uuid-dev

exclude_modules?= aaa_radius auth_jwt b2b_logic cachedb_cassandra cachedb_couchbase cachedb_memcached cachedb_mongodb cachedb_redis carrierroute cgrates compression cpl_c db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_sqlite db_unixodbc dialplan emergency event_rabbitmq h350 httpd identity jabber json ldap lua mi_xmlrpc_ng mmgeoip osp perl pi_http presence presence_dialoginfo presence_mwi presence_xml presence_dfks proto_sctp proto_tls proto_wss pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp python regex rabbitmq rabbitmq_consumer rest_client rls siprec sngtc snmpstats stir_shaken tls_mgm uuid xcap xcap_client xml xmpp
exclude_modules?= aaa_radius auth_jwt b2b_logic cachedb_cassandra cachedb_couchbase cachedb_memcached cachedb_mongodb cachedb_redis carrierroute cgrates compression cpl_c db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_sqlite db_unixodbc dialplan emergency event_rabbitmq event_kafka h350 httpd identity jabber json ldap lua mi_xmlrpc_ng mmgeoip osp perl pi_http presence presence_dialoginfo presence_mwi presence_xml presence_dfks proto_sctp proto_tls proto_wss pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp python regex rabbitmq rabbitmq_consumer rest_client rls siprec sngtc snmpstats stir_shaken tls_mgm uuid xcap xcap_client xml xmpp

include_modules?=

Expand Down
2 changes: 1 addition & 1 deletion Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ all_misclibs=reg
all_misclibs:=$(addprefix lib/, $(all_misclibs))

#implicit rules
%.o: %.c $(ALLDEP)
%.o: %.c $(ALLDEP) $(DEPS)
ifeq (,$(FASTER))
@echo "Compiling $<"
endif
Expand Down
9 changes: 9 additions & 0 deletions action.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,15 @@ void release_dummy_sip_msg( struct sip_msg* req)
req->set_global_address.len = req->set_global_port.len = 0;
req->add_rm = req->body_lumps = NULL;
req->reply_lump = NULL;
req->ruri_q = Q_UNSPECIFIED;
req->ruri_bflags = 0;
req->force_send_socket = NULL;
req->parsed_uri_ok = 0;
req->parsed_orig_ruri_ok = 0;
req->add_to_branch_len = 0;
req->flags = 0;
req->msg_flags = 0;
memset( &req->time, 0, sizeof(struct timeval));
dummy_static_in_used = 0;
} else {
LM_DBG("freeing allocated sip msg %p\n",req);
Expand Down
2 changes: 1 addition & 1 deletion ip_addr.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

enum sip_protos { PROTO_NONE = 0, PROTO_FIRST = 1, PROTO_UDP = 1, \
PROTO_TCP, PROTO_TLS, PROTO_SCTP, PROTO_WS, PROTO_WSS, PROTO_BIN,
PROTO_HEP_UDP, PROTO_HEP_TCP, PROTO_SMPP, PROTO_OTHER };
PROTO_BINS, PROTO_HEP_UDP, PROTO_HEP_TCP, PROTO_SMPP, PROTO_OTHER };
#define PROTO_LAST PROTO_OTHER

struct ip_addr{
Expand Down
20 changes: 11 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,17 @@ int main(int argc, char** argv)
if (tmp &&(*tmp)){
LM_ERR("bad pkgmem size number: -m %s\n", optarg);
goto error00;
};

}
break;
case 'm':
shm_mem_size=strtol(optarg, &tmp, 10) * 1024 * 1024;
if (tmp &&(*tmp)){
LM_ERR("bad shmem size number: -m %s\n", optarg);
goto error00;
};
}
break;
case 'd':
*log_level = debug_mode ? L_DBG : (*log_level)+1;
break;
case 'u':
user=optarg;
Expand Down Expand Up @@ -449,6 +451,7 @@ int main(int argc, char** argv)
break;
case 'm':
case 'M':
case 'd':
case 'a':
case 'k':
case 's':
Expand Down Expand Up @@ -491,9 +494,6 @@ int main(int argc, char** argv)
case 'R':
received_dns|=DO_REV_DNS;
break;
case 'd':
*log_level = debug_mode ? L_DBG : (*log_level)+1;
break;
case 'D':
debug_mode=1;
*log_level = L_DBG;
Expand Down Expand Up @@ -779,11 +779,13 @@ int main(int argc, char** argv)
LM_NOTICE("version: %s\n", version);

/* print some data about the configuration */
LM_INFO("using %ld Mb of shared memory\n", shm_mem_size/1024/1024);
LM_NOTICE("using %ld MB of shared memory, allocator: %s\n",
shm_mem_size/1024/1024, mm_str(mem_allocator_shm));
#if defined(PKG_MALLOC)
LM_INFO("using %ld Mb of private process memory\n", pkg_mem_size/1024/1024);
LM_NOTICE("using %ld MB of private process memory, allocator: %s\n",
pkg_mem_size/1024/1024, mm_str(mem_allocator_pkg));
#else
LM_INFO("using system memory for private process memory\n");
LM_NOTICE("using system memory for private process memory\n");
#endif

/* init async reactor */
Expand Down
2 changes: 1 addition & 1 deletion modules/acc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include ../../Makefile.defs
auto_gen=
NAME=acc.so
LIBS=
LIBS=-lm

# set ENABLE_DIAMETER_ACC to true if you wish to enable DIAMETER accounting
# (uncomment next line or 'ENABLE_DIAMETER_ACC=true make all')
Expand Down
4 changes: 2 additions & 2 deletions modules/acc/README
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ Chapter 3. Contributors
1. Bogdan-Andrei Iancu (@bogdan-iancu) 222 111 4302 4578
2. Jan Janak (@janakj) 145 16 5587 5074
3. Ionut Ionita (@ionutrazvanionita) 139 39 3730 4180
4. Razvan Crainea (@razvancrainea) 95 62 2678 616
4. Razvan Crainea (@razvancrainea) 97 64 2702 635
5. Liviu Chircu (@liviuchircu) 60 46 585 545
6. Jiri Kuthan (@jiriatipteldotorg) 56 26 2272 660
7. Daniel-Constantin Mierla (@miconda) 26 23 115 88
Expand Down Expand Up @@ -1104,7 +1104,7 @@ Chapter 3. Contributors

Table 3.2. Most recently active contributors^(1) to this module
Name Commit Activity
1. Razvan Crainea (@razvancrainea) Aug 2010 - Feb 2021
1. Razvan Crainea (@razvancrainea) Aug 2010 - Mar 2021
2. Maksym Sobolyev (@sobomax) Dec 2003 - Jan 2021
3. Liviu Chircu (@liviuchircu) Jan 2013 - Sep 2020
4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2003 - May 2020
Expand Down
39 changes: 22 additions & 17 deletions modules/acc/acc.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include <stdio.h>
#include <time.h>
#include <math.h>

#include "../../dprint.h"
#include "../../error.h"
Expand Down Expand Up @@ -178,7 +179,7 @@ static inline int core2strar( struct sip_msg *req, str *c_vals)

c_vals[5] = acc_env.reason;

gettimeofday(&acc_env.ts, NULL);
acc_env.ts = *get_msg_time(req);

return ACC_CORE_LEN;
}
Expand Down Expand Up @@ -221,6 +222,8 @@ int acc_log_cdrs(struct dlg_cell *dlg, struct sip_msg *msg, acc_ctx_t* ctx)
{
static char log_msg[MAX_SYSLOG_SIZE];
static char *log_msg_end=log_msg+MAX_SYSLOG_SIZE-2;
unsigned long ms_duration;
unsigned long duration;
char *p;
int i, j, ret, res = -1, n;
struct timeval start_time;
Expand Down Expand Up @@ -284,12 +287,13 @@ int acc_log_cdrs(struct dlg_cell *dlg, struct sip_msg *msg, acc_ctx_t* ctx)
*(p++) = '\n';
*(p++) = 0;

ms_duration = TIMEVAL_MS_DIFF(start_time, ctx->bye_time);
duration = ceil((double)ms_duration/1000);

LM_GEN2(acc_log_facility, acc_log_level,
"%.*screated=%lu;call_start_time=%lu;duration=%lu;ms_duration=%lu;setuptime=%lu%s",
acc_env.text.len, acc_env.text.s,(unsigned long)ctx->created,
(unsigned long)start_time.tv_sec,
(unsigned long)(ctx->bye_time.tv_sec-start_time.tv_sec),
(unsigned long)TIMEVAL_MS_DIFF(start_time, ctx->bye_time),
(unsigned long)start_time.tv_sec, duration, ms_duration,
(unsigned long)(start_time.tv_sec - ctx->created), log_msg);

res = 1;
Expand Down Expand Up @@ -680,10 +684,10 @@ int acc_db_cdrs(struct dlg_cell *dlg, struct sip_msg *msg, acc_ctx_t* ctx)
start_time.tv_sec - ctx->created;
VAL_NULL(db_vals+ret+nr_leg_vals+2) = 0;
VAL_TIME(db_vals+ret+nr_leg_vals+2) = ctx->created;
VAL_INT(db_vals+ret+nr_leg_vals+3) =
ctx->bye_time.tv_sec - start_time.tv_sec;
VAL_INT(db_vals+ret+nr_leg_vals+4) =
TIMEVAL_MS_DIFF(start_time, ctx->bye_time);
VAL_INT(db_vals+ret+nr_leg_vals+3) =
ceil((double)VAL_INT(db_vals+ret+nr_leg_vals+4)/1000);

total = ret + 5;
acc_dbf.use_table(db_handle, &table);
Expand Down Expand Up @@ -937,6 +941,7 @@ int acc_aaa_cdrs(struct dlg_cell *dlg, struct sip_msg *msg, acc_ctx_t* ctx)
int offset, av_type;
aaa_map *r_stat;
int locked = 0;
uint32_t duration, ms_duration;

struct acc_extra* extra;

Expand Down Expand Up @@ -980,11 +985,11 @@ int acc_aaa_cdrs(struct dlg_cell *dlg, struct sip_msg *msg, acc_ctx_t* ctx)
ADD_AAA_AVPAIR( offset + i, val_arr[i].s, val_arr[i].len );
offset = ret + 2;

ms_duration = TIMEVAL_MS_DIFF(start_time, ctx->bye_time);
duration = ceil((double)ms_duration/1000);
/* add duration and setup values */
av_type = (uint32_t)(ctx->bye_time.tv_sec - start_time.tv_sec);
ADD_AAA_AVPAIR( offset + nr_leg_vals, &av_type, -1);
av_type = (uint32_t)TIMEVAL_MS_DIFF(start_time, ctx->bye_time);
ADD_AAA_AVPAIR( offset + nr_leg_vals + 1, &av_type, -1);
ADD_AAA_AVPAIR( offset + nr_leg_vals, &duration, -1);
ADD_AAA_AVPAIR( offset + nr_leg_vals + 1, &ms_duration, -1);
av_type = (uint32_t)(start_time.tv_sec - ctx->created);
ADD_AAA_AVPAIR( offset + nr_leg_vals + 2, &av_type, -1);

Expand Down Expand Up @@ -1295,9 +1300,9 @@ int acc_evi_cdrs(struct dlg_cell *dlg, struct sip_msg *msg, acc_ctx_t* ctx)
{
int i, ret, res = -1, j;
int nr_leg_vals;
int aux_time;
struct timeval start_time;
str core_s, leg_s, extra_s;
unsigned long duration, ms_duration, setup_duration;

struct acc_extra* extra;

Expand Down Expand Up @@ -1335,19 +1340,19 @@ int acc_evi_cdrs(struct dlg_cell *dlg, struct sip_msg *msg, acc_ctx_t* ctx)
goto end;
}

aux_time = ctx->bye_time.tv_sec - start_time.tv_sec;
if (evi_param_set_int(evi_cdr_params[ret+nr_leg_vals+1], &aux_time) < 0) {
ms_duration = TIMEVAL_MS_DIFF(start_time, ctx->bye_time);
duration = ceil((double)ms_duration/1000);
if (evi_param_set_int(evi_cdr_params[ret+nr_leg_vals+1], &duration) < 0) {
LM_ERR("cannot set duration parameter\n");
goto end;
}

aux_time = TIMEVAL_MS_DIFF(start_time, ctx->bye_time);
if (evi_param_set_int(evi_cdr_params[ret+nr_leg_vals+2], &aux_time) < 0) {
if (evi_param_set_int(evi_cdr_params[ret+nr_leg_vals+2], &ms_duration) < 0) {
LM_ERR("cannot set duration parameter\n");
goto end;
}
aux_time = start_time.tv_sec - ctx->created;
if (evi_param_set_int(evi_cdr_params[ret+nr_leg_vals+3], &aux_time) < 0) {
setup_duration = start_time.tv_sec - ctx->created;
if (evi_param_set_int(evi_cdr_params[ret+nr_leg_vals+3], &setup_duration) < 0) {
LM_ERR("cannot set setuptime parameter\n");
goto end;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/acc/acc_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ static void acc_dlg_ended(struct dlg_cell *dlg, int type,
set_dlg_cb_used(ctx->flags);

/* this time will be used to set */
gettimeofday(&ctx->bye_time, NULL);
ctx->bye_time = *get_msg_time(_params->msg);

/* if it's not a local transaction we do the accounting on the tm callbacks */
if (((t=tmb.t_gett()) == T_UNDEFINED) || !t ||
Expand Down
10 changes: 5 additions & 5 deletions modules/acc/doc/contributors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
<row>
<entry>4. </entry>
<entry>Razvan Crainea (<ulink url="https://github.com/razvancrainea">@razvancrainea</ulink>)</entry>
<entry align="center">95</entry>
<entry align="center">62</entry>
<entry align="center">2678</entry>
<entry align="center">616</entry>
<entry align="center">97</entry>
<entry align="center">64</entry>
<entry align="center">2702</entry>
<entry align="center">635</entry>
</row>
<row>
<entry>5. </entry>
Expand Down Expand Up @@ -129,7 +129,7 @@
<row>
<entry>1. </entry>
<entry>Razvan Crainea (<ulink url="https://github.com/razvancrainea">@razvancrainea</ulink>)</entry>
<entry align="center">Aug 2010 - Feb 2021</entry>
<entry align="center">Aug 2010 - Mar 2021</entry>
</row>
<row>
<entry>2. </entry>
Expand Down
24 changes: 11 additions & 13 deletions modules/auth_aaa/README
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,8 @@ modparam("auth_aaa", "use_ruri_flag", "USE_RURI_FLAG")
Example 1.6. aaa_www_authorize usage

...
if (!aaa_www_authorize("siphub.net")) {
www_challenge("siphub.net", "1");
};
if (!aaa_www_authorize("siphub.net"))
www_challenge("siphub.net", "auth");
...


Expand Down Expand Up @@ -257,14 +256,13 @@ if (!aaa_www_authorize("siphub.net")) {
Example 1.7. proxy_authorize usage

...
if (!aaa_proxy_authorize("")) { # Realm and URI user will be autogener
ated
proxy_challenge("", "1");
};
if (!aaa_proxy_authorize("")) # Realm and URI user will be autogenera
ted
proxy_challenge("", "auth");
...
if (!aaa_proxy_authorize($pd, $pU)) { # Realm and URI user are taken
proxy_challenge($pd, "1"); # from P-Preferred-Identity
}; # header field
if (!aaa_proxy_authorize($pd, $pU)) # Realm and URI user are taken
proxy_challenge($pd, "auth"); # from P-Preferred-Identity
# header field
...


Expand Down Expand Up @@ -317,7 +315,7 @@ Chapter 2. Contributors
Name DevScore Commits Lines ++ Lines --
1. Jan Janak (@janakj) 87 24 3294 2182
2. Bogdan-Andrei Iancu (@bogdan-iancu) 44 31 892 255
3. Liviu Chircu (@liviuchircu) 17 14 73 119
3. Liviu Chircu (@liviuchircu) 19 15 80 128
4. Daniel-Constantin Mierla (@miconda) 15 13 67 55
5. Irina-Maria Stanescu 15 8 185 299
6. Maksym Sobolyev (@sobomax) 11 6 167 171
Expand Down Expand Up @@ -351,8 +349,8 @@ Chapter 2. Contributors

Table 2.2. Most recently active contributors^(1) to this module
Name Commit Activity
1. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - May 2020
2. Liviu Chircu (@liviuchircu) Jan 2013 - Jan 2020
1. Liviu Chircu (@liviuchircu) Jan 2013 - Mar 2021
2. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - May 2020
3. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019
4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019
5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018
Expand Down
16 changes: 7 additions & 9 deletions modules/auth_aaa/doc/auth_aaa_admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,8 @@ modparam("auth_aaa", "use_ruri_flag", "USE_RURI_FLAG")
<programlisting format="linespecific">

...
if (!aaa_www_authorize("siphub.net")) {
www_challenge("siphub.net", "1");
};
if (!aaa_www_authorize("siphub.net"))
www_challenge("siphub.net", "auth");
...

</programlisting>
Expand Down Expand Up @@ -305,13 +304,12 @@ if (!aaa_www_authorize("siphub.net")) {
<programlisting format="linespecific">

...
if (!aaa_proxy_authorize("")) { # Realm and URI user will be autogenerated
proxy_challenge("", "1");
};
if (!aaa_proxy_authorize("")) # Realm and URI user will be autogenerated
proxy_challenge("", "auth");
...
if (!aaa_proxy_authorize($pd, $pU)) { # Realm and URI user are taken
proxy_challenge($pd, "1"); # from P-Preferred-Identity
}; # header field
if (!aaa_proxy_authorize($pd, $pU)) # Realm and URI user are taken
proxy_challenge($pd, "auth"); # from P-Preferred-Identity
# header field
...

</programlisting>
Expand Down
Loading

0 comments on commit b9ba14d

Please sign in to comment.