PKG_NAME:=siproxd
PKG_VERSION:=0.8.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/siproxd
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
+PKG_CONFIG_DEPENDS:=CONFIG_SIPROXD_MAX_CLIENTS
+
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
/etc/config/siproxd
endef
+define Package/siproxd/config
+ config SIPROXD_MAX_CLIENTS
+ int "Max supported clients"
+ default 32
+ depends on PACKAGE_siproxd
+ help
+ Default 32 is sufficient for home environments. Larger values
+ consume more memory (e.g. RSS of 17 MB with upstream default 512).
+endef
+
CONFIGURE_ARGS+= \
--with-libosip-prefix="$(STAGING_DIR)/usr" \
- --disable-ltdl-convenience \
+ --without-included-ltdl \
--disable-doc
MAKE_FLAGS+= \
SUBDIRS="src scripts contrib"
+TARGET_CFLAGS+= \
+ -Wno-unused-const-variable
+
+URLMAP:=$(CONFIG_SIPROXD_MAX_CLIENTS)
+RTPPROXY:=$(shell expr $(URLMAP) \* 2)
+
+define Build/Configure
+ $(call Build/Configure/Default)
+ $(ESED) 's;^(#define[[:space:]]+URLMAP_SIZE).*$$$$;\1 $(URLMAP);' \
+ -e 's;^(#define[[:space:]]+RTPPROXY_SIZE).*$$$$;\1 $(RTPPROXY);' \
+ $(PKG_BUILD_DIR)/src/siproxd.h
+endef
+
define Package/siproxd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/siproxd $(1)/usr/sbin
define Package/siproxd-mod-$(subst _,-,$(1))/install
$(INSTALL_DIR) $$(1)/usr/lib/siproxd
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/siproxd/plugin_$(1).so $$(1)/usr/lib/siproxd
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/siproxd/plugin_$(1).so \
+ $$(1)/usr/lib/siproxd
endef
$$(eval $$(call BuildPackage,siproxd-mod-$(subst _,-,$(1))))
+++ /dev/null
-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 */