TT#122350 update patches

* remove already applied patches
* revert 79be32bcc45775f703319730d405727b0a983726 from upstream
  collides with our implementation
* refresh patches
* add upstream patches from 5.5

Change-Id: I64b551e31b07c7d2df644e7c2d98c2b27639be3a
mr9.5.1
Victor Seva 4 years ago
parent f274ec75e6
commit 8d03aef662

@ -7,7 +7,7 @@ Subject: fix_export
1 file changed, 2 insertions(+)
diff --git a/src/Makefile b/src/Makefile
index 4179d2d..e6ab97f 100644
index 23a5235..14cc0d7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -139,6 +139,8 @@ endif

@ -7,7 +7,7 @@ Subject: no_INSTALL_file
1 file changed, 2 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 2decc4d..4179d2d 100644
index 11be15f..23a5235 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -861,8 +861,6 @@ install-modules-all: install-every-module install-every-module-doc

@ -7,7 +7,7 @@ Subject: no_lib64_on_64_bits
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/Makefile.defs b/src/Makefile.defs
index 05e47cd..10da39d 100644
index 6b24118..00eecaa 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -454,15 +454,7 @@ endif

@ -31,12 +31,12 @@ sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch
sipwise/sca-debug.patch
sipwise/sca-fix-notify-after-bye.patch
sipwise/sca-add-pai_avp-parameter.patch
## backports from upstream (5.4)
upstream/core-usr-avp-fix-detection-of-invalid-name-and-ids.patch
## upstream master (5.5)
upstream/permissions-basic-safety-for-concurent-rpc-reload.patch
upstream/permissions-add-reload_delta-parameter.patch
upstream/ndb_redis-set-message-level-to-debug-on-reconnect.patch
## upstream 5.5
# https://github.com/kamailio/kamailio/pull/979
# collides with our changes to pua_dialoginfo
sipwise/Revert-pua_dialoginfo-disable-publish-notifications-.patch
upstream/tm-lw-parser-fix-matching-To-header-in-lw_get_hf_nam.patch
upstream/lwsc-set-ws_ping_pong_interval-only-for-libwebsocket.patch
### relevant for upstream
sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch
sipwise/pua_dialoginfo-local_identity_dlg_var.patch
@ -44,7 +44,6 @@ sipwise/pua_dialoginfo-use-lock-when-use_puburi_avps-is-set.patch
sipwise/dialplan-don-t-stop-loading-rules-on-error.patch
sipwise/cfgt-skip-tm-vars-T_.patch
sipwise/cfgt-skip.patch
sipwise/rtpengine-codec-set-except.patch
sipwise/topos-don-t-insert-contact-header-for-4xx-replies.patch
sipwise/db_redis_skip_empty_keys.patch
sipwise/db_redis_graceful_scan.patch

@ -0,0 +1,510 @@
From 58fc634fe98953a2dfa1dd1ba9cf5e5c1d57416f Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 12 May 2021 11:40:59 +0200
Subject: [PATCH] Revert "pua_dialoginfo: disable publish notifications for
subsequent requests (key: publish_dialog_req_within)"
This reverts commit 79be32bcc45775f703319730d405727b0a983726.
---
.../pua_dialoginfo/doc/pua_dialoginfo.xml | 9 -
.../doc/pua_dialoginfo_admin.xml | 66 +-----
src/modules/pua_dialoginfo/pua_dialoginfo.c | 188 ++++++------------
src/modules/pua_dialoginfo/pua_dialoginfo.h | 3 -
4 files changed, 61 insertions(+), 205 deletions(-)
diff --git a/src/modules/pua_dialoginfo/doc/pua_dialoginfo.xml b/src/modules/pua_dialoginfo/doc/pua_dialoginfo.xml
index df1e08557e..fd0a3fac5f 100644
--- a/src/modules/pua_dialoginfo/doc/pua_dialoginfo.xml
+++ b/src/modules/pua_dialoginfo/doc/pua_dialoginfo.xml
@@ -45,11 +45,6 @@
<email>phil.lavin@synety.com</email>
</address>
</editor>
- <editor>
- <firstname>Frederic</firstname>
- <surname>Gaisnon</surname>
- <email>frederic.gaisnon@gmail.com</email>
- </editor>
</authorgroup>
<copyright>
<year>2006</year>
@@ -59,10 +54,6 @@
<year>2008</year>
<holder>Klaus Darilion IPCom</holder>
</copyright>
- <copyright>
- <year>2021</year>
- <holder>MomentTech</holder>
- </copyright>
</bookinfo>
<toc></toc>
diff --git a/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml b/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml
index 191ee5f4e7..81ef722a4f 100644
--- a/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml
+++ b/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml
@@ -536,71 +536,7 @@ modparam("pua_dialoginfo", "callee_trying", 1)
</programlisting>
</example>
</section>
-
- <section>
- <title><varname>caller_entity_when_publish_disabled</varname> (int)</title>
- <para>
- Must be a valid sip uri.
- If this parameter is set, this uri is used as caller entity in
- publish xml body if associated dialog has the flag
- disable_caller_publish_flag set.
- Note only the flag received on dialog creation is used to activate
- this feature.
- </para>
- <para>
- <emphasis>Default value is <quote>NULL</quote>.</emphasis>
- </para>
- <example>
- <title>Set <varname>caller_entity_when_publish_disabled</varname> parameter</title>
- <programlisting format="linespecific">
-...
-modparam("pua_dialoginfo", "caller_entity_when_publish_disabled", "sip:caller@publish.disabled.com")
-...
- </programlisting>
- </example>
- </section>
-
- <section>
- <title><varname>callee_entity_when_publish_disabled</varname> (int)</title>
- <para>
- Must be a valid sip uri.
- If this parameter is set, this uri is used as callee entity in
- publish xml body if associated dialog has the flag
- disable_callee_publish_flag set.
- Note only the flag received on dialog creation is used to activate
- this feature.
- </para>
- <para>
- <emphasis>Default value is <quote>NULL</quote>.</emphasis>
- </para>
- <example>
- <title>Set <varname>callee_entity_when_publish_disabled</varname> parameter</title>
- <programlisting format="linespecific">
-...
-modparam("pua_dialoginfo", "callee_entity_when_publish_disabled", "sip:callee@publish.disabled.com")
-...
- </programlisting>
- </example>
- </section>
-
- <section>
- <title><varname>publish_dialog_req_within</varname> (int)</title>
- <para>
- If this parameter is set to 1, subsequents requests received in dialog generate
- corresponding publish request.
- </para>
- <para>
- <emphasis>Default value is <quote>1</quote>.</emphasis>
- </para>
- <example>
- <title>Set <varname>publish_dialog_req_within</varname> parameter</title>
- <programlisting format="linespecific">
-...
-modparam("pua_dialoginfo", "publish_dialog_req_within", 0)
-...
- </programlisting>
- </example>
- </section>
+ </section>
<section id="pua_dialoginfo.p.attribute_display">
<title><varname>attribute_display</varname> (int)</title>
diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c
index 7e7afe2eae..9ff64aa023 100644
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.c
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c
@@ -63,7 +63,6 @@ MODULE_VERSION
#define DEF_CALLEE_TRYING 0
#define DEF_DISABLE_CALLER_PUBLISH_FLAG -1
#define DEF_DISABLE_CALLEE_PUBLISH_FLAG -1
-#define DEF_PUBLISH_DIALOG_REQ_WITHIN 1
/* define PUA_DIALOGINFO_DEBUG to activate more verbose
* logging and dialog info callback debugging
@@ -81,8 +80,6 @@ int_str pubruri_callee_avp_name;
static str caller_dlg_var = {0, 0}; /* pubruri_caller */
static str callee_dlg_var = {0, 0}; /* pubruri_callee */
-static str caller_entity_when_publish_disabled = {0, 0}; /* pubruri_caller */
-static str callee_entity_when_publish_disabled = {0, 0}; /* pubruri_callee */
/* Module parameter variables */
int include_callid = DEF_INCLUDE_CALLID;
@@ -98,7 +95,7 @@ int disable_caller_publish_flag = DEF_DISABLE_CALLER_PUBLISH_FLAG;
int disable_callee_publish_flag = DEF_DISABLE_CALLEE_PUBLISH_FLAG;
char * pubruri_caller_avp = DEF_PUBRURI_CALLER_AVP;
char * pubruri_callee_avp = DEF_PUBRURI_CALLEE_AVP;
-int publish_dialog_req_within = DEF_PUBLISH_DIALOG_REQ_WITHIN;
+
int puadinfo_attribute_display = 0;
@@ -128,9 +125,6 @@ static param_export_t params[]={
{"callee_trying", INT_PARAM, &callee_trying },
{"disable_caller_publish_flag", INT_PARAM, &disable_caller_publish_flag },
{"disable_callee_publish_flag", INT_PARAM, &disable_callee_publish_flag },
- {"caller_entity_when_publish_disabled", PARAM_STR, &caller_entity_when_publish_disabled },
- {"callee_entity_when_publish_disabled", PARAM_STR, &callee_entity_when_publish_disabled },
- {"publish_dialog_req_within", INT_PARAM, &publish_dialog_req_within },
{"attribute_display", PARAM_INT, &puadinfo_attribute_display },
{0, 0, 0 }
};
@@ -258,7 +252,6 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
{
str tag = {0,0};
str uri = {0,0};
- str identity_local = {0,0};
str target = {0,0};
struct dlginfo_cell *dlginfo = NULL;
@@ -281,33 +274,25 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
uri = dlginfo->to_uri;
}
- if (dlginfo->disable_caller_publish) {
- identity_local=caller_entity_when_publish_disabled;
- } else {
- identity_local=dlginfo->from_uri;
- }
-
- if (dlginfo->disable_callee_publish) {
- uri=callee_entity_when_publish_disabled;
- }
-
switch (type) {
case DLGCB_FAILED:
case DLGCB_TERMINATED:
case DLGCB_EXPIRED:
LM_DBG("dialog over, from=%.*s\n", dlginfo->from_uri.len,
dlginfo->from_uri.s);
- if ((!dlginfo->disable_caller_publish) && (disable_caller_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_caller_publish_flag))))) {
+ if (disable_caller_publish_flag == -1 || !(request
+ && (request->flags & (1<<disable_caller_publish_flag))))
+ {
dialog_publish_multi("terminated", dlginfo->pubruris_caller,
- &identity_local, &uri, &(dlginfo->callid), 1,
+ &(dlginfo->from_uri), &uri, &(dlginfo->callid), 1,
10, 0, 0, &(dlginfo->from_contact),
&target, send_publish_flag==-1?1:0);
}
- if ((!dlginfo->disable_callee_publish) && (disable_callee_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_callee_publish_flag))))) {
+ if (disable_callee_publish_flag == -1 || !(request
+ && (request->flags & (1<<disable_callee_publish_flag))))
+ {
dialog_publish_multi("terminated", dlginfo->pubruris_callee,
- &uri, &identity_local, &(dlginfo->callid), 0,
+ &uri, &(dlginfo->from_uri), &(dlginfo->callid), 0,
10, 0, 0, &target, &(dlginfo->from_contact),
send_publish_flag==-1?1:0);
}
@@ -317,17 +302,19 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
case DLGCB_CONFIRMED_NA:
LM_DBG("dialog confirmed, from=%.*s\n", dlginfo->from_uri.len,
dlginfo->from_uri.s);
- if ((!dlginfo->disable_caller_publish) && (disable_caller_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_caller_publish_flag))))) {
+ if (disable_caller_publish_flag == -1 || !(request
+ && (request->flags & (1<<disable_caller_publish_flag))))
+ {
dialog_publish_multi("confirmed", dlginfo->pubruris_caller,
- &identity_local, &uri, &(dlginfo->callid), 1,
+ &(dlginfo->from_uri), &uri, &(dlginfo->callid), 1,
dlginfo->lifetime, 0, 0, &(dlginfo->from_contact), &target,
send_publish_flag==-1?1:0);
}
- if ((!dlginfo->disable_callee_publish) && (disable_callee_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_callee_publish_flag))))) {
+ if (disable_callee_publish_flag == -1 || !(request
+ && (request->flags & (1<<disable_callee_publish_flag))))
+ {
dialog_publish_multi("confirmed", dlginfo->pubruris_callee, &uri,
- &identity_local, &(dlginfo->callid), 0,
+ &(dlginfo->from_uri), &(dlginfo->callid), 0,
dlginfo->lifetime, 0, 0, &target, &(dlginfo->from_contact),
send_publish_flag==-1?1:0);
}
@@ -363,51 +350,54 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
tag.len = 0;
}
}
- if ((!dlginfo->disable_caller_publish) && (disable_caller_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_caller_publish_flag))))) {
+ if (disable_caller_publish_flag == -1 || !(request
+ && (request->flags & (1<<disable_caller_publish_flag))))
+ {
if (caller_confirmed) {
dialog_publish_multi("confirmed", dlginfo->pubruris_caller,
- &identity_local, &uri, &(dlginfo->callid), 1,
+ &(dlginfo->from_uri), &uri, &(dlginfo->callid), 1,
dlginfo->lifetime, &(dlginfo->from_tag), &tag,
&(dlginfo->from_contact), &target,
send_publish_flag==-1?1:0);
} else {
dialog_publish_multi("early", dlginfo->pubruris_caller,
- &identity_local, &uri, &(dlginfo->callid), 1,
+ &(dlginfo->from_uri), &uri, &(dlginfo->callid), 1,
dlginfo->lifetime, &(dlginfo->from_tag), &tag,
&(dlginfo->from_contact), &target,
send_publish_flag==-1?1:0);
}
}
- if ((!dlginfo->disable_callee_publish) && (disable_callee_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_callee_publish_flag))))) {
+ if (disable_callee_publish_flag == -1 || !(request &&
+ (request->flags & (1<<disable_callee_publish_flag))))
+ {
dialog_publish_multi("early", dlginfo->pubruris_callee, &uri,
- &identity_local, &(dlginfo->callid), 0,
+ &(dlginfo->from_uri), &(dlginfo->callid), 0,
dlginfo->lifetime, &tag, &(dlginfo->from_tag), &target,
&(dlginfo->from_contact), send_publish_flag==-1?1:0);
}
} else {
- if ((!dlginfo->disable_caller_publish) && (disable_caller_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_caller_publish_flag))))) {
+ if (disable_caller_publish_flag == -1 || !(request &&
+ (request->flags & (1<<disable_caller_publish_flag))))
+ {
if (caller_confirmed) {
dialog_publish_multi("confirmed", dlginfo->pubruris_caller,
- &identity_local, &uri, &(dlginfo->callid), 1,
+ &(dlginfo->from_uri), &uri, &(dlginfo->callid), 1,
dlginfo->lifetime, 0, 0, &(dlginfo->from_contact),
&target, send_publish_flag==-1?1:0);
} else {
dialog_publish_multi("early", dlginfo->pubruris_caller,
- &identity_local, &uri, &(dlginfo->callid), 1,
+ &(dlginfo->from_uri), &uri, &(dlginfo->callid), 1,
dlginfo->lifetime, 0, 0, &(dlginfo->from_contact),
&target, send_publish_flag==-1?1:0);
}
}
- if ((!dlginfo->disable_callee_publish) && (disable_callee_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_callee_publish_flag)))))
+ if (disable_callee_publish_flag == -1 || !(request
+ && (request->flags & (1<<disable_callee_publish_flag))))
{
dialog_publish_multi("early", dlginfo->pubruris_callee, &uri,
- &identity_local, &(dlginfo->callid), 0,
+ &(dlginfo->from_uri), &(dlginfo->callid), 0,
dlginfo->lifetime, 0, 0, &target,
&(dlginfo->from_contact), send_publish_flag==-1?1:0);
}
@@ -416,17 +406,19 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
default:
LM_ERR("unhandled dialog callback type %d received, from=%.*s\n",
type, dlginfo->from_uri.len, dlginfo->from_uri.s);
- if ((!dlginfo->disable_caller_publish) && (disable_caller_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_caller_publish_flag))))) {
+ if (disable_caller_publish_flag == -1 || !(request &&
+ (request->flags & (1<<disable_caller_publish_flag))))
+ {
dialog_publish_multi("terminated", dlginfo->pubruris_caller,
- &identity_local, &uri, &(dlginfo->callid), 1,
+ &(dlginfo->from_uri), &uri, &(dlginfo->callid), 1,
10, 0, 0, &(dlginfo->from_contact), &target,
send_publish_flag==-1?1:0);
}
- if ((!dlginfo->disable_callee_publish) && (disable_callee_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_callee_publish_flag))))) {
+ if (disable_callee_publish_flag == -1 || !(request &&
+ (request->flags & (1<<disable_callee_publish_flag))))
+ {
dialog_publish_multi("terminated", dlginfo->pubruris_callee, &uri,
- &identity_local, &(dlginfo->callid), 0,
+ &(dlginfo->from_uri), &(dlginfo->callid), 0,
10, 0, 0, &target, &(dlginfo->from_contact),
send_publish_flag==-1?1:0);
}
@@ -482,7 +474,7 @@ struct str_list* get_str_list(unsigned short avp_flags, int_str avp_name) {
}
-struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type, int disable_caller_publish, int disable_callee_publish)
+struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
{
struct dlginfo_cell *dlginfo;
int len;
@@ -506,8 +498,6 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type, int disable
/* copy from dlg structure to dlginfo structure */
dlginfo->lifetime = override_lifetime ? override_lifetime : dlg->lifetime;
- dlginfo->disable_caller_publish = disable_caller_publish;
- dlginfo->disable_callee_publish = disable_callee_publish;
dlginfo->from_uri.s = (char*)dlginfo + sizeof(struct dlginfo_cell);
dlginfo->from_uri.len = dlg->from_uri.len;
dlginfo->to_uri.s = dlginfo->from_uri.s + dlg->from_uri.len;
@@ -609,25 +599,14 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type, int disable
}
/* register dialog callbacks which triggers sending PUBLISH */
- if (publish_dialog_req_within) {
- if (dlg_api.register_dlgcb(dlg,
+ if (dlg_api.register_dlgcb(dlg,
DLGCB_FAILED| DLGCB_CONFIRMED_NA | DLGCB_TERMINATED
| DLGCB_EXPIRED | DLGCB_REQ_WITHIN | DLGCB_EARLY,
__dialog_sendpublish, dlginfo, free_dlginfo_cell) != 0) {
- LM_ERR("cannot register callback for interesting dialog types\n");
- free_dlginfo_cell(dlginfo);
- return NULL;
- }
- } else {
- if (dlg_api.register_dlgcb(dlg,
- DLGCB_FAILED| DLGCB_CONFIRMED_NA | DLGCB_TERMINATED
- | DLGCB_EXPIRED | DLGCB_EARLY,
- __dialog_sendpublish, dlginfo, free_dlginfo_cell) != 0) {
- LM_ERR("cannot register callback for interesting dialog types\n");
- free_dlginfo_cell(dlginfo);
- return NULL;
- }
- }
+ LM_ERR("cannot register callback for interesting dialog types\n");
+ free_dlginfo_cell(dlginfo);
+ return NULL;
+ }
#ifdef PUA_DIALOGINFO_DEBUG
/* dialog callback testing (registered last to be executed frist) */
@@ -651,10 +630,6 @@ __dialog_created(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params)
{
struct sip_msg *request = _params->req;
struct dlginfo_cell *dlginfo;
- str identity_remote = {0,0};
- str identity_local = {0,0};
- int disable_caller_publish = 0;
- int disable_callee_publish = 0;
if (request==NULL || request->REQ_METHOD != METHOD_INVITE)
return;
@@ -665,46 +640,26 @@ __dialog_created(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params)
LM_DBG("new INVITE dialog created: from=%.*s\n",
dlg->from_uri.len, dlg->from_uri.s);
- if (disable_caller_publish_flag != -1 && caller_entity_when_publish_disabled.len > 0 &&
- (request && (request->flags & (1<<disable_caller_publish_flag)))) {
- disable_caller_publish = 1;
- }
-
- if (disable_callee_publish_flag != -1 && callee_entity_when_publish_disabled.len > 0 &&
- (request && (request->flags & (1<<disable_callee_publish_flag)))) {
- disable_callee_publish=1;
- }
-
- dlginfo=get_dialog_data(dlg, type, disable_caller_publish, disable_callee_publish);
+ dlginfo=get_dialog_data(dlg, type);
if(dlginfo==NULL)
return;
- if (disable_caller_publish) {
- identity_local=caller_entity_when_publish_disabled;
- } else {
- identity_local=dlginfo->from_uri;
- }
-
- if (disable_callee_publish) {
- identity_remote=callee_entity_when_publish_disabled;
- } else {
- identity_remote=(include_req_uri)?dlg->req_uri:dlg->to_uri;
- }
-
- if ((!disable_caller_publish) && (disable_caller_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_caller_publish_flag))))) {
+ if (disable_caller_publish_flag == -1 || !(request && (request->flags
+ & (1<<disable_caller_publish_flag))))
+ {
dialog_publish_multi("Trying", dlginfo->pubruris_caller,
- &identity_local,
- &identity_remote,
+ &(dlg->from_uri),
+ (include_req_uri)?&(dlg->req_uri):&(dlg->to_uri),
&(dlg->callid), 1, dlginfo->lifetime,
0, 0, 0, 0, (send_publish_flag==-1)?1:0);
}
- if (callee_trying && ((!disable_callee_publish) && (disable_callee_publish_flag == -1 || !(request
- && (request->flags & (1<<disable_callee_publish_flag)))))) {
+ if (callee_trying && (disable_callee_publish_flag == -1 || !(request
+ && (request->flags & (1<<disable_callee_publish_flag)))))
+ {
dialog_publish_multi("Trying", dlginfo->pubruris_callee,
- &identity_remote,
- &identity_local,
+ (include_req_uri)?&(dlg->req_uri):&(dlg->to_uri),
+ &(dlg->from_uri),
&(dlg->callid), 0, dlginfo->lifetime,
0, 0, 0, 0, (send_publish_flag==-1)?1:0);
}
@@ -718,7 +673,7 @@ __dialog_loaded(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params)
LM_DBG("INVITE dialog loaded: from=%.*s\n",
dlg->from_uri.len, dlg->from_uri.s);
- dlginfo=get_dialog_data(dlg, type, 0, 0);
+ dlginfo=get_dialog_data(dlg, type);
if(dlginfo!=NULL) {
LM_DBG("dialog info initialized (from=%.*s)\n",
dlg->from_uri.len, dlg->from_uri.s);
@@ -736,7 +691,6 @@ static int mod_init(void)
str s;
pv_spec_t avp_spec;
- struct sip_uri ruri_uri;
if(caller_dlg_var.len<=0) {
LM_WARN("pubruri_caller_dlg_var is not set"
@@ -748,28 +702,6 @@ static int mod_init(void)
" - restore on restart disabled\n");
}
- if((caller_entity_when_publish_disabled.len > 0) && (disable_caller_publish_flag == -1)) {
- LM_WARN("caller_entity_when_publish_disabled is set but disable_caller_publish_flag is not defined"
- " - caller_entity_when_publish_disabled cannot be used \n");
- }
-
- if((callee_entity_when_publish_disabled.len > 0) && (disable_callee_publish_flag == -1)) {
- LM_WARN("callee_entity_when_publish_disabled is set but disable_callee_publish_flag is not defined"
- " - callee_entity_when_publish_disabled cannot be used \n");
- }
-
- if ((caller_entity_when_publish_disabled.len > 0) &&
- (parse_uri(caller_entity_when_publish_disabled.s, caller_entity_when_publish_disabled.len, &ruri_uri) < 0)) {
- LM_ERR("caller_entity_when_publish_disabled is not a valid SIP uri\n");
- return -1;
- }
-
- if ((callee_entity_when_publish_disabled.len > 0) &&
- (parse_uri(callee_entity_when_publish_disabled.s, callee_entity_when_publish_disabled.len, &ruri_uri) < 0)) {
- LM_ERR("callee_entity_when_publish_disabled is not a valid SIP uri\n");
- return -1;
- }
-
bind_pua= (bind_pua_t)find_export("bind_pua", 1,0);
if (!bind_pua)
{
diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.h b/src/modules/pua_dialoginfo/pua_dialoginfo.h
index 2551beb4fa..01fc876999 100644
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.h
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.h
@@ -45,9 +45,6 @@ struct dlginfo_cell {
struct str_list* pubruris_caller;
struct str_list* pubruris_callee;
unsigned int lifetime;
- /*dialog module does not always resend all flags, so we use flags set on first request*/
- int disable_caller_publish;
- int disable_callee_publish;
};
--
2.20.1

@ -13,7 +13,7 @@ Subject: add_lcr_rate_module
create mode 100644 src/modules/lcr_rate/lcr_rate_mod.c
diff --git a/src/Makefile.groups b/src/Makefile.groups
index 7b879ec..6f7bf91 100644
index 3f0493c..d0d5ed9 100644
--- a/src/Makefile.groups
+++ b/src/Makefile.groups
@@ -106,6 +106,9 @@ mod_list_sctp=sctp
@ -26,10 +26,10 @@ index 7b879ec..6f7bf91 100644
# - modules related to SIMPLE presence extensions
mod_list_presence=presence presence_conference presence_dialoginfo \
presence_mwi presence_profile presence_reginfo \
@@ -256,8 +259,8 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \
$(mod_list_kafka) \
$(mod_list_mqtt) \
$(mod_list_secsipid) \
@@ -268,8 +271,8 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \
$(mod_list_jwt) \
$(mod_list_lwsc) \
$(mod_list_stirshaken) \
- $(mod_list_rtp_media_server)
-
+ $(mod_list_rtp_media_server) \
@ -37,7 +37,7 @@ index 7b879ec..6f7bf91 100644
### --- Groups defined for source code compilation ###
@@ -310,6 +313,8 @@ module_group_cassandra=$(module_group_cassandra_driver) $(module_group_db)
@@ -322,6 +325,8 @@ module_group_cassandra=$(module_group_cassandra_driver) $(module_group_db)
module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all)))

@ -17,16 +17,16 @@ Subject: add_pcem_module
create mode 100644 src/modules/pcem/pcem_mod.h
diff --git a/src/Makefile.groups b/src/Makefile.groups
index fe74c7e..7b879ec 100644
index 42c036d..3f0493c 100644
--- a/src/Makefile.groups
+++ b/src/Makefile.groups
@@ -30,8 +30,8 @@ mod_list_db=acc alias_db auth_db avpops cfg_db db_text db_flatstore \
db_cluster dialog dispatcher domain drouting group \
htable imc matrix mohqueue msilo mtree p_usrloc pdt permissions \
pipelimit prefix_route registrar sipcapture siptrace speeddial \
- sqlops uac uri_db userblacklist usrloc secfilter
- sqlops uac uri_db userblocklist usrloc secfilter
-
+ sqlops uac uri_db userblacklist usrloc secfilter \
+ sqlops uac uri_db userblocklist usrloc secfilter \
+ pcem
# - common modules depending on database, using UID db schema

@ -22,7 +22,7 @@ Subject: add_presence_dfks_module
create mode 100644 src/modules/presence_dfks/presence_dfks.h
diff --git a/src/Makefile.groups b/src/Makefile.groups
index cd2bdbd..190102b 100644
index 475558b..9dffef4 100644
--- a/src/Makefile.groups
+++ b/src/Makefile.groups
@@ -115,7 +115,7 @@ mod_list_presence=presence presence_conference presence_dialoginfo \

@ -11,10 +11,10 @@ Subject: add_tcap_module
create mode 100644 src/modules/tcap/tcap_mod.c
diff --git a/src/Makefile.groups b/src/Makefile.groups
index 6f7bf91..cd2bdbd 100644
index d0d5ed9..475558b 100644
--- a/src/Makefile.groups
+++ b/src/Makefile.groups
@@ -202,6 +202,9 @@ mod_list_erlang=erlang
@@ -211,6 +211,9 @@ mod_list_erlang=erlang
# - modules depending on systemd library
mod_list_systemd=log_systemd systemdops
@ -24,7 +24,7 @@ index 6f7bf91..cd2bdbd 100644
# - modules depending on libnsq (+libev libevbuffsock liblcurl libjson-c) library
mod_list_nsq=nsq
@@ -316,6 +319,9 @@ module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all
@@ -328,6 +331,9 @@ module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all
# pkg lcrrate module
module_group_klcrrate=$(mod_list_lcrrate)

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Wed, 12 May 2021 11:53:43 +0200
Subject: db_redis_graceful_scan
---
src/modules/db_redis/redis_dbase.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 1b0c72e..d088b89 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -754,7 +754,7 @@
@@ -754,7 +754,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
int l;
@ -9,7 +19,7 @@
#ifdef USE_SCAN
@@ -762,6 +762,8 @@
@@ -762,6 +762,8 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
unsigned long cursor = 0;
unsigned int match_count = match_count_start_val;
char match_count_str[16];
@ -18,7 +28,7 @@
do {
snprintf(cursor_str, sizeof(cursor_str), "%lu", cursor);
@@ -796,7 +798,12 @@
@@ -796,7 +798,12 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
goto err;
}
@ -31,7 +41,7 @@
db_redis_key_free(&query_v);
db_redis_check_reply(con, reply, err);
if (reply->type != REDIS_REPLY_ARRAY) {
@@ -870,11 +877,15 @@
@@ -870,11 +877,15 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
}
#ifdef USE_SCAN

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Wed, 12 May 2021 11:53:43 +0200
Subject: db_redis_skip_empty_keys
---
src/modules/db_redis/redis_dbase.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index c9a25ad..1b0c72e 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -641,6 +641,9 @@
@@ -641,6 +641,9 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name,
LM_DBG("no direct entry key found, checking type keys\n");
for (type = table->types; type; type = type->next) {
key = type->keys;

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Wed, 12 May 2021 11:53:43 +0200
Subject: db_redis_sscan
---
src/modules/db_redis/redis_dbase.c | 86 ++++++++++++++++++++++++++++----------
1 file changed, 65 insertions(+), 21 deletions(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index d088b89..11188c4 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -591,7 +591,7 @@
@@ -591,7 +591,7 @@ err:
static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name,
const db_key_t *_k, const db_val_t *_v, const db_op_t *_op, const int _n,
redis_key_t **query_keys, int *query_keys_count, int **manual_keys, int *manual_keys_count,
@ -9,7 +19,7 @@
struct str_hash_entry *table_e;
redis_table_t *table;
@@ -706,6 +706,21 @@
@@ -706,6 +706,21 @@ static int db_redis_build_query_keys(km_redis_con_t *con, const str *table_name,
LM_DBG("will use key '%.*s' at offset %llx for timestamp/int range scan\n",
keyname.len, keyname.s, (unsigned long long) *ts_scan_start);
*ts_scan_key = keyname;
@ -31,7 +41,7 @@
keyname.s = NULL;
}
else if (keyname.s) {
@@ -742,6 +757,7 @@
@@ -742,6 +757,7 @@ err:
}
static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *match_pattern,
@ -39,7 +49,7 @@
const int _n,
redis_key_t **query_keys, int *query_keys_count,
int **manual_keys, int *manual_keys_count, unsigned int match_count_start_val) {
@@ -768,9 +784,21 @@
@@ -768,9 +784,21 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
do {
snprintf(cursor_str, sizeof(cursor_str), "%lu", cursor);
@ -64,7 +74,7 @@
}
if (db_redis_key_add_string(&query_v, cursor_str, strlen(cursor_str)) != 0) {
LM_ERR("Failed to add cursor to scan query\n");
@@ -932,7 +960,8 @@
@@ -932,7 +960,8 @@ err:
static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name,
const int _n,
redis_key_t **query_keys, int *query_keys_count,
@ -74,7 +84,7 @@
struct str_hash_entry *table_e;
redis_table_t *table;
@@ -969,7 +998,7 @@
@@ -969,7 +998,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name,
table->version_code.len, table->version_code.s,
table_name->len, table_name->s);
str match_pattern = {match, len};
@ -83,7 +93,7 @@
manual_keys, manual_keys_count, 1000);
pkg_free(match);
return ret;
@@ -1031,7 +1060,7 @@
@@ -1031,7 +1060,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name,
str match_pattern = {match, len};
LM_DBG("running timestamp/int range matching using pattern '%.*s'\n", len, match);
@ -92,7 +102,7 @@
manual_keys, manual_keys_count, 5000);
if (ret)
goto out;
@@ -1076,7 +1105,7 @@
@@ -1076,7 +1105,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name,
str match_pattern = {match, len};
LM_DBG("running timestamp/int range matching using pattern '%.*s'\n", len, match);
@ -101,7 +111,7 @@
manual_keys, manual_keys_count, 5000);
if (ret)
goto out;
@@ -1089,7 +1118,7 @@
@@ -1089,7 +1118,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name,
str match_pattern = {match, len};
LM_DBG("running timestamp/int range matching using pattern '%.*s'\n", len, match);
@ -110,7 +120,7 @@
manual_keys, manual_keys_count, 5000);
if (ret)
goto out;
@@ -1447,7 +1476,7 @@
@@ -1447,7 +1476,7 @@ static int db_redis_perform_query(const db1_con_t* _h, km_redis_con_t *con, cons
const int _n, const int _nc, db1_res_t** _r,
redis_key_t **keys, int *keys_count,
int **manual_keys, int *manual_keys_count, int do_table_scan, uint64_t ts_scan_start,
@ -119,7 +129,7 @@
redisReply *reply = NULL;
redis_key_t *query_v = NULL;
@@ -1481,7 +1510,7 @@
@@ -1481,7 +1510,7 @@ static int db_redis_perform_query(const db1_con_t* _h, km_redis_con_t *con, cons
}
if (db_redis_scan_query_keys(con, CON_TABLE(_h), _n,
keys, keys_count,
@ -128,7 +138,7 @@
LM_ERR("failed to scan query keys\n");
goto error;
}
@@ -1632,7 +1661,7 @@
@@ -1632,7 +1661,7 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
const db_val_t* _v, const db_op_t *_op, const int _n,
redis_key_t **keys, int *keys_count,
int **manual_keys, int *manual_keys_count, int do_table_scan, uint64_t ts_scan_start,
@ -137,7 +147,7 @@
int i = 0, j = 0;
redis_key_t *k = NULL;
@@ -1665,7 +1694,7 @@
@@ -1665,7 +1694,7 @@ static int db_redis_perform_delete(const db1_con_t* _h, km_redis_con_t *con, con
}
if (db_redis_scan_query_keys(con, CON_TABLE(_h), _n,
keys, keys_count,
@ -146,7 +156,7 @@
LM_ERR("failed to scan query keys\n");
goto error;
}
@@ -1878,7 +1907,7 @@
@@ -1878,7 +1907,7 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
const int _n, const int _nu,
redis_key_t **keys, int *keys_count,
int **manual_keys, int *manual_keys_count, int do_table_scan, uint64_t ts_scan_start,
@ -155,7 +165,7 @@
redisReply *reply = NULL;
redis_key_t *query_v = NULL;
@@ -1907,7 +1936,7 @@
@@ -1907,7 +1936,7 @@ static int db_redis_perform_update(const db1_con_t* _h, km_redis_con_t *con, con
}
if (db_redis_scan_query_keys(con, CON_TABLE(_h), _n,
keys, keys_count,
@ -164,7 +174,7 @@
LM_ERR("failed to scan query keys\n");
goto error;
}
@@ -2298,6 +2327,7 @@
@@ -2298,6 +2327,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
int do_table_scan = 0;
uint64_t ts_scan_start = 0;
str ts_scan_key = {0,};
@ -172,7 +182,7 @@
redis_key_t *keys = NULL;
int keys_count = 0;
@@ -2369,7 +2399,7 @@
@@ -2369,7 +2399,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
&keys, &keys_count, &manual_keys, &manual_keys_count, &do_table_scan, &ts_scan_start,
@ -181,7 +191,7 @@
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2387,7 +2417,7 @@
@@ -2387,7 +2417,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
}
if (db_redis_perform_query(_h, con, _k, _v, query_ops, _c, _n, _nc, _r,
@ -190,7 +200,7 @@
goto error;
}
@@ -2403,6 +2433,8 @@
@@ -2403,6 +2433,8 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -199,7 +209,7 @@
db_redis_consume_replies(con);
return 0;
@@ -2418,6 +2450,8 @@
@@ -2418,6 +2450,8 @@ error:
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -208,7 +218,7 @@
db_redis_consume_replies(con);
@@ -2603,6 +2637,7 @@
@@ -2603,6 +2637,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
int do_table_scan = 0;
uint64_t ts_scan_start = 0;
str ts_scan_key = {0,};
@ -216,7 +226,7 @@
db_op_t *query_ops = NULL;
int i;
@@ -2648,7 +2683,7 @@
@@ -2648,7 +2683,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
&keys, &keys_count, &manual_keys, &manual_keys_count, &do_table_scan, &ts_scan_start,
@ -225,7 +235,7 @@
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2666,7 +2701,7 @@
@@ -2666,7 +2701,7 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
}
if (db_redis_perform_delete(_h, con, _k, _v, query_ops, _n,
@ -234,7 +244,7 @@
goto error;
}
@@ -2680,6 +2715,8 @@
@@ -2680,6 +2715,8 @@ int db_redis_delete(const db1_con_t* _h, const db_key_t* _k,
pkg_free(manual_keys);
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -243,7 +253,7 @@
db_redis_consume_replies(con);
return 0;
@@ -2694,6 +2731,8 @@
@@ -2694,6 +2731,8 @@ error:
pkg_free(manual_keys);
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -252,7 +262,7 @@
db_redis_consume_replies(con);
return -1;
}
@@ -2718,6 +2757,7 @@
@@ -2718,6 +2757,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
int do_table_scan = 0;
uint64_t ts_scan_start = 0;
str ts_scan_key = {0,};
@ -260,7 +270,7 @@
redis_key_t *keys = NULL;
int keys_count = 0;
@@ -2768,7 +2808,7 @@
@@ -2768,7 +2808,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
if (_n > 0) {
if (db_redis_build_query_keys(con, CON_TABLE(_h), _k, _v, query_ops, _n,
&keys, &keys_count, &manual_keys, &manual_keys_count, &do_table_scan, &ts_scan_start,
@ -269,7 +279,7 @@
LM_ERR("failed to build query keys\n");
goto error;
}
@@ -2785,7 +2825,7 @@
@@ -2785,7 +2825,7 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
}
if (db_redis_perform_update(_h, con, _k, _v, query_ops, _uk, _uv, _n, _nu,
@ -278,7 +288,7 @@
goto error;
}
@@ -2801,6 +2841,8 @@
@@ -2801,6 +2841,8 @@ int db_redis_update(const db1_con_t* _h, const db_key_t* _k,
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);
@ -287,7 +297,7 @@
db_redis_consume_replies(con);
return 0;
@@ -2815,6 +2857,8 @@
@@ -2815,6 +2857,8 @@ error:
}
if (ts_scan_key.s)
pkg_free(ts_scan_key.s);

@ -1,6 +1,16 @@
From: Sipwise Development Team <support@sipwise.com>
Date: Wed, 12 May 2021 11:53:43 +0200
Subject: db_redis_sscan_fix_empty_key
---
src/modules/db_redis/redis_dbase.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 11188c4..5258d57 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -784,7 +784,7 @@
@@ -784,7 +784,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t *con, const str *matc
do {
snprintf(cursor_str, sizeof(cursor_str), "%lu", cursor);

@ -7,10 +7,10 @@ Subject: dialplan: don't stop loading rules on error
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/modules/dialplan/dp_db.c b/src/modules/dialplan/dp_db.c
index f50c0d0..fb24f35 100644
index 4275f02..3055d31 100644
--- a/src/modules/dialplan/dp_db.c
+++ b/src/modules/dialplan/dp_db.c
@@ -299,8 +299,10 @@ int dp_load_db(void)
@@ -300,8 +300,10 @@ int dp_load_db(void)
values = ROW_VALUES(rows+i);
@ -21,5 +21,5 @@ index f50c0d0..fb24f35 100644
+ continue;
+ }
if(add_rule2hash(rule , *next_idx) != 0)
if(add_rule2hash(rule, *dp_next_idx) != 0)
goto err2;

@ -8,7 +8,7 @@ Subject: do-not-install-default-config
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index e6ab97f..96c53fd 100644
index 14cc0d7..0e37b95 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -652,7 +652,7 @@ sunpkg:

@ -8,7 +8,7 @@ Subject: pua_dialoginfo: local_identity_dlg_var
2 files changed, 37 insertions(+)
diff --git a/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml b/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml
index bd48956..0dee5f9 100644
index 49f9f0f8..81156afa 100644
--- a/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml
+++ b/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml
@@ -554,6 +554,26 @@ modparam("pua_dialoginfo", "callee_trying", 1)
@ -37,9 +37,9 @@ index bd48956..0dee5f9 100644
+
</section>
<section>
<section id="pua_dialoginfo.p.attribute_display">
diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c
index cc2fd20..a1cd837 100644
index a39b8f11..b0fb27be 100644
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.c
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c
@@ -82,6 +82,7 @@ int_str pubruri_callee_avp_name;
@ -50,7 +50,7 @@ index cc2fd20..a1cd837 100644
/* Module parameter variables */
int include_callid = DEF_INCLUDE_CALLID;
@@ -124,6 +125,7 @@ static param_export_t params[]={
@@ -126,6 +127,7 @@ static param_export_t params[]={
{"pubruri_callee_avp", PARAM_STRING, &pubruri_callee_avp },
{"pubruri_caller_dlg_var", PARAM_STR, &caller_dlg_var },
{"pubruri_callee_dlg_var", PARAM_STR, &callee_dlg_var },
@ -58,7 +58,7 @@ index cc2fd20..a1cd837 100644
{"callee_trying", INT_PARAM, &callee_trying },
{"disable_caller_publish_flag", INT_PARAM, &disable_caller_publish_flag },
{"disable_callee_publish_flag", INT_PARAM, &disable_callee_publish_flag },
@@ -300,6 +302,17 @@ void refresh_pubruri_avps(struct dlginfo_cell *dlginfo, str *uri)
@@ -303,6 +305,17 @@ void refresh_pubruri_avps(struct dlginfo_cell *dlginfo, str *uri)
}
}
@ -76,7 +76,7 @@ index cc2fd20..a1cd837 100644
static void
__dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params)
{
@@ -328,6 +341,10 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
@@ -336,6 +349,10 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
refresh_pubruri_avps(dlginfo, &uri);
}

@ -8,10 +8,10 @@ Subject: pua_dialoginfo: use lock when use_puburi_avps is set
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c
index a1cd837..cf36216 100644
index b0fb27be..d5b1feae 100644
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.c
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c
@@ -338,6 +338,7 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
@@ -346,6 +346,7 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
if(use_pubruri_avps && (refresh_pubruri_avps_flag > -1
|| (request->flags & (1<<refresh_pubruri_avps_flag))))
{
@ -19,7 +19,7 @@ index a1cd837..cf36216 100644
refresh_pubruri_avps(dlginfo, &uri);
}
@@ -494,6 +495,11 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
@@ -502,6 +503,11 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
send_publish_flag==-1?1:0);
}
}
@ -31,7 +31,7 @@ index a1cd837..cf36216 100644
}
/*
@@ -566,7 +572,11 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
@@ -574,7 +580,11 @@ struct dlginfo_cell* get_dialog_data(struct dlg_cell *dlg, int type)
return NULL;
}
memset( dlginfo, 0, len);
@ -44,7 +44,7 @@ index a1cd837..cf36216 100644
/* copy from dlg structure to dlginfo structure */
dlginfo->lifetime = override_lifetime ? override_lifetime : dlg->lifetime;
dlginfo->from_uri.s = (char*)dlginfo + sizeof(struct dlginfo_cell);
@@ -714,25 +724,28 @@ __dialog_created(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params)
@@ -722,25 +732,28 @@ __dialog_created(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params)
dlginfo=get_dialog_data(dlg, type);
if(dlginfo==NULL)
return;
@ -74,7 +74,7 @@ index a1cd837..cf36216 100644
}
}
@@ -856,9 +869,7 @@ void free_dlginfo_cell(void *param) {
@@ -864,9 +877,7 @@ void free_dlginfo_cell(void *param) {
free_str_list_all(cell->pubruris_caller);
free_str_list_all(cell->pubruris_callee);
@ -86,7 +86,7 @@ index a1cd837..cf36216 100644
}
diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.h b/src/modules/pua_dialoginfo/pua_dialoginfo.h
index 01fc876..8289669 100644
index 01fc8769..82896699 100644
--- a/src/modules/pua_dialoginfo/pua_dialoginfo.h
+++ b/src/modules/pua_dialoginfo/pua_dialoginfo.h
@@ -23,6 +23,7 @@

@ -7,10 +7,10 @@ Subject: pv_trans_eval_uri
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/pv/pv_trans.c b/src/modules/pv/pv_trans.c
index d07e55e..e37e517 100644
index f93f126..2637926 100644
--- a/src/modules/pv/pv_trans.c
+++ b/src/modules/pv/pv_trans.c
@@ -1381,8 +1381,8 @@ int tr_eval_uri(struct sip_msg *msg, tr_param_t *tp, int subtype,
@@ -1470,8 +1470,8 @@ int tr_eval_uri(struct sip_msg *msg, tr_param_t *tp, int subtype,
/* parse uri -- params only when requested */
if(parse_uri(_tr_uri.s, _tr_uri.len - dlen, &_tr_parsed_uri)!=0)
{

@ -1,98 +0,0 @@
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -119,7 +119,8 @@
int via, to, packetize, transport, directional;
bencode_item_t *dict, *flags, *direction, *replace, *rtcp_mux, *sdes,
*t38,
- *codec, *codec_strip, *codec_offer, *codec_transcode, *codec_mask;
+ *codec, *codec_strip, *codec_offer, *codec_transcode, *codec_mask,
+ *codec_set, *codec_except;
str call_id, from_tag, to_tag;
};
@@ -2082,6 +2083,29 @@
[0x06] = "UDP/TLS/RTP/SAVPF",
};
+static int parse_codec_flag(struct ng_flags_parse *ng_flags, const str *key, const str *val,
+ const char *cmp1, const char *cmp2, const char *dictstr,
+ bencode_item_t **dictp)
+{
+ str s;
+
+ if (!str_key_val_prefix(key, cmp1, val, &s)) {
+ if (!cmp2)
+ return 0;
+ if (!str_key_val_prefix(key, cmp2, val, &s))
+ return 0;
+ }
+
+ if (!*dictp) {
+ *dictp = bencode_list(ng_flags->dict->buffer);
+ bencode_dictionary_add(ng_flags->codec, dictstr,
+ *dictp);
+ }
+ bencode_list_add_str(*dictp, &s);
+
+ return 1;
+}
+
static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enum rtpe_operation *op,
const char *flags_str)
{
@@ -2135,47 +2159,18 @@
goto next;
}
- if (str_key_val_prefix(&key, "transcode", &val, &s)
- || str_key_val_prefix(&key, "codec-transcode", &val, &s))
- {
- if (!ng_flags->codec_transcode) {
- ng_flags->codec_transcode = bencode_list(ng_flags->dict->buffer);
- bencode_dictionary_add(ng_flags->codec, "transcode",
- ng_flags->codec_transcode);
- }
- bencode_list_add_str(ng_flags->codec_transcode, &s);
+ if (parse_codec_flag(ng_flags, &key, &val, "transcode", "codec-transcode", "transcode", &ng_flags->codec_transcode))
goto next;
- }
-
- if (str_key_val_prefix(&key, "codec-strip", &val, &s)) {
- if (!ng_flags->codec_strip) {
- ng_flags->codec_strip = bencode_list(ng_flags->dict->buffer);
- bencode_dictionary_add(ng_flags->codec, "strip",
- ng_flags->codec_strip);
- }
- bencode_list_add_str(ng_flags->codec_strip, &s);
+ if (parse_codec_flag(ng_flags, &key, &val, "codec-strip", NULL, "strip", &ng_flags->codec_strip))
goto next;
- }
-
- if (str_key_val_prefix(&key, "codec-offer", &val, &s)) {
- if (!ng_flags->codec_offer) {
- ng_flags->codec_offer = bencode_list(ng_flags->dict->buffer);
- bencode_dictionary_add(ng_flags->codec, "offer",
- ng_flags->codec_offer);
- }
- bencode_list_add_str(ng_flags->codec_offer, &s);
+ if (parse_codec_flag(ng_flags, &key, &val, "codec-offer", NULL, "offer", &ng_flags->codec_offer))
goto next;
- }
-
- if (str_key_val_prefix(&key, "codec-mask", &val, &s)) {
- if (!ng_flags->codec_mask) {
- ng_flags->codec_mask = bencode_list(ng_flags->dict->buffer);
- bencode_dictionary_add(ng_flags->codec, "mask",
- ng_flags->codec_mask);
- }
- bencode_list_add_str(ng_flags->codec_mask, &s);
+ if (parse_codec_flag(ng_flags, &key, &val, "codec-mask", NULL, "mask", &ng_flags->codec_mask))
+ goto next;
+ if (parse_codec_flag(ng_flags, &key, &val, "codec-set", NULL, "set", &ng_flags->codec_set))
+ goto next;
+ if (parse_codec_flag(ng_flags, &key, &val, "codec-except", NULL, "except", &ng_flags->codec_except))
goto next;
- }
/* check for specially handled items */
switch (key.len) {

@ -16,7 +16,7 @@ Change-Id: Ifd823a576ed4eb1d95aa3c72f34226b6100c4c21
create mode 100644 src/modules/tmrec/ical.h
diff --git a/src/modules/tmrec/Makefile b/src/modules/tmrec/Makefile
index 61cbca6..374ccc4 100644
index 46de362..518136b 100644
--- a/src/modules/tmrec/Makefile
+++ b/src/modules/tmrec/Makefile
@@ -5,6 +5,6 @@ include ../../Makefile.defs

@ -8,10 +8,10 @@ unless original msg has contact
1 file changed, 5 insertions(+)
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index e40a510..37aeac4 100644
index 854d2cd..09bd43d 100644
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -1085,6 +1085,11 @@ int tps_response_sent(sip_msg_t *msg)
@@ -1160,6 +1160,11 @@ int tps_response_sent(sip_msg_t *msg)
&& msg->contact==NULL) {
contact_keep = 1;
}

@ -8,10 +8,10 @@ Subject: usrloc_dbro
2 files changed, 67 insertions(+)
diff --git a/src/modules/usrloc/usrloc_mod.c b/src/modules/usrloc/usrloc_mod.c
index 7aecb31..6d8f633 100644
index 733c16a..de06cfb 100644
--- a/src/modules/usrloc/usrloc_mod.c
+++ b/src/modules/usrloc/usrloc_mod.c
@@ -166,6 +166,7 @@ str ulattrs_avalue_col = str_init(ULATTRS_AVALUE_COL); /*!< Name of column conta
@@ -167,6 +167,7 @@ str ulattrs_avalue_col = str_init(ULATTRS_AVALUE_COL); /*!< Name of column conta
str ulattrs_last_mod_col = str_init(ULATTRS_LAST_MOD_COL); /*!< Name of column containing the last modified date */
str ul_db_url = str_init(DEFAULT_DB_URL); /*!< Database URL */
@ -19,7 +19,7 @@ index 7aecb31..6d8f633 100644
int ul_timer_interval = 60; /*!< Timer interval in seconds */
int ul_db_mode = 0; /*!< Database sync scheme: 0-no db, 1-write through, 2-write back, 3-only db */
int ul_db_load = 1; /*!< Database load after restart: 1- true, 0- false (only the db_mode allows it) */
@@ -199,6 +200,8 @@ static cmd_export_t cmds[] = {
@@ -200,6 +201,8 @@ static cmd_export_t cmds[] = {
{0, 0, 0, 0, 0, 0}
};
@ -28,7 +28,7 @@ index 7aecb31..6d8f633 100644
/*! \brief
* Exported parameters
@@ -215,6 +218,7 @@ static param_export_t params[] = {
@@ -216,6 +219,7 @@ static param_export_t params[] = {
{"flags_column", PARAM_STR, &ul_flags_col },
{"cflags_column", PARAM_STR, &ul_cflags_col },
{"db_url", PARAM_STR, &ul_db_url },
@ -36,7 +36,7 @@ index 7aecb31..6d8f633 100644
{"timer_interval", INT_PARAM, &ul_timer_interval },
{"db_mode", INT_PARAM, &ul_db_mode },
{"db_load", INT_PARAM, &ul_db_load },
@@ -283,6 +287,38 @@ struct module_exports exports = {
@@ -286,6 +290,38 @@ struct module_exports exports = {
destroy /*!< destroy function */
};
@ -75,7 +75,7 @@ index 7aecb31..6d8f633 100644
/*! \brief
* Module initialization function
@@ -377,6 +413,21 @@ static int mod_init(void)
@@ -380,6 +416,21 @@ static int mod_init(void)
}
}
@ -97,7 +97,7 @@ index 7aecb31..6d8f633 100644
if (ul_nat_bflag==(unsigned int)-1) {
ul_nat_bflag = 0;
} else if (ul_nat_bflag>=8*sizeof(ul_nat_bflag) ) {
@@ -470,6 +521,16 @@ static int child_init(int _rank)
@@ -473,6 +524,16 @@ static int child_init(int _rank)
LM_ERR("child(%d): failed to connect to database\n", _rank);
return -1;
}
@ -112,9 +112,9 @@ index 7aecb31..6d8f633 100644
+ LM_DBG("read-only connection init\n");
+ }
/* _rank==PROC_SIPINIT is used even when fork is disabled */
if (_rank==PROC_SIPINIT && ul_db_mode!=DB_ONLY && ul_db_load) {
if (_rank==ul_load_rank && ul_db_mode!=DB_ONLY && ul_db_load) {
/* if cache is used, populate domains from DB */
@@ -500,6 +561,10 @@ static void destroy(void)
@@ -503,6 +564,10 @@ static void destroy(void)
ul_dbf.close(ul_dbh);
}

@ -7,7 +7,7 @@ Subject: usrloc_dbro_pinger
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/modules/usrloc/dlist.c b/src/modules/usrloc/dlist.c
index 96a95fe..2da2e20 100644
index 44ce3c6..113c16c 100644
--- a/src/modules/usrloc/dlist.c
+++ b/src/modules/usrloc/dlist.c
@@ -301,6 +301,8 @@ static inline int get_all_db_ucontacts(void *buf, int len, unsigned int flags,

@ -1,56 +0,0 @@
From 967dd294ba424bf66e27bebe4d6261e0c8a66471 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Fri, 16 Apr 2021 09:44:24 +0200
Subject: [PATCH] core: usr avp - fix detection of invalid name and ids
- use the fields designated for str name or int id, code analyzers can
follow properly the execution path
- regression introduced in ca1821837dfe7dd6630f628d968ed4d1178c7040
(cherry picked from commit e4506385ca5a56d4861f36e85c1049599cba398f)
---
src/core/usr_avp.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/core/usr_avp.c b/src/core/usr_avp.c
index e80e52d79d..8d8fa34603 100644
--- a/src/core/usr_avp.c
+++ b/src/core/usr_avp.c
@@ -148,16 +148,11 @@ avp_t *create_avp (avp_flags_t flags, avp_name_t name, avp_value_t val)
struct str_str_data *ssd;
int len;
- if (name.s.s == NULL || name.s.len == 0) {
- LM_ERR("0 ID or NULL NAME AVP!");
- goto error;
- }
-
/* compute the required mem size */
len = sizeof(struct usr_avp);
if (flags&AVP_NAME_STR) {
if ( name.s.s==0 || name.s.len==0) {
- LM_ERR("EMPTY NAME AVP!");
+ LM_ERR("NULL or EMPTY NAME AVP!");
goto error;
}
if (flags&AVP_VAL_STR) {
@@ -168,8 +163,14 @@ avp_t *create_avp (avp_flags_t flags, avp_name_t name, avp_value_t val)
len += sizeof(struct str_int_data)-sizeof(union usr_avp_data)
+ name.s.len + 1; /* Terminating zero for regex search */
}
- } else if (flags&AVP_VAL_STR) {
- len += sizeof(str)-sizeof(union usr_avp_data) + val.s.len + 1;
+ } else {
+ if(name.n==0) {
+ LM_ERR("0 ID AVP!");
+ goto error;
+ }
+ if (flags&AVP_VAL_STR) {
+ len += sizeof(str)-sizeof(union usr_avp_data) + val.s.len + 1;
+ }
}
avp = (struct usr_avp*)shm_malloc( len );
--
2.20.1

@ -0,0 +1,26 @@
From 4a4835e122bb3a53d2a1794640e1dec66736a897 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu, 6 May 2021 11:37:58 +0200
Subject: [PATCH] lwsc: set ws_ping_pong_interval only for libwebsockets 3.x
(cherry picked from commit 048ed4210d52fb817ae6b03756d95e9b25899330)
---
src/modules/lwsc/lwsc_mod.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/lwsc/lwsc_mod.c b/src/modules/lwsc/lwsc_mod.c
index 17eb0ca30a..a6985acb6d 100644
--- a/src/modules/lwsc/lwsc_mod.c
+++ b/src/modules/lwsc/lwsc_mod.c
@@ -529,7 +529,7 @@ static lwsc_endpoint_t* lwsc_get_endpoint(str *wsurl, str *wsproto)
ep->crtinfo.protocols = ep->protocols;
ep->crtinfo.gid = -1;
ep->crtinfo.uid = -1;
-#if LWS_LIBRARY_VERSION_MAJOR >= 3
+#if LWS_LIBRARY_VERSION_MAJOR == 3
ep->crtinfo.ws_ping_pong_interval = 5; /*secs*/
#endif
/* 1 internal and 1 (+ 1 http2 nwsi) */
--
2.20.1

@ -1,45 +0,0 @@
From 98805c723fbe01556e56d5b00ffc686b92014847 Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Fri, 27 Nov 2020 12:22:52 +0100
Subject: [PATCH] ndb_redis: set message level to debug on reconnect
* logging error makes no sense here since there's going
to be a reconnection afterwards
---
src/modules/ndb_redis/redis_client.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/modules/ndb_redis/redis_client.c b/src/modules/ndb_redis/redis_client.c
index 15a86f7b10..42880310f2 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -1011,7 +1011,7 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
/* null reply, reconnect and try again */
if(rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if(redisc_reconnect_server(rsrv)==0)
{
@@ -1054,7 +1054,7 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
/* null reply, reconnect and try again */
if(rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if(redisc_reconnect_server(rsrv)==0)
{
@@ -1152,7 +1152,7 @@ again:
/* null reply, reconnect and try again */
if(rsrv->ctxRedis->err)
{
- LM_ERR("Redis error: %s\n", rsrv->ctxRedis->errstr);
+ LM_DBG("Redis error: %s\n", rsrv->ctxRedis->errstr);
}
if(res)
--
2.20.1

@ -1,77 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 5 Nov 2020 12:12:38 +0100
Subject: [PATCH] permissions: add reload_delta parameter
- make the rate limit of maximum allowed RPC reload configurable
using the new 'reload_delta' paramenter.
---
src/modules/permissions/permissions.c | 5 +++++
src/modules/permissions/permissions.h | 1 +
src/modules/permissions/rpc.c | 8 +++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/modules/permissions/permissions.c b/src/modules/permissions/permissions.c
index 6b45619..9d9e6d0 100644
--- a/src/modules/permissions/permissions.c
+++ b/src/modules/permissions/permissions.c
@@ -60,6 +60,7 @@ static char* perm_deny_suffix = ".deny";
/* for allow_trusted and allow_address function */
str perm_db_url = {NULL, 0}; /* Don't connect to the database by default */
+int perm_reload_delta = 5;
/* for allow_trusted function */
int perm_db_mode = DISABLE_CACHE; /* Database usage mode: 0=no cache, 1=cache */
@@ -186,6 +187,7 @@ static param_export_t params[] = {
{"port_col", PARAM_STR, &perm_port_col },
{"max_subnets", PARAM_INT, &_perm_max_subnets },
{"load_backends", PARAM_INT, &_perm_load_backends },
+ {"reload_delta", PARAM_INT, &perm_reload_delta },
{0, 0, 0}
};
@@ -594,6 +596,9 @@ static int mod_init(void)
}
*perm_rpc_reload_time = 0;
+ if(perm_reload_delta < 0)
+ perm_reload_delta = 5;
+
if(permissions_init_rpc()!=0) {
LM_ERR("failed to register RPC commands\n");
return -1;
diff --git a/src/modules/permissions/permissions.h b/src/modules/permissions/permissions.h
index c094185..2a417ff 100644
--- a/src/modules/permissions/permissions.h
+++ b/src/modules/permissions/permissions.h
@@ -59,6 +59,7 @@ extern str perm_ip_addr_col; /* Name of ip address column */
extern str perm_mask_col; /* Name of mask column */
extern str perm_port_col; /* Name of port column */
extern int perm_peer_tag_mode; /* Matching mode */
+extern int perm_reload_delta; /* seconds between RPC reloads */
/* backends to be loaded */
#define PERM_LOAD_ADDRESSDB (1<<0)
diff --git a/src/modules/permissions/rpc.c b/src/modules/permissions/rpc.c
index b6a6f9a..cff9523 100644
--- a/src/modules/permissions/rpc.c
+++ b/src/modules/permissions/rpc.c
@@ -30,13 +30,15 @@
#include "permissions.h"
-int rpc_check_reload(rpc_t* rpc, void* ctx) {
- if(perm_rpc_reload_time==NULL) {
+int rpc_check_reload(rpc_t *rpc, void *ctx)
+{
+ if(perm_rpc_reload_time == NULL) {
LM_ERR("not ready for reload\n");
rpc->fault(ctx, 500, "Not ready for reload");
return -1;
}
- if(*perm_rpc_reload_time!=0 && *perm_rpc_reload_time > time(NULL) - 5) {
+ if(*perm_rpc_reload_time != 0
+ && *perm_rpc_reload_time > time(NULL) - perm_reload_delta) {
LM_ERR("ongoing reload\n");
rpc->fault(ctx, 500, "ongoing reload");
return -1;

@ -1,109 +0,0 @@
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Thu, 5 Nov 2020 11:04:48 +0100
Subject: permissions: basic safety for concurent rpc reload
* same logic as 99d5da8d595961063249f871a5d150474fa6f317
---
src/modules/permissions/permissions.c | 14 +++++++++++++-
src/modules/permissions/permissions.h | 1 +
src/modules/permissions/rpc.c | 25 +++++++++++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/src/modules/permissions/permissions.c b/src/modules/permissions/permissions.c
index 18cf398..6b45619 100644
--- a/src/modules/permissions/permissions.c
+++ b/src/modules/permissions/permissions.c
@@ -88,7 +88,7 @@ str perm_address_file = STR_NULL; /* Full path to file with address records
*/
static int perm_check_all_branches = 1;
-
+time_t *perm_rpc_reload_time = NULL;
int _perm_max_subnets = 512;
int _perm_load_backends = 0xFFFF;
@@ -587,6 +587,13 @@ static int mod_init(void)
return -1;
}
+ perm_rpc_reload_time = shm_malloc(sizeof(time_t));
+ if(perm_rpc_reload_time == NULL) {
+ SHM_MEM_ERROR;
+ return -1;
+ }
+ *perm_rpc_reload_time = 0;
+
if(permissions_init_rpc()!=0) {
LM_ERR("failed to register RPC commands\n");
return -1;
@@ -674,6 +681,11 @@ static void mod_exit(void)
{
int i;
+ if(perm_rpc_reload_time!=NULL) {
+ shm_free(perm_rpc_reload_time);
+ perm_rpc_reload_time = 0;
+ }
+
for(i = 0; i < perm_rules_num; i++) {
if(perm_allow[i].rules) free_rule(perm_allow[i].rules);
if(perm_allow[i].filename) pkg_free(perm_allow[i].filename);
diff --git a/src/modules/permissions/permissions.h b/src/modules/permissions/permissions.h
index 785d6c9..c094185 100644
--- a/src/modules/permissions/permissions.h
+++ b/src/modules/permissions/permissions.h
@@ -66,6 +66,7 @@ extern int perm_peer_tag_mode; /* Matching mode */
#define PERM_LOAD_ALLOWFILE (1<<2)
#define PERM_LOAD_DENYFILE (1<<3)
extern int _perm_load_backends; /* */
+extern time_t *perm_rpc_reload_time;
typedef struct int_or_pvar {
unsigned int i;
diff --git a/src/modules/permissions/rpc.c b/src/modules/permissions/rpc.c
index 844cdec..b6a6f9a 100644
--- a/src/modules/permissions/rpc.c
+++ b/src/modules/permissions/rpc.c
@@ -30,10 +30,30 @@
#include "permissions.h"
+int rpc_check_reload(rpc_t* rpc, void* ctx) {
+ if(perm_rpc_reload_time==NULL) {
+ LM_ERR("not ready for reload\n");
+ rpc->fault(ctx, 500, "Not ready for reload");
+ return -1;
+ }
+ if(*perm_rpc_reload_time!=0 && *perm_rpc_reload_time > time(NULL) - 5) {
+ LM_ERR("ongoing reload\n");
+ rpc->fault(ctx, 500, "ongoing reload");
+ return -1;
+ }
+ *perm_rpc_reload_time = time(NULL);
+ return 0;
+}
+
/*! \brief
* RPC function to reload trusted table
*/
void rpc_trusted_reload(rpc_t* rpc, void* c) {
+
+ if(rpc_check_reload(rpc, c) < 0) {
+ return;
+ }
+
if (reload_trusted_table_cmd () != 1) {
rpc->fault(c, 500, "Reload failed.");
return;
@@ -67,6 +87,11 @@ void rpc_trusted_dump(rpc_t* rpc, void* c) {
* RPC function to reload address table
*/
void rpc_address_reload(rpc_t* rpc, void* c) {
+
+ if(rpc_check_reload(rpc, c) < 0) {
+ return;
+ }
+
if (reload_address_table_cmd () != 1) {
rpc->fault(c, 500, "Reload failed.");
return;

@ -0,0 +1,32 @@
From 33db4ffc558b7a9d4c291c929b9e73b3cf8b16f0 Mon Sep 17 00:00:00 2001
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Wed, 5 May 2021 18:56:04 +0200
Subject: [PATCH] tm: lw parser - fix matching To header in lw_get_hf_name()
(cherry picked from commit 4ab6e05df56afb7802a2cd125e89b9282a1c6c85)
---
src/modules/tm/lw_parser.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/modules/tm/lw_parser.c b/src/modules/tm/lw_parser.c
index d13ec58311..6f48304f53 100644
--- a/src/modules/tm/lw_parser.c
+++ b/src/modules/tm/lw_parser.c
@@ -188,9 +188,11 @@ char *lw_get_hf_name(char *begin, char *end, enum _hdr_types_t *type)
case 't': /* To */
if(LOWER_BYTE(*(p + 1)) == 'o') {
- p += 2;
- *type = HDR_TO_T;
- break;
+ if((*(p + 2) == ' ') || (*(p + 2) == ':')) {
+ p += 2;
+ *type = HDR_TO_T;
+ break;
+ }
}
if((*(p + 1) == ' ') || (*(p + 1) == ':')) {
p++;
--
2.20.1
Loading…
Cancel
Save