From 3fb223fa88754b25b673531c6a66a928ebe0479e Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Sat, 29 Aug 2020 23:21:35 -0700 Subject: [PATCH] siproxd: update to version 0.8.3, improve logging and memory usage This release includes bug fixes and improvements accumulated over the last 4 years of development snapshots [1]. Bump upstream version, build new plugins 'stats' and 'blacklist', and add an 'sqlite3' package dependency for siproxd-mod-blacklist. Disable procd capturing stderr to syslog, since siproxd in 'foreground' mode writes both to syslog and stderr, duplicating log messages. Include a patch to drastically reduce memory usage (RSS from 17MB to 5MB on ipq40xx platform): * 005-reduce-rtpproxy-urlmap-size.patch Drop the following patches now included upstream: * 010-syslog-msg.patch * 020-gcc10.patch * 100-musl-compat.patch [1] http://siproxd.sourceforge.net/index.php?op=changelog. Signed-off-by: Tony Ambardar --- net/siproxd/Makefile | 10 ++++++---- net/siproxd/files/siproxd.init | 1 - .../005-reduce-rtpproxy-urlmap-size.patch | 19 ++++++++++++++++++ net/siproxd/patches/010-syslog-msg.patch | 20 ------------------- net/siproxd/patches/020-gcc10.patch | 11 ---------- net/siproxd/patches/100-musl-compat.patch | 13 ------------ 6 files changed, 25 insertions(+), 49 deletions(-) create mode 100644 net/siproxd/patches/005-reduce-rtpproxy-urlmap-size.patch delete mode 100644 net/siproxd/patches/010-syslog-msg.patch delete mode 100644 net/siproxd/patches/020-gcc10.patch delete mode 100644 net/siproxd/patches/100-musl-compat.patch diff --git a/net/siproxd/Makefile b/net/siproxd/Makefile index b7a603a..30a4c11 100644 --- a/net/siproxd/Makefile +++ b/net/siproxd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=siproxd -PKG_VERSION:=0.8.2 -PKG_RELEASE:=6 +PKG_VERSION:=0.8.3 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/siproxd -PKG_HASH:=526ce491b0cc189e2766c62432aff3ebb995e551d7261ea32c02a90c7bf7ccd0 +PKG_HASH:=9a6d7a6bb6fff162775b1e1fb7018de9c69642cbf8626185dc6ffceeeba07736 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -67,7 +67,7 @@ define BuildPlugin define Package/siproxd-mod-$(subst _,-,$(1)) $$(call Package/siproxd/Default) TITLE:= siproxd $(1) plugin - DEPENDS:=siproxd + DEPENDS:=siproxd $(2) endef define Package/siproxd-mod-$(subst _,-,$(1))/install @@ -79,6 +79,7 @@ define BuildPlugin endef $(eval $(call BuildPackage,siproxd)) +$(eval $(call BuildPlugin,blacklist,+libsqlite3)) $(eval $(call BuildPlugin,codecfilter)) $(eval $(call BuildPlugin,defaulttarget)) $(eval $(call BuildPlugin,demo)) @@ -89,6 +90,7 @@ $(eval $(call BuildPlugin,logcall)) $(eval $(call BuildPlugin,prefix)) $(eval $(call BuildPlugin,regex)) $(eval $(call BuildPlugin,shortdial)) +$(eval $(call BuildPlugin,stats)) $(eval $(call BuildPlugin,stripheader)) $(eval $(call BuildPlugin,stun)) $(eval $(call BuildPlugin,siptrunk)) diff --git a/net/siproxd/files/siproxd.init b/net/siproxd/files/siproxd.init index 7d5b003..a8b86f7 100644 --- a/net/siproxd/files/siproxd.init +++ b/net/siproxd/files/siproxd.init @@ -110,7 +110,6 @@ section_end() { procd_set_param command "$PROG" --config "$conf_file" procd_set_param pidfile "$pid_file" procd_set_param respawn - procd_set_param stderr 1 procd_add_jail siproxd log procd_add_jail_mount /etc/passwd /etc/group /etc/TZ /dev/null procd_add_jail_mount "$conf_file" diff --git a/net/siproxd/patches/005-reduce-rtpproxy-urlmap-size.patch b/net/siproxd/patches/005-reduce-rtpproxy-urlmap-size.patch new file mode 100644 index 0000000..43587c5 --- /dev/null +++ b/net/siproxd/patches/005-reduce-rtpproxy-urlmap-size.patch @@ -0,0 +1,19 @@ +diff -urN siproxd-0.8.3/src/siproxd.h siproxd-0.8.3-patch/src/siproxd.h +--- siproxd-0.8.3/src/siproxd.h 2019-11-09 09:42:04.000000000 -0800 ++++ siproxd-0.8.3-patch/src/siproxd.h 2020-09-04 20:02:47.961246801 -0700 +@@ -282,13 +282,13 @@ + #define TCP_IDLE_TO 300 /* TCP connection idle timeout in seconds */ + #define TCP_CONNECT_TO 500 /* TCP connect() timeout in msec */ + +-#define URLMAP_SIZE 512 /* number of URL mapping table entries */ ++#define URLMAP_SIZE 128 /* number of URL mapping table entries */ + /* this limits the number of clients! */ + + #define SOURCECACHE_SIZE 256 /* number of return addresses */ + #define DEJITTERLIMIT 1500000 /* max value for dejitter configuration */ + +-#define RTPPROXY_SIZE 1024 /* number of rtp proxy entries */ ++#define RTPPROXY_SIZE 256 /* number of rtp proxy entries */ + /* this limits the number of calls! */ + + #define BUFFER_SIZE 8196 /* input buffer for read from socket */ diff --git a/net/siproxd/patches/010-syslog-msg.patch b/net/siproxd/patches/010-syslog-msg.patch deleted file mode 100644 index 0e00e0b..0000000 --- a/net/siproxd/patches/010-syslog-msg.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/src/log.c -+++ b/src/log.c -@@ -77,7 +77,7 @@ - static pthread_mutex_t log_mutex = PTHREAD_MUTEX_INITIALIZER; - - void log_init(void) { -- openlog(NULL,LOG_NDELAY|LOG_PID,LOG_DAEMON); -+ openlog("siproxd",LOG_NDELAY|LOG_PID,LOG_DAEMON); - } - - void log_end(void) { -@@ -257,7 +257,7 @@ - va_copy(ap_copy, ap); - vsnprintf(outbuf, sizeof(outbuf), format, ap_copy); - va_end(ap_copy); -- syslog(LOG_USER|level, "%s:%i %s%s", file, line, label, outbuf); -+ syslog(LOG_DAEMON|level, "%s:%i %s%s", file, line, label, outbuf); - return; - } - diff --git a/net/siproxd/patches/020-gcc10.patch b/net/siproxd/patches/020-gcc10.patch deleted file mode 100644 index f8be5cd..0000000 --- a/net/siproxd/patches/020-gcc10.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/accessctl.c -+++ b/src/accessctl.c -@@ -34,7 +34,7 @@ - static char const ident[]="$Id: accessctl.c 521 2015-09-13 08:43:04Z hb9xar $"; - - /* configuration storage */ --struct siproxd_config configuration; -+extern struct siproxd_config configuration; - - - /* diff --git a/net/siproxd/patches/100-musl-compat.patch b/net/siproxd/patches/100-musl-compat.patch deleted file mode 100644 index 8d7bf8e..0000000 --- a/net/siproxd/patches/100-musl-compat.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/resolve.c -+++ b/src/resolve.c -@@ -28,8 +28,10 @@ - #include - #endif - -+#include - #include - #include -+#include - - #include "log.h" - -- 2.30.2