+++ /dev/null
-#
-# Copyright (C) 2017 OpenWrt.org
-# Copyright (C) 2017 Jiri Slachta
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=kamailio5
-PKG_VERSION:=5.4.0
-PKG_RELEASE:=3
-
-PKG_SOURCE_URL:=https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src
-PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz
-PKG_HASH:=9ee22d566a7b6f60eaf283e95ee6633046dc87117be03b6cf2bc27293087718b
-PKG_USE_MIPS16:=0
-
-PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
-
-PKG_INSTALL:=1
-
-PKG_BUILD_PARALLEL:=1
-
-MODULES_AVAILABLE:= \
- acc \
- acc_diameter \
- acc_json \
- alias_db \
- app_jsdt \
- app_lua \
- app_lua_sr \
- app_python3 \
- app_ruby \
- app_sqlang \
- async \
- auth \
- auth_db \
- auth_diameter \
- auth_ephemeral \
- auth_identity \
- auth_xkeys \
- avp \
- avpops \
- benchmark \
- blst \
- call_control \
- call_obj \
- carrierroute \
- cdp \
- cdp_avp \
- cfgutils \
- cfg_db \
- cfg_rpc \
- cfgt \
- cnxcc \
- corex \
- counters \
- cplc \
- crypto \
- ctl \
- db2_ldap \
- db2_ops \
- db_berkeley \
- db_cluster \
- db_flatstore \
- db_mysql \
- db_postgres \
- db_redis \
- db_sqlite \
- db_text \
- db_unixodbc \
- debugger \
- dialog \
- dialplan \
- dispatcher \
- diversion \
- dlgs \
- dmq \
- dmq_usrloc \
- domain \
- domainpolicy \
- drouting \
- enum \
- erlang \
- evapi \
- evrexec \
- exec \
- group \
- gzcompress \
- h350 \
- htable \
- http_client \
- imc \
- ims_auth \
- ims_charging \
- ims_dialog \
- ims_diameter_server \
- ims_icscf \
- ims_ipsec_pcscf \
- ims_isc \
- ims_ocs \
- ims_qos \
- ims_registrar_pcscf \
- ims_registrar_scscf \
- ims_usrloc_pcscf \
- ims_usrloc_scscf \
- ipops \
- jansson \
- janssonrpcc \
- json \
- jsonrpcs \
- keepalive \
- kemix \
- kex \
- lcr \
- ldap \
- log_custom \
- lost \
- mangler \
- matrix \
- maxfwd \
- mediaproxy \
- mohqueue \
- mqueue \
- msilo \
- msrp \
- mtree \
- nathelper \
- nat_traversal \
- ndb_redis \
- nosip \
- outbound \
- p_usrloc \
- path \
- pdb \
- pdt \
- permissions \
- pike \
- pipelimit \
- prefix_route \
- presence \
- presence_conference \
- presence_dialoginfo \
- presence_mwi \
- presence_profile \
- presence_reginfo \
- presence_xml \
- pua \
- pua_bla \
- pua_dialoginfo \
- pua_json \
- pua_reginfo \
- pua_rpc \
- pua_usrloc \
- pua_xmpp \
- pv \
- pv_headers \
- qos \
- ratelimit \
- regex \
- registrar \
- rls \
- rr \
- rtimer \
- rtjson \
- rtpengine \
- rtpproxy \
- sanity \
- sca \
- sctp \
- sdpops \
- seas \
- secfilter \
- sipcapture \
- sipdump \
- sipt \
- siptrace \
- siputils \
- sl \
- sms \
- smsops \
- snmpstats \
- speeddial \
- sqlops \
- ss7ops \
- statistics \
- statsc \
- statsd \
- stun \
- sst \
- tcpops \
- textops \
- textopsx \
- timer \
- tls \
- tmrec \
- topoh \
- topos \
- topos_redis \
- tm \
- tmx \
- tsilo \
- uac \
- uac_redirect \
- uid_auth_db \
- uid_avp_db \
- uid_domain \
- uid_gflags \
- uid_uri_db \
- uri_db \
- userblacklist \
- usrloc \
- utils \
- uuid \
- websocket \
- xcap_client \
- xcap_server \
- xhttp \
- xhttp_pi \
- xhttp_prom \
- xhttp_rpc \
- xlog \
- xmlops \
- xmlrpc \
- xmpp \
- xprint
-
-PKG_CONFIG_DEPENDS:= \
- $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(subst _,-,$(MODULES_AVAILABLE)))
-
-include $(INCLUDE_DIR)/nls.mk
-include $(INCLUDE_DIR)/package.mk
-include $(TOPDIR)/feeds/packages/lang/python/python3-version.mk
-
-# Build reproducibly
-TARGET_CFLAGS += -DVERSION_NODATE=1
-
-PREBUILT_STAMP=$(STAGING_DIR)/stamp/.$(PKG_NAME)_prebuilt
-TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS)
-
-INCL_MODULES:=
-
-define Package/kamailio5/Default
- SECTION:=net
- CATEGORY:=Network
- SUBMENU:=Telephony
- URL:=http://www.kamailio.org/
- DEPENDS:=$(ICONV_DEPENDS) +libncurses +libpthread +libreadline +libxml2
-endef
-
-define Package/kamailio5
-$(call Package/kamailio5/Default)
- TITLE:=Mature and flexible open source SIP server, v$(PKG_VERSION)
- USERID:=kamailio=380:kamailio=380
- MENU:=1
-endef
-
-define Package/kamailio5/conffiles
-/etc/config/kamailio
-/etc/init.d/kamailio
-/etc/kamailio/kamailio.cfg
-/etc/kamailio/kamctlrc
-endef
-
-define Package/kamailio5/install
-$(foreach c,kamailio.cfg kamctlrc,$(call Package/kamailio5/install/conffile,$(1),$(c));)
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) \
- $(PKG_INSTALL_DIR)/usr/sbin/kam{ailio,cmd,ctl,dbctl} \
- $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/kamailio/lib{srdb1,srdb2}.so* \
- $(1)/usr/lib/kamailio/
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_CONF) \
- ./files/kamailio.conf \
- $(1)/etc/config/kamailio
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) \
- ./files/kamailio.init \
- $(1)/etc/init.d/kamailio
- $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
- $(INSTALL_BIN) \
- ./files/kamailio.hotplug \
- $(1)/etc/hotplug.d/iface/99-kamailio
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/kamailio/kamctl \
- $(1)/usr/lib/kamailio/
-endef
-
-define Package/kamailio5/postinst
-#!/bin/sh
-if [ -z "$${IPKG_INSTROOT}" ]; then
- echo
- echo "o-------------------------------------------------------------------o"
- echo "| Kamailio note |"
- echo "o-------------------------------------------------------------------o"
- echo "| Edit /etc/config/kamailio to change basic init configuration. |"
- echo "o-------------------------------------------------------------=^_^=-o"
- echo
-fi
-exit 0
-endef
-
-define Package/kamailio5/install/conffile
- $(INSTALL_DIR) $(1)/etc/kamailio
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/kamailio/$(2) $(1)/etc/kamailio
-endef
-
-define Package/kamailio5/install/dbfiles
- $(INSTALL_DIR) $(1)/usr/share/kamailio/$(2)
- $(CP) $(PKG_INSTALL_DIR)/usr/share/kamailio/$(2)/* $(1)/usr/share/kamailio/$(2)/
-endef
-
-define Package/kamailio5/install/module
- $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/kamailio/modules/$(2).so* $(1)/usr/lib/kamailio/modules/
-endef
-
-define Package/kamailio5-lib-libkamailio-ims
-$(call Package/kamailio5/Default)
- TITLE:=Kamailio5 IMS library
- DEPENDS:=kamailio5
-endef
-
-define Package/kamailio5-lib-libkamailio-ims/install
- $(INSTALL_DIR) $(1)/usr/lib/kamailio
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/kamailio/libkamailio_ims.so* \
- $(1)/usr/lib/kamailio
-endef
-
-define Package/kamailio5-lib-libtrie
-$(call Package/kamailio5/Default)
- TITLE:=Kamailio5 digital tree library
- DEPENDS:=kamailio5
-endef
-
-define Package/kamailio5-lib-libtrie/install
- $(INSTALL_DIR) $(1)/usr/lib/kamailio
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/kamailio/libtrie.so* \
- $(1)/usr/lib/kamailio
-endef
-
-define Package/kamailio5-util-kambdb-recover
-$(call Package/kamailio5/Default)
- TITLE:=Kamailio5 Berkeley DB recovery utility
- DEPENDS:=kamailio5 +PACKAGE_kamailio5-util-kambdb-recover:kamailio5-mod-db-berkeley
-endef
-
-define Package/kamailio5-util-kambdb-recover/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kambdb_recover $(1)/usr/sbin
-endef
-
-define BuildKamailio5Module
- define Package/kamailio5-mod-$(subst _,-,$(1))
- $$(call Package/kamailio5/Default)
- TITLE:=$(2) for Kamailio5
- DEPENDS:=kamailio5 $(patsubst +%,+PACKAGE_kamailio5-mod-$(subst _,-,$(1)):%,$(4))
- ifneq ($$(CONFIG_PACKAGE_kamailio5-mod-$(subst _,-,$(1))),)
- INCL_MODULES+=$(1)
- endif
- endef
- define Package/kamailio5-mod-$(subst _,-,$(1))/conffiles
-$(subst $(space),$(newline),$(foreach c,$(6),/etc/kamailio/$(c)))
- endef
- define Package/kamailio5-mod-$(subst _,-,$(1))/install
-$(call Package/kamailio5/install/module,$$(1),$(1))
-$(foreach c,$(6),$(call Package/kamailio5/install/conffile,$$(1),$(c));)
-$(foreach d,$(5),$(call Package/kamailio5/install/dbfiles,$$(1),$(d));)
- ifeq ($(1),snmpstats)
- $(INSTALL_DIR) $$(1)/usr/share/snmp/mibs
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* \
- $$(1)/usr/share/snmp/mibs
- endif
- endef
-$$(eval $$(call BuildPackage,kamailio5-mod-$(subst _,-,$(1))))
-endef
-
-# Kamailio always builds a baseline of packages. The "standard" group is
-# the lightest baseline.
-
-# "uid_gflags" is added to the list of modules to have at least one
-# module that kicks off the build of the internal libsrdb2. The module
-# has no other extra dependencies.
-#
-# The same is done with:
-# "ims_diameter_server" -> libkamailio_ims
-# "carrierroute" -> libtrie
-
-EXTRA_MODULES:= \
- $(if $(CONFIG_PACKAGE_kamailio5-mod-carrierroute),,carrierroute) \
- $(if $(CONFIG_PACKAGE_kamailio5-mod-ims-diameter-server),,ims_diameter_server) \
- $(if $(CONFIG_PACKAGE_kamailio5-mod-uid-gflags),,uid_gflags)
-
-# MIPS tweak:
-#
-# Kamailio enables use of fast inline assembly locks when ARCH is set to
-# "mips2". When ARCH is set to "mips" instead, Kamailio assumes it is dealing
-# with an old 32-bit MIPS CPU without hardware locking support (like R3000).
-#
-# When CONFIG_CPU_TYPE matches one of the identifiers in the list below, set
-# ARCH to "mips2" to get FAST_LOCK support.
-ifeq ($(call qstrip,$(CONFIG_ARCH)),mips)
-CPU_MIPS2:=mips32 24kc 34kc 4kec 74kc
-endif
-
-MAKE_FLAGS += \
- $(if $(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_MIPS2)),ARCH="mips2",ARCH="$(ARCH)") \
- CC_EXTRA_OPTS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
- LD="$(TARGET_CC)" \
- LD_EXTRA_OPTS="$(TARGET_LDFLAGS)" \
- LIBDIR=lib \
- PREFIX=/usr \
- cfg_prefix="$(PKG_INSTALL_DIR)" \
- cfg_target=/etc/kamailio \
- group_include="standard" \
- include_modules="$$(INCL_MODULES) $(EXTRA_MODULES)" \
- quiet=verbose \
- run_prefix=""
-
-MAKE_VARS += \
- PYTHON3=python$(PYTHON3_VERSION)
-
-define Build/Prepare
- $(call Build/Prepare/Default)
- # Upstream adds "-funroll-loops" to compiler flags, which increases
- # binary size significantly. Remove this flag.
- $(SED) 's/[ ]*-funroll-loops//' $(PKG_BUILD_DIR)/src/Makefile.defs
-endef
-
-define Build/Configure
-endef
-
-define Build/Compile
- $(call Build/Compile/Default,cfg)
- $(call Build/Compile/Default,all)
-endef
-
-$(eval $(call BuildPackage,kamailio5))
-$(eval $(call BuildPackage,kamailio5-lib-libkamailio-ims))
-$(eval $(call BuildPackage,kamailio5-lib-libtrie))
-$(eval $(call BuildPackage,kamailio5-util-kambdb-recover))
-
-################################
-# Kamailio module parameters
-# Params:
-# 1 - Module name
-# 2 - Module title
-# 3 - Module description
-# 4 - Dependencies
-# 5 - Kamailio DB files
-# 6 - Configuration files
-################################
-
-$(eval $(call BuildKamailio5Module,acc,Accounting,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,acc_diameter,Accounting for DIAMETER backend,,+kamailio5-mod-acc))
-$(eval $(call BuildKamailio5Module,acc_json,Accounting with records exported in JSON format,,+jansson +kamailio5-mod-acc))
-$(eval $(call BuildKamailio5Module,alias_db,Database-backend aliases,,))
-$(eval $(call BuildKamailio5Module,app_jsdt,Execute JavaScript scripts,,))
-$(eval $(call BuildKamailio5Module,app_lua,Execute embedded Lua scripts,,+liblua))
-$(eval $(call BuildKamailio5Module,app_lua_sr,Old Lua API,,+kamailio5-mod-app-lua,))
-$(eval $(call BuildKamailio5Module,app_python3,Python3 scripting interpreter,,+python3-light))
-$(eval $(call BuildKamailio5Module,app_ruby,Ruby scripting interpreter,,+libruby))
-$(eval $(call BuildKamailio5Module,app_sqlang,Execute Squirrel language scripts,,+libstdcpp))
-$(eval $(call BuildKamailio5Module,async,Asynchronous SIP handling functions,,+kamailio5-mod-tm +kamailio5-mod-tmx))
-$(eval $(call BuildKamailio5Module,auth,Authentication Framework,,))
-$(eval $(call BuildKamailio5Module,auth_db,Database-backend authentication,,+kamailio5-mod-auth))
-$(eval $(call BuildKamailio5Module,auth_diameter,Diameter authentication,,+kamailio5-mod-sl))
-$(eval $(call BuildKamailio5Module,auth_ephemeral,Ephemeral credentials,,+libopenssl))
-$(eval $(call BuildKamailio5Module,auth_identity,Identity authentication,,+libopenssl +libcurl))
-$(eval $(call BuildKamailio5Module,auth_xkeys,Shared-key authentication,,+kamailio5-mod-auth))
-$(eval $(call BuildKamailio5Module,avp,Functions for handling AVPs,,))
-$(eval $(call BuildKamailio5Module,avpops,AVP operation,,))
-$(eval $(call BuildKamailio5Module,benchmark,Config benchmark,,))
-$(eval $(call BuildKamailio5Module,blst,Blacklisting API for config,,))
-$(eval $(call BuildKamailio5Module,call_control,Call Control,,+kamailio5-mod-dialog +kamailio5-mod-pv))
-$(eval $(call BuildKamailio5Module,call_obj,Call identification support,,))
-$(eval $(call BuildKamailio5Module,carrierroute,Carrier Route,,+kamailio5-lib-libtrie))
-$(eval $(call BuildKamailio5Module,cdp,C Diameter Peer,,))
-$(eval $(call BuildKamailio5Module,cdp_avp,CDP AVP helper module,,+kamailio5-mod-cdp))
-$(eval $(call BuildKamailio5Module,cfgutils,Config utilities,,))
-$(eval $(call BuildKamailio5Module,cfg_db,Load parameters from database,,))
-$(eval $(call BuildKamailio5Module,cfg_rpc,Update parameters via RPC,,))
-$(eval $(call BuildKamailio5Module,cfgt,Unit test reporting,,))
-$(eval $(call BuildKamailio5Module,cnxcc,Limit call duration,,+kamailio5-mod-dialog +libhiredis +libevent2))
-$(eval $(call BuildKamailio5Module,corex,Legacy functions,,))
-$(eval $(call BuildKamailio5Module,counters,Functions for counter manipulation,,))
-$(eval $(call BuildKamailio5Module,cplc,Call Processing Language interpreter,,+kamailio5-mod-sl +kamailio5-mod-tm +kamailio5-mod-usrloc))
-$(eval $(call BuildKamailio5Module,crypto,Various cryptography tools,,+libopenssl))
-$(eval $(call BuildKamailio5Module,ctl,BINRPC transport interface,,))
-$(eval $(call BuildKamailio5Module,db2_ldap,DBv2 LDAP module,,+libopenldap))
-$(eval $(call BuildKamailio5Module,db2_ops,Run SQL queries from script,,))
-$(eval $(call BuildKamailio5Module,db_berkeley,Berkeley DB backend,,+libdb47))
-$(eval $(call BuildKamailio5Module,db_cluster,Database clustering system,,))
-$(eval $(call BuildKamailio5Module,db_flatstore,fast write-only text DB-backend,,))
-$(eval $(call BuildKamailio5Module,db_mysql,MySQL DB-backend,,+libmysqlclient,mysql))
-$(eval $(call BuildKamailio5Module,db_postgres,PostgreSQL DB-backend,,+libpq,postgres))
-$(eval $(call BuildKamailio5Module,db_redis,Database backend with Redis server,,+libhiredis,db_redis))
-$(eval $(call BuildKamailio5Module,db_sqlite,SQLite DB-backend,,+libsqlite3,db_sqlite))
-$(eval $(call BuildKamailio5Module,db_text,Text DB-backend,,,dbtext/kamailio))
-$(eval $(call BuildKamailio5Module,db_unixodbc,UnixODBC DB-backend,,+unixodbc))
-$(eval $(call BuildKamailio5Module,debugger,Interactive config file debugger,,))
-$(eval $(call BuildKamailio5Module,dialog,Dialog support,,+kamailio5-mod-rr +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,dialplan,Dialplan management,,+libpcre))
-$(eval $(call BuildKamailio5Module,dispatcher,Dispatcher,,))
-$(eval $(call BuildKamailio5Module,diversion,Diversion header insertion,,))
-$(eval $(call BuildKamailio5Module,dlgs,Track active calls in stateless mode,,))
-$(eval $(call BuildKamailio5Module,dmq,Distributed Message Queue,,+kamailio5-mod-sl +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,dmq_usrloc,DMQ USRLOC replication,,+kamailio5-mod-dmq +kamailio5-mod-usrloc))
-$(eval $(call BuildKamailio5Module,domain,Multi-domain support,,))
-$(eval $(call BuildKamailio5Module,domainpolicy,Domain policy,,))
-$(eval $(call BuildKamailio5Module,drouting,Dynamic routing module,,))
-$(eval $(call BuildKamailio5Module,enum,ENUM lookup,,))
-$(eval $(call BuildKamailio5Module,erlang,Erlang node connector module,,@!USE_MUSL +erlang))
-$(eval $(call BuildKamailio5Module,evapi,push event details via tcp,,+libev))
-$(eval $(call BuildKamailio5Module,evrexec,Execut event routes at startup,,))
-$(eval $(call BuildKamailio5Module,exec,External exec,,))
-$(eval $(call BuildKamailio5Module,group,Database-backend user-groups,,))
-$(eval $(call BuildKamailio5Module,gzcompress,Compress SIP messages,,+zlib))
-$(eval $(call BuildKamailio5Module,h350,H.350,,+kamailio5-mod-ldap +libopenldap))
-$(eval $(call BuildKamailio5Module,htable,Hash Table,,))
-$(eval $(call BuildKamailio5Module,http_client,HTTP client using CURL,,+libcurl))
-$(eval $(call BuildKamailio5Module,imc,IM conferencing,,+kamailio5-mod-db-mysql +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_auth,IMS authentication module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-cdp +kamailio5-mod-cdp-avp +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_charging,IMS charging component module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-cdp +kamailio5-mod-cdp-avp +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_dialog,IMS dialog tracking module,,+kamailio5-mod-rr +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_diameter_server,IMS DIAMETER server module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-cdp +kamailio5-mod-cdp-avp))
-$(eval $(call BuildKamailio5Module,ims_icscf,IMS ICSCF component module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-cdp +kamailio5-mod-cdp-avp +kamailio5-mod-sl +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_ipsec_pcscf,Diameter server implementation,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-ims-usrloc-pcscf +kamailio5-mod-tm +libmnl))
-$(eval $(call BuildKamailio5Module,ims_isc,IMS ISC component module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-ims-usrloc-scscf +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_ocs,MS OCS component module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-cdp +kamailio5-mod-cdp-avp))
-$(eval $(call BuildKamailio5Module,ims_qos,IMS Diameter Rx interface between PCSCF and PCRF functions,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-cdp +kamailio5-mod-cdp-avp +kamailio5-mod-ims-dialog +kamailio5-mod-ims-usrloc-pcscf +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_registrar_pcscf,MS PCSCF registrar module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-ims-usrloc-pcscf))
-$(eval $(call BuildKamailio5Module,ims_registrar_scscf,IMS SCSCF registrar module,,+kamailio5-lib-libkamailio-ims +kamailio5-mod-cdp +kamailio5-mod-cdp-avp +kamailio5-mod-ims-usrloc-scscf +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ims_usrloc_pcscf,IMS PCSCF usrloc module,,))
-$(eval $(call BuildKamailio5Module,ims_usrloc_scscf,IMS SCSCF usrloc module,,))
-$(eval $(call BuildKamailio5Module,ipops,IP and IPv6 operations,,))
-$(eval $(call BuildKamailio5Module,jansson,Access to JSON attributes,,+jansson))
-$(eval $(call BuildKamailio5Module,janssonrpcc,Alternative JSONRPC server,,+kamailio5-mod-jansson +libevent2))
-$(eval $(call BuildKamailio5Module,json,Access to JSON document attributes,,+libjson-c))
-$(eval $(call BuildKamailio5Module,jsonrpcs,JSONRPC server over HTTP,,+libevent2))
-$(eval $(call BuildKamailio5Module,keepalive,SIP keepalive monitoring,+kamailio5-mod-tm,))
-$(eval $(call BuildKamailio5Module,kemix,KEMI extensions,,,))
-$(eval $(call BuildKamailio5Module,kex,Core extensions,,))
-$(eval $(call BuildKamailio5Module,lcr,Least Cost Routing,,+kamailio5-mod-tm +libpcre))
-$(eval $(call BuildKamailio5Module,ldap,LDAP connector,,+libopenldap))
-$(eval $(call BuildKamailio5Module,log_custom,Logging to custom backends,,))
-$(eval $(call BuildKamailio5Module,lost,HELD and LOST routing,,+kamailio5-mod-http-client,))
-$(eval $(call BuildKamailio5Module,mangler,SDP mangling,,))
-$(eval $(call BuildKamailio5Module,matrix,Matrix operations,,))
-$(eval $(call BuildKamailio5Module,maxfwd,Max-Forward processor,,))
-$(eval $(call BuildKamailio5Module,mediaproxy,Automatic NAT traversal,,+kamailio5-mod-dialog))
-$(eval $(call BuildKamailio5Module,mohqueue,Music on hold queuing system,,+kamailio5-mod-rtpproxy +kamailio5-mod-sl +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,mqueue,Generic message queue system,,))
-$(eval $(call BuildKamailio5Module,msilo,SIP message silo,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,msrp,MSRP routing engine,,+kamailio5-mod-tls))
-$(eval $(call BuildKamailio5Module,mtree,Memory caching system,,))
-$(eval $(call BuildKamailio5Module,nathelper,NAT helper,,+kamailio5-mod-usrloc))
-$(eval $(call BuildKamailio5Module,nat_traversal,NAT traversal,,+kamailio5-mod-dialog +kamailio5-mod-sl +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,ndb_redis,Connect to REDIS NoSQL,,+libhiredis))
-$(eval $(call BuildKamailio5Module,nosip,non-sip package handling,,+kamailio5-mod-rr))
-$(eval $(call BuildKamailio5Module,outbound,SIP Outbound implementation,,+kamailio5-mod-stun +libopenssl))
-$(eval $(call BuildKamailio5Module,p_usrloc,Partitioned USRLOC services,,))
-$(eval $(call BuildKamailio5Module,path,SIP path insertion,,+kamailio5-mod-rr))
-$(eval $(call BuildKamailio5Module,pdb,Number portability module,,))
-$(eval $(call BuildKamailio5Module,pdt,Prefix-to-Domain translator,,))
-$(eval $(call BuildKamailio5Module,permissions,Permissions control,,))
-$(eval $(call BuildKamailio5Module,pike,Flood detector,,))
-$(eval $(call BuildKamailio5Module,pipelimit,Traffic shaping policies,,+kamailio5-mod-sl))
-$(eval $(call BuildKamailio5Module,prefix_route,Execute based on prefix,,))
-$(eval $(call BuildKamailio5Module,presence,Presence server,,+kamailio5-mod-sl +kamailio5-mod-tm,))
-$(eval $(call BuildKamailio5Module,presence_conference,Conference events,,+kamailio5-mod-presence))
-$(eval $(call BuildKamailio5Module,presence_dialoginfo,Dialog Event presence,,+kamailio5-mod-presence))
-$(eval $(call BuildKamailio5Module,presence_mwi,MWI presence,,+kamailio5-mod-presence))
-$(eval $(call BuildKamailio5Module,presence_profile,User profile extensions,,+kamailio5-mod-presence))
-$(eval $(call BuildKamailio5Module,presence_reginfo,Registration info,,+kamailio5-mod-presence))
-$(eval $(call BuildKamailio5Module,presence_xml,XCAP presence,,+kamailio5-mod-presence +kamailio5-mod-xcap-client))
-$(eval $(call BuildKamailio5Module,pua,Presence User Agent,,+kamailio5-mod-tm,))
-$(eval $(call BuildKamailio5Module,pua_bla,Bridged Line Appearence PUA,,+kamailio5-mod-presence +kamailio5-mod-pua +kamailio5-mod-usrloc))
-$(eval $(call BuildKamailio5Module,pua_dialoginfo,Dialog Event PUA,,+kamailio5-mod-dialog +kamailio5-mod-pua))
-$(eval $(call BuildKamailio5Module,pua_json,Presence user agent implementation with JSON messages,,+libjson-c))
-$(eval $(call BuildKamailio5Module,pua_reginfo,PUA registration info,,+kamailio5-mod-pua +kamailio5-mod-usrloc))
-$(eval $(call BuildKamailio5Module,pua_rpc,RPC extensions for PUA,,+kamailio5-mod-pua))
-$(eval $(call BuildKamailio5Module,pua_usrloc,PUA User Location,,+kamailio5-mod-pua +kamailio5-mod-usrloc))
-$(eval $(call BuildKamailio5Module,pua_xmpp,PUA XMPP,,+kamailio5-mod-presence +kamailio5-mod-pua +kamailio5-mod-xmpp))
-$(eval $(call BuildKamailio5Module,pv,Pseudo-Variables,,))
-$(eval $(call BuildKamailio5Module,pv_headers,Flexible SIP header management,,))
-$(eval $(call BuildKamailio5Module,qos,QoS control,,+kamailio5-mod-dialog))
-$(eval $(call BuildKamailio5Module,ratelimit,Traffic shapping,,))
-$(eval $(call BuildKamailio5Module,regex,Regular Expression,,+libpcre))
-$(eval $(call BuildKamailio5Module,registrar,SIP Registrar,,+kamailio5-mod-usrloc))
-$(eval $(call BuildKamailio5Module,rls,Resource List Server,,+kamailio5-mod-presence +kamailio5-mod-pua +kamailio5-mod-tm,))
-$(eval $(call BuildKamailio5Module,rr,Record-Route and Route,,))
-$(eval $(call BuildKamailio5Module,rtimer,Routing Timer,,))
-$(eval $(call BuildKamailio5Module,rtjson,SIP routing based on JSON API,,))
-$(eval $(call BuildKamailio5Module,rtpengine,RTP engine,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,rtpproxy,RTP proxy,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,sanity,SIP sanity checks,,+kamailio5-mod-sl))
-$(eval $(call BuildKamailio5Module,sca,Shared Call Appearances,,+kamailio5-mod-sl +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,sctp,SCTP support,,+libsctp))
-$(eval $(call BuildKamailio5Module,sdpops,Managing SDP payloads,,))
-$(eval $(call BuildKamailio5Module,seas,Sip Express Application Server,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,secfilter,Allow/block filters,,,))
-$(eval $(call BuildKamailio5Module,sipcapture,SIP capture,,))
-$(eval $(call BuildKamailio5Module,sipdump,Save SIP traffic,,))
-$(eval $(call BuildKamailio5Module,sipt,SIP-T and SIP-I operations,,))
-$(eval $(call BuildKamailio5Module,siptrace,SIP trace,,))
-$(eval $(call BuildKamailio5Module,siputils,SIP utilities,,+kamailio5-mod-sl))
-$(eval $(call BuildKamailio5Module,sl,Stateless replier,,))
-$(eval $(call BuildKamailio5Module,sms,SIP-to-SMS IM gateway,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,smsops,Handle SMS packets in SIP,,))
-$(eval $(call BuildKamailio5Module,snmpstats,SNMP interface for statistics,,+libnetsnmp))
-$(eval $(call BuildKamailio5Module,speeddial,Per-user speed-dial controller,,))
-$(eval $(call BuildKamailio5Module,sqlops,SQL operations,,))
-$(eval $(call BuildKamailio5Module,ss7ops,JSON Operations for SS7 over HEP,,))
-$(eval $(call BuildKamailio5Module,statistics,Script statistics,,))
-$(eval $(call BuildKamailio5Module,statsc,Statistics collector,,))
-$(eval $(call BuildKamailio5Module,statsd,Connector for statsd application,,))
-$(eval $(call BuildKamailio5Module,stun,STUN server support,,))
-$(eval $(call BuildKamailio5Module,sst,SIP Session Timer,,+kamailio5-mod-dialog +kamailio5-mod-sl))
-$(eval $(call BuildKamailio5Module,tcpops,TCP options tweaking operations,,))
-$(eval $(call BuildKamailio5Module,textops,Text operations,,))
-$(eval $(call BuildKamailio5Module,textopsx,Extra text operations,,))
-$(eval $(call BuildKamailio5Module,timer,Execute routing blocks on core timers,,))
-$(eval $(call BuildKamailio5Module,tls,TLS operations,,+libopenssl,,tls.cfg))
-$(eval $(call BuildKamailio5Module,tmrec,Match time recurrences,,))
-$(eval $(call BuildKamailio5Module,topoh,Topology hiding,,+kamailio5-mod-rr))
-$(eval $(call BuildKamailio5Module,topos,Topology stripping module,,+kamailio5-mod-rr))
-$(eval $(call BuildKamailio5Module,topos_redis,Redis backend for topos module,,+kamailio5-mod-ndb-redis +kamailio5-mod-topos))
-$(eval $(call BuildKamailio5Module,tm,Transaction,,))
-$(eval $(call BuildKamailio5Module,tmx,Transaction module extensions,,))
-$(eval $(call BuildKamailio5Module,tsilo,Transaction storage,,+kamailio5-mod-registrar +kamailio5-mod-sl +kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,uac,User Agent Client,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,uac_redirect,User Agent Client redirection,,+kamailio5-mod-tm))
-$(eval $(call BuildKamailio5Module,uid_auth_db,Authentication module,,+kamailio5-mod-auth))
-$(eval $(call BuildKamailio5Module,uid_avp_db,AVP database operations,,))
-$(eval $(call BuildKamailio5Module,uid_domain,Domains management,,))
-$(eval $(call BuildKamailio5Module,uid_gflags,Global attributes and flags,,))
-$(eval $(call BuildKamailio5Module,uid_uri_db,Database URI operations,,))
-$(eval $(call BuildKamailio5Module,uri_db,Database-backend SIP URI checking,,))
-$(eval $(call BuildKamailio5Module,userblacklist,User blacklists,,+kamailio5-lib-libtrie))
-$(eval $(call BuildKamailio5Module,usrloc,User location,,))
-$(eval $(call BuildKamailio5Module,utils,Misc utilities,,+libcurl,))
-$(eval $(call BuildKamailio5Module,uuid,UUID utilities,,+libuuid))
-$(eval $(call BuildKamailio5Module,websocket,WebSocket transport layer,,+kamailio5-mod-sl +kamailio5-mod-tm +libopenssl +libunistring))
-$(eval $(call BuildKamailio5Module,xcap_client,XCAP Client,,+libcurl))
-$(eval $(call BuildKamailio5Module,xcap_server,XCAP server implementation,,+kamailio5-mod-xhttp +kamailio5-mod-sl))
-$(eval $(call BuildKamailio5Module,xhttp,Basic HTTP request handling server,,+kamailio5-mod-sl))
-$(eval $(call BuildKamailio5Module,xhttp_pi,HTTP provisioning interface,,+kamailio5-mod-xhttp,xhttp_pi,pi_framework.xml))
-$(eval $(call BuildKamailio5Module,xhttp_prom,Prometheus metrics,,+kamailio5-mod-xhttp,))
-$(eval $(call BuildKamailio5Module,xhttp_rpc,RPC commands handling over HTTP,,+kamailio5-mod-xhttp))
-$(eval $(call BuildKamailio5Module,xlog,Advanced logger,,))
-$(eval $(call BuildKamailio5Module,xmlops,XML operations,,))
-$(eval $(call BuildKamailio5Module,xmlrpc,XML RPC module,,,))
-$(eval $(call BuildKamailio5Module,xmpp,SIP-to-XMPP Gateway,,+kamailio5-mod-tm +libexpat))
-$(eval $(call BuildKamailio5Module,xprint,Print messages with specifiers,,))
+++ /dev/null
-
-config kamailio 'general'
- option enabled 0
- option user kamailio
- option group kamailio
- # Amount of shared and private memory to allocate in MByte:
- option shm_memory 8
- option pkg_memory 2
- option cfg_file /etc/kamailio/kamailio.cfg
- # The lists "listen" and "listen6" basically have the same
- # effect - each list entry will be added to the Kamailio command
- # line ("-l address"). However, the init script will try to
- # resolve any interface specifier into an IPv4 ("listen") or
- # IPv6 ("listen6") address before starting Kamailio. These lists
- # may be helpful when using dynamic IPs.
- #list listen udp:wan:5060
- #list listen udp:192.168.1.1:5060
- #list listen6 udp:wan:5060
- # Any other option can be put between the quotes below:
- #option options ""
-
-config kamailio 'hotplug'
- # Uncomment to enable hotplug:
- #option interface 'wan'
-
+++ /dev/null
-#!/bin/sh
-
-[ "$ACTION" = ifup ] || exit 0
-
-NAME=kamailio
-COMMAND=/etc/init.d/$NAME
-LOGGER="/usr/bin/logger -t hotplug"
-
-$COMMAND enabled || exit 0
-
-. /lib/functions.sh
-
-config_load $NAME
-
-config_get_bool enabled general enabled 0
-[ $enabled -eq 0 ] && exit 0
-
-config_get hotplug_iface hotplug interface
-
-[ "$INTERFACE" = "$hotplug_iface" ] && {
- $LOGGER "Restarting $NAME due to \"$ACTION\" of \"$INTERFACE\""
- $COMMAND restart
-}
-
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2014 - 2018 OpenWrt.org
-
-START=99
-
-NAME=kamailio
-COMMAND=/usr/sbin/$NAME
-
-RUNDIR=/var/run/$NAME
-PIDFILE=$RUNDIR/$NAME.pid
-
-LOG_ERR="/usr/bin/logger -p user.err -s -t $NAME"
-
-USE_PROCD=1
-
-#PROCD_DEBUG=1
-
-check_listen() {
- local value="$1"
- local type="$2"
-
- local address
- local has_proto=0
- local one two three
- local tmp
-
- [ -z "$value" ] && {
- $LOG_ERR empty $type entry
- exit 1
- }
-
- # IPv6 addresses need to be enclosed in square brackets. If there are
- # square brackets in the listen entry, just copy it.
- echo "$value" | grep "\[[0-9:A-Fa-f]*\]" &> /dev/null && {
- options=$options" -l $value"
- return
- }
-
- # Bail if more than 2 colons.
- [ $(echo "$value" | awk -F ":" '{print NF-1}') -gt 2 ] && {
- $LOG_ERR init script does not understand $type entry \""$value"\"
- exit 1
- }
-
- IFS=":" read one two three << EOF
-$value
-EOF
-
- case "$one" in
- udp|tcp|tls|sctp)
- tmp="$two"
- has_proto=1
- ;;
- *)
- tmp="$one"
- ;;
- esac
-
- if [ "$type" = "listen" ]; then
- network_get_ipaddr address "$tmp" || address="$tmp"
- else
- network_get_ipaddr6 address "$tmp" && address="[$address]" || \
- address="$tmp"
- fi
-
- if [ -n "$three" ]; then
- tmp="$one:$address:$three"
- elif [ -n "$two" ]; then
- if [ $has_proto = 1 ]; then
- tmp="$one:$address"
- else
- tmp="$address:$two"
- fi
- else
- tmp="$address"
- fi
-
- options=$options" -l $tmp"
-}
-
-start_service() {
- local enabled
- local user
- local group
- local shm_memory
- local pkg_memory
- local cfg_file
- local options
-
- config_load $NAME
-
- config_get_bool enabled general enabled 0
-
- if [ $enabled -eq 0 ]; then
- $LOG_ERR service not enabled in /etc/config/$NAME
- exit 1
- fi
-
- config_get user general user $NAME
- config_get group general group $NAME
- config_get shm_memory general shm_memory 8
- config_get pkg_memory general pkg_memory 2
- config_get cfg_file general cfg_file /etc/$NAME/$NAME.cfg
- config_get options general options
-
- . /lib/functions/network.sh
-
- config_list_foreach general listen check_listen listen
- config_list_foreach general listen6 check_listen listen6
-
- if [ ! -d $RUNDIR ]; then
- mkdir -p $RUNDIR
- chown "$user":"$group" $RUNDIR
- fi
-
- procd_open_instance
- procd_set_param command $COMMAND
- procd_append_param command \
- -P $PIDFILE \
- -f "$cfg_file" \
- -m "$shm_memory" \
- -M "$pkg_memory" \
- $options \
- -u "$user" \
- -g "$group" \
- -DD -E
- # forward stderr to logd
- procd_set_param stderr 1
- procd_close_instance
-}
-
+++ /dev/null
---- a/utils/kamctl/kamctlrc
-+++ b/utils/kamctl/kamctlrc
-@@ -162,3 +162,6 @@
- ## Extra start options - default is: not set
- ## example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"
- # STARTOPTIONS=
-+
-+# Disable colour printing in terminal
-+NOHLPRINT=1
+++ /dev/null
---- a/src/modules/janssonrpcc/netstring.h
-+++ b/src/modules/janssonrpcc/netstring.h
-@@ -24,6 +24,7 @@
- #define __NETSTRING_STREAM_H
-
- #include <string.h>
-+#include <event2/buffer.h>
- #include <event2/bufferevent.h>
-
- typedef struct {
+++ /dev/null
---- a/src/modules/snmpstats/Makefile
-+++ b/src/modules/snmpstats/Makefile
-@@ -16,7 +16,7 @@ ifeq ($(BUILDER),)
- INSTALLMIBDIR = $(share_prefix)/share/snmp/mibs
- else
- BUILDAGENTLIBS = $(shell net-snmp-config --netsnmp-agent-libs)
-- INSTALLMIBDIR = $(basedir)$(shell net-snmp-config --prefix)/share/snmp/mibs
-+ INSTALLMIBDIR = $(basedir)/usr/share/snmp/mibs
- endif
-
- ifeq ($(EMBEDDED_PERL),1)
+++ /dev/null
---- a/src/modules/cnxcc/Makefile
-+++ b/src/modules/cnxcc/Makefile
-@@ -8,12 +8,10 @@ include ../../Makefile.defs
- auto_gen=
- NAME=cnxcc.so
-
--ifeq ($(CROSS_COMPILE),)
- HIREDIS_BUILDER = $(shell \
- if pkg-config --exists hiredis; then \
- echo 'pkg-config hiredis'; \
- fi)
--endif
-
- ifeq ($(HIREDIS_BUILDER),)
- HIREDISDEFS=-I$(LOCALBASE)/include
---- a/src/modules/db_redis/Makefile
-+++ b/src/modules/db_redis/Makefile
-@@ -5,12 +5,10 @@ include ../../Makefile.defs
- auto_gen=
- NAME=db_redis.so
-
--ifeq ($(CROSS_COMPILE),)
- HIREDIS_BUILDER = $(shell \
- if pkg-config --exists hiredis; then \
- echo 'pkg-config hiredis'; \
- fi)
--endif
-
- ifeq ($(HIREDIS_BUILDER),)
- HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis
---- a/src/modules/ndb_redis/Makefile
-+++ b/src/modules/ndb_redis/Makefile
-@@ -5,12 +5,10 @@ include ../../Makefile.defs
- auto_gen=
- NAME=ndb_redis.so
-
--ifeq ($(CROSS_COMPILE),)
- HIREDIS_BUILDER = $(shell \
- if pkg-config --exists hiredis; then \
- echo 'pkg-config hiredis'; \
- fi)
--endif
-
- ifeq ($(HIREDIS_BUILDER),)
- HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis
---- a/src/modules/topos_redis/Makefile
-+++ b/src/modules/topos_redis/Makefile
-@@ -5,12 +5,10 @@ include ../../Makefile.defs
- auto_gen=
- NAME=topos_redis.so
-
--ifeq ($(CROSS_COMPILE),)
- HIREDIS_BUILDER = $(shell \
- if pkg-config --exists hiredis; then \
- echo 'pkg-config hiredis'; \
- fi)
--endif
-
- ifeq ($(HIREDIS_BUILDER),)
- HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis
+++ /dev/null
---- a/src/modules/erlang/Makefile
-+++ b/src/modules/erlang/Makefile
-@@ -5,20 +5,21 @@ include ../../Makefile.defs
- auto_gen=
- NAME=erlang.so
-
--ERLANG=$(shell which erl)
-+# In OpenWrt Erlang resides in standard locations, no special flags required
-+#ERLANG=$(shell which erl)
-
- ifneq ($(ERLANG),)
- ERLANG_LIBDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1)
- ERLANG_INCDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1)
- endif
-
--ifeq ($(ERLANG_LIBDIR)$(ERLANG_INCDIR),)
--$(error Not found Erlang)
--endif
-+#ifeq ($(ERLANG_LIBDIR)$(ERLANG_INCDIR),)
-+#$(error Not found Erlang)
-+#endif
-
--LIBS=-L$(ERLANG_LIBDIR) -lei -lpthread
-+LIBS=-lei -lpthread
-
--DEFS+=-I$(ERLANG_INCDIR)
-+#DEFS+=-I$(ERLANG_INCDIR)
- DEFS+=-D_REENTRANT
-
-
+++ /dev/null
---- a/src/modules/tls/tls_domain.c
-+++ b/src/modules/tls/tls_domain.c
-@@ -27,6 +27,8 @@
- #include <stdlib.h>
- #include <openssl/ssl.h>
- #include <openssl/opensslv.h>
-+#include <openssl/bn.h>
-+#include <openssl/dh.h>
-
- #ifndef OPENSSL_NO_ENGINE
- #include <openssl/engine.h>
-@@ -61,7 +63,7 @@ static void setup_ecdh(SSL_CTX *ctx)
- {
- EC_KEY *ecdh;
-
-- if (SSLeay() < 0x1000005fL) {
-+ if (OpenSSL_version_num() < 0x1000005fL) {
- return;
- }
-
---- a/src/modules/tls/tls_init.c
-+++ b/src/modules/tls/tls_init.c
-@@ -627,14 +627,13 @@ int tls_h_mod_pre_init_f(void)
- return 0;
- }
- LM_DBG("preparing tls env for modules initialization\n");
--#if OPENSSL_VERSION_NUMBER >= 0x010100000L && !defined(LIBRESSL_VERSION_NUMBER)
-- LM_DBG("preparing tls env for modules initialization (libssl >=1.1)\n");
-- OPENSSL_init_ssl(0, NULL);
--#else
-+#if OPENSSL_VERSION_NUMBER < 0x010100000L || defined(LIBRESSL_VERSION_NUMBER)
- LM_DBG("preparing tls env for modules initialization (libssl <=1.0)\n");
- SSL_library_init();
--#endif
- SSL_load_error_strings();
-+#else
-+ LM_DBG("preparing tls env for modules initialization (libssl >=1.1)\n");
-+#endif
- tls_mod_preinitialized=1;
- return 0;
- }
-@@ -668,7 +667,7 @@ int tls_h_mod_init_f(void)
- #if OPENSSL_VERSION_NUMBER < 0x00907000L
- LM_WARN("You are using an old version of OpenSSL (< 0.9.7). Upgrade!\n");
- #endif
-- ssl_version=SSLeay();
-+ ssl_version=OpenSSL_version_num();
- /* check if version have the same major minor and fix level
- * (e.g. 0.9.8a & 0.9.8c are ok, but 0.9.8 and 0.9.9x are not)
- * - values is represented as 0xMMNNFFPPS: major minor fix patch status
-@@ -680,7 +679,7 @@ int tls_h_mod_init_f(void)
- " compiled \"%s\" (0x%08lx).\n"
- " Please make sure a compatible version is used"
- " (tls_force_run in kamailio.cfg will override this check)\n",
-- SSLeay_version(SSLEAY_VERSION), ssl_version,
-+ OpenSSL_version(OPENSSL_VERSION), ssl_version,
- OPENSSL_VERSION_TEXT, (long)OPENSSL_VERSION_NUMBER);
- if (cfg_get(tls, tls_cfg, force_run))
- LM_WARN("tls_force_run turned on, ignoring "
-@@ -857,6 +856,7 @@ int tls_check_sockets(tls_domains_cfg_t* cfg)
- void tls_h_mod_destroy_f(void)
- {
- LM_DBG("tls module final tls destroy\n");
-+#if OPENSSL_VERSION_NUMBER < 0x010100000L || defined(LIBRESSL_VERSION_NUMBER)
- if(tls_mod_preinitialized > 0)
- ERR_free_strings();
- /* TODO: free all the ctx'es */
-@@ -869,4 +869,5 @@ void tls_h_mod_destroy_f(void)
- LM_DBG("executing openssl v1.1+ cleanup\n");
- OPENSSL_cleanup();
- #endif
-+#endif
- }
---- a/src/modules/tls/tls_locking.c
-+++ b/src/modules/tls/tls_locking.c
-@@ -140,6 +140,8 @@ unsigned long sr_ssl_id_f()
- /* returns -1 on error, 0 on success */
- int tls_init_locks()
- {
-+/* OpenSSL is thread-safe since 1.1.0 */
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
- /* init "static" tls locks */
- n_static_locks=CRYPTO_num_locks();
- if (n_static_locks<0){
-@@ -167,13 +169,10 @@ int tls_init_locks()
- CRYPTO_set_locking_callback(locking_f);
- }
-
--/* OpenSSL is thread-safe since 1.1.0 */
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
- /* set "dynamic" locks callbacks */
- CRYPTO_set_dynlock_create_callback(dyn_create_f);
- CRYPTO_set_dynlock_lock_callback(dyn_lock_f);
- CRYPTO_set_dynlock_destroy_callback(dyn_destroy_f);
--#endif
-
- /* starting with v1.0.0 openssl does not use anymore getpid(), but address
- * of errno which can point to same virtual address in a multi-process
-@@ -186,6 +185,7 @@ int tls_init_locks()
- * (only atomic_inc), fallback to the default use-locks mode
- * CRYPTO_set_add_lock_callback(atomic_add_f);
- */
-+#endif
-
- return 0;
- error:
--- /dev/null
+#
+# Copyright (C) 2017 OpenWrt.org
+# Copyright (C) 2017 Jiri Slachta
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=kamailio
+PKG_VERSION:=5.4.2
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src
+PKG_SOURCE:=kamailio-$(PKG_VERSION)_src.tar.gz
+PKG_HASH:=e710824d6810d3053ec79a39ee532c51bb91738a07f16c3a103aa07e0f8b80b5
+PKG_USE_MIPS16:=0
+
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
+
+PKG_INSTALL:=1
+
+PKG_BUILD_PARALLEL:=1
+
+MODULES_AVAILABLE:= \
+ acc \
+ acc_diameter \
+ acc_json \
+ alias_db \
+ app_jsdt \
+ app_lua \
+ app_lua_sr \
+ app_python3 \
+ app_ruby \
+ app_sqlang \
+ async \
+ auth \
+ auth_db \
+ auth_diameter \
+ auth_ephemeral \
+ auth_identity \
+ auth_xkeys \
+ avp \
+ avpops \
+ benchmark \
+ blst \
+ call_control \
+ call_obj \
+ carrierroute \
+ cdp \
+ cdp_avp \
+ cfgutils \
+ cfg_db \
+ cfg_rpc \
+ cfgt \
+ cnxcc \
+ corex \
+ counters \
+ cplc \
+ crypto \
+ ctl \
+ db2_ldap \
+ db2_ops \
+ db_berkeley \
+ db_cluster \
+ db_flatstore \
+ db_mysql \
+ db_postgres \
+ db_redis \
+ db_sqlite \
+ db_text \
+ db_unixodbc \
+ debugger \
+ dialog \
+ dialplan \
+ dispatcher \
+ diversion \
+ dlgs \
+ dmq \
+ dmq_usrloc \
+ domain \
+ domainpolicy \
+ drouting \
+ enum \
+ erlang \
+ evapi \
+ evrexec \
+ exec \
+ group \
+ gzcompress \
+ h350 \
+ htable \
+ http_client \
+ imc \
+ ims_auth \
+ ims_charging \
+ ims_dialog \
+ ims_diameter_server \
+ ims_icscf \
+ ims_ipsec_pcscf \
+ ims_isc \
+ ims_ocs \
+ ims_qos \
+ ims_registrar_pcscf \
+ ims_registrar_scscf \
+ ims_usrloc_pcscf \
+ ims_usrloc_scscf \
+ ipops \
+ jansson \
+ janssonrpcc \
+ json \
+ jsonrpcs \
+ keepalive \
+ kemix \
+ kex \
+ lcr \
+ ldap \
+ log_custom \
+ lost \
+ mangler \
+ matrix \
+ maxfwd \
+ mediaproxy \
+ mohqueue \
+ mqueue \
+ msilo \
+ msrp \
+ mtree \
+ nathelper \
+ nat_traversal \
+ ndb_redis \
+ nosip \
+ outbound \
+ p_usrloc \
+ path \
+ pdb \
+ pdt \
+ permissions \
+ pike \
+ pipelimit \
+ prefix_route \
+ presence \
+ presence_conference \
+ presence_dialoginfo \
+ presence_mwi \
+ presence_profile \
+ presence_reginfo \
+ presence_xml \
+ pua \
+ pua_bla \
+ pua_dialoginfo \
+ pua_json \
+ pua_reginfo \
+ pua_rpc \
+ pua_usrloc \
+ pua_xmpp \
+ pv \
+ pv_headers \
+ qos \
+ ratelimit \
+ regex \
+ registrar \
+ rls \
+ rr \
+ rtimer \
+ rtjson \
+ rtpengine \
+ rtpproxy \
+ sanity \
+ sca \
+ sctp \
+ sdpops \
+ seas \
+ secfilter \
+ sipcapture \
+ sipdump \
+ sipt \
+ siptrace \
+ siputils \
+ sl \
+ sms \
+ smsops \
+ snmpstats \
+ speeddial \
+ sqlops \
+ ss7ops \
+ statistics \
+ statsc \
+ statsd \
+ stun \
+ sst \
+ tcpops \
+ textops \
+ textopsx \
+ timer \
+ tls \
+ tmrec \
+ topoh \
+ topos \
+ topos_redis \
+ tm \
+ tmx \
+ tsilo \
+ uac \
+ uac_redirect \
+ uid_auth_db \
+ uid_avp_db \
+ uid_domain \
+ uid_gflags \
+ uid_uri_db \
+ uri_db \
+ userblacklist \
+ usrloc \
+ utils \
+ uuid \
+ websocket \
+ xcap_client \
+ xcap_server \
+ xhttp \
+ xhttp_pi \
+ xhttp_prom \
+ xhttp_rpc \
+ xlog \
+ xmlops \
+ xmlrpc \
+ xmpp \
+ xprint
+
+PKG_CONFIG_DEPENDS:= \
+ $(patsubst %,CONFIG_PACKAGE_kamailio-mod-%,$(subst _,-,$(MODULES_AVAILABLE)))
+
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/package.mk
+include $(TOPDIR)/feeds/packages/lang/python/python3-version.mk
+
+# Build reproducibly
+TARGET_CFLAGS += -DVERSION_NODATE=1
+
+PREBUILT_STAMP=$(STAGING_DIR)/stamp/.kamailio_prebuilt
+TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS)
+
+INCL_MODULES:=
+
+define Package/kamailio/Default
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Telephony
+ URL:=http://www.kamailio.org/
+ DEPENDS:=$(ICONV_DEPENDS) +libncurses +libpthread +libreadline +libxml2
+endef
+
+define Package/kamailio
+$(call Package/kamailio/Default)
+ TITLE:=Mature and flexible open source SIP server, v$(PKG_VERSION)
+ USERID:=kamailio=380:kamailio=380
+ MENU:=1
+endef
+
+define Package/kamailio/conffiles
+/etc/config/kamailio
+/etc/init.d/kamailio
+/etc/kamailio/kamailio.cfg
+/etc/kamailio/kamctlrc
+endef
+
+define Package/kamailio/install
+$(foreach c,kamailio.cfg kamctlrc,$(call Package/kamailio/install/conffile,$(1),$(c));)
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/sbin/kam{ailio,cmd,ctl,dbctl} \
+ $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/kamailio/lib{srdb1,srdb2}.so* \
+ $(1)/usr/lib/kamailio/
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) \
+ ./files/kamailio.conf \
+ $(1)/etc/config/kamailio
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) \
+ ./files/kamailio.init \
+ $(1)/etc/init.d/kamailio
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+ $(INSTALL_BIN) \
+ ./files/kamailio.hotplug \
+ $(1)/etc/hotplug.d/iface/99-kamailio
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/kamailio/kamctl \
+ $(1)/usr/lib/kamailio/
+endef
+
+define Package/kamailio/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ echo
+ echo "o-------------------------------------------------------------------o"
+ echo "| Kamailio note |"
+ echo "o-------------------------------------------------------------------o"
+ echo "| Edit /etc/config/kamailio to change basic init configuration. |"
+ echo "o-------------------------------------------------------------=^_^=-o"
+ echo
+fi
+exit 0
+endef
+
+define Package/kamailio/install/conffile
+ $(INSTALL_DIR) $(1)/etc/kamailio
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/kamailio/$(2) $(1)/etc/kamailio
+endef
+
+define Package/kamailio/install/dbfiles
+ $(INSTALL_DIR) $(1)/usr/share/kamailio/$(2)
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/kamailio/$(2)/* $(1)/usr/share/kamailio/$(2)/
+endef
+
+define Package/kamailio/install/module
+ $(INSTALL_DIR) $(1)/usr/lib/kamailio/modules
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/kamailio/modules/$(2).so* $(1)/usr/lib/kamailio/modules/
+endef
+
+define Package/kamailio-lib-libkamailio-ims
+$(call Package/kamailio/Default)
+ TITLE:=Kamailio IMS library
+ DEPENDS:=kamailio
+endef
+
+define Package/kamailio-lib-libkamailio-ims/install
+ $(INSTALL_DIR) $(1)/usr/lib/kamailio
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/kamailio/libkamailio_ims.so* \
+ $(1)/usr/lib/kamailio
+endef
+
+define Package/kamailio-lib-libtrie
+$(call Package/kamailio/Default)
+ TITLE:=Kamailio digital tree library
+ DEPENDS:=kamailio
+endef
+
+define Package/kamailio-lib-libtrie/install
+ $(INSTALL_DIR) $(1)/usr/lib/kamailio
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/kamailio/libtrie.so* \
+ $(1)/usr/lib/kamailio
+endef
+
+define Package/kamailio-util-kambdb-recover
+$(call Package/kamailio/Default)
+ TITLE:=Kamailio Berkeley DB recovery utility
+ DEPENDS:=kamailio +PACKAGE_kamailio-util-kambdb-recover:kamailio-mod-db-berkeley
+endef
+
+define Package/kamailio-util-kambdb-recover/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kambdb_recover $(1)/usr/sbin
+endef
+
+define BuildKamailioModule
+ define Package/kamailio-mod-$(subst _,-,$(1))
+ $$(call Package/kamailio/Default)
+ TITLE:=$(2) for Kamailio
+ DEPENDS:=kamailio $(patsubst +%,+PACKAGE_kamailio-mod-$(subst _,-,$(1)):%,$(4))
+ ifneq ($$(CONFIG_PACKAGE_kamailio-mod-$(subst _,-,$(1))),)
+ INCL_MODULES+=$(1)
+ endif
+ endef
+ define Package/kamailio-mod-$(subst _,-,$(1))/conffiles
+$(subst $(space),$(newline),$(foreach c,$(6),/etc/kamailio/$(c)))
+ endef
+ define Package/kamailio-mod-$(subst _,-,$(1))/install
+$(call Package/kamailio/install/module,$$(1),$(1))
+$(foreach c,$(6),$(call Package/kamailio/install/conffile,$$(1),$(c));)
+$(foreach d,$(5),$(call Package/kamailio/install/dbfiles,$$(1),$(d));)
+ ifeq ($(1),snmpstats)
+ $(INSTALL_DIR) $$(1)/usr/share/snmp/mibs
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/snmp/mibs/* \
+ $$(1)/usr/share/snmp/mibs
+ endif
+ endef
+$$(eval $$(call BuildPackage,kamailio-mod-$(subst _,-,$(1))))
+endef
+
+# Kamailio always builds a baseline of packages. The "standard" group is
+# the lightest baseline.
+
+# "uid_gflags" is added to the list of modules to have at least one
+# module that kicks off the build of the internal libsrdb2. The module
+# has no other extra dependencies.
+#
+# The same is done with:
+# "ims_diameter_server" -> libkamailio_ims
+# "carrierroute" -> libtrie
+
+EXTRA_MODULES:= \
+ $(if $(CONFIG_PACKAGE_kamailio-mod-carrierroute),,carrierroute) \
+ $(if $(CONFIG_PACKAGE_kamailio-mod-ims-diameter-server),,ims_diameter_server) \
+ $(if $(CONFIG_PACKAGE_kamailio-mod-uid-gflags),,uid_gflags)
+
+# MIPS tweak:
+#
+# Kamailio enables use of fast inline assembly locks when ARCH is set to
+# "mips2". When ARCH is set to "mips" instead, Kamailio assumes it is dealing
+# with an old 32-bit MIPS CPU without hardware locking support (like R3000).
+#
+# When CONFIG_CPU_TYPE matches one of the identifiers in the list below, set
+# ARCH to "mips2" to get FAST_LOCK support.
+ifeq ($(call qstrip,$(CONFIG_ARCH)),mips)
+CPU_MIPS2:=mips32 24kc 34kc 4kec 74kc
+endif
+
+MAKE_FLAGS += \
+ $(if $(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_MIPS2)),ARCH="mips2",ARCH="$(ARCH)") \
+ CC_EXTRA_OPTS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ LD="$(TARGET_CC)" \
+ LD_EXTRA_OPTS="$(TARGET_LDFLAGS)" \
+ LIBDIR=lib \
+ PREFIX=/usr \
+ cfg_prefix="$(PKG_INSTALL_DIR)" \
+ cfg_target=/etc/kamailio \
+ group_include="standard" \
+ include_modules="$$(INCL_MODULES) $(EXTRA_MODULES)" \
+ quiet=verbose \
+ run_prefix=""
+
+MAKE_VARS += \
+ PYTHON3=python$(PYTHON3_VERSION)
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ # Upstream adds "-funroll-loops" to compiler flags, which increases
+ # binary size significantly. Remove this flag.
+ $(SED) 's/[ ]*-funroll-loops//' $(PKG_BUILD_DIR)/src/Makefile.defs
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(call Build/Compile/Default,cfg)
+ $(call Build/Compile/Default,all)
+endef
+
+$(eval $(call BuildPackage,kamailio))
+$(eval $(call BuildPackage,kamailio-lib-libkamailio-ims))
+$(eval $(call BuildPackage,kamailio-lib-libtrie))
+$(eval $(call BuildPackage,kamailio-util-kambdb-recover))
+
+################################
+# Kamailio module parameters
+# Params:
+# 1 - Module name
+# 2 - Module title
+# 3 - Module description
+# 4 - Dependencies
+# 5 - Kamailio DB files
+# 6 - Configuration files
+################################
+
+$(eval $(call BuildKamailioModule,acc,Accounting,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,acc_diameter,Accounting for DIAMETER backend,,+kamailio-mod-acc))
+$(eval $(call BuildKamailioModule,acc_json,Accounting with records exported in JSON format,,+jansson +kamailio-mod-acc))
+$(eval $(call BuildKamailioModule,alias_db,Database-backend aliases,,))
+$(eval $(call BuildKamailioModule,app_jsdt,Execute JavaScript scripts,,))
+$(eval $(call BuildKamailioModule,app_lua,Execute embedded Lua scripts,,+liblua))
+$(eval $(call BuildKamailioModule,app_lua_sr,Old Lua API,,+kamailio-mod-app-lua,))
+$(eval $(call BuildKamailioModule,app_python3,Python3 scripting interpreter,,+python3-light))
+$(eval $(call BuildKamailioModule,app_ruby,Ruby scripting interpreter,,+libruby))
+$(eval $(call BuildKamailioModule,app_sqlang,Execute Squirrel language scripts,,+libstdcpp))
+$(eval $(call BuildKamailioModule,async,Asynchronous SIP handling functions,,+kamailio-mod-tm +kamailio-mod-tmx))
+$(eval $(call BuildKamailioModule,auth,Authentication Framework,,))
+$(eval $(call BuildKamailioModule,auth_db,Database-backend authentication,,+kamailio-mod-auth))
+$(eval $(call BuildKamailioModule,auth_diameter,Diameter authentication,,+kamailio-mod-sl))
+$(eval $(call BuildKamailioModule,auth_ephemeral,Ephemeral credentials,,+libopenssl))
+$(eval $(call BuildKamailioModule,auth_identity,Identity authentication,,+libopenssl +libcurl))
+$(eval $(call BuildKamailioModule,auth_xkeys,Shared-key authentication,,+kamailio-mod-auth))
+$(eval $(call BuildKamailioModule,avp,Functions for handling AVPs,,))
+$(eval $(call BuildKamailioModule,avpops,AVP operation,,))
+$(eval $(call BuildKamailioModule,benchmark,Config benchmark,,))
+$(eval $(call BuildKamailioModule,blst,Blacklisting API for config,,))
+$(eval $(call BuildKamailioModule,call_control,Call Control,,+kamailio-mod-dialog +kamailio-mod-pv))
+$(eval $(call BuildKamailioModule,call_obj,Call identification support,,))
+$(eval $(call BuildKamailioModule,carrierroute,Carrier Route,,+kamailio-lib-libtrie))
+$(eval $(call BuildKamailioModule,cdp,C Diameter Peer,,))
+$(eval $(call BuildKamailioModule,cdp_avp,CDP AVP helper module,,+kamailio-mod-cdp))
+$(eval $(call BuildKamailioModule,cfgutils,Config utilities,,))
+$(eval $(call BuildKamailioModule,cfg_db,Load parameters from database,,))
+$(eval $(call BuildKamailioModule,cfg_rpc,Update parameters via RPC,,))
+$(eval $(call BuildKamailioModule,cfgt,Unit test reporting,,))
+$(eval $(call BuildKamailioModule,cnxcc,Limit call duration,,+kamailio-mod-dialog +libhiredis +libevent2))
+$(eval $(call BuildKamailioModule,corex,Legacy functions,,))
+$(eval $(call BuildKamailioModule,counters,Functions for counter manipulation,,))
+$(eval $(call BuildKamailioModule,cplc,Call Processing Language interpreter,,+kamailio-mod-sl +kamailio-mod-tm +kamailio-mod-usrloc))
+$(eval $(call BuildKamailioModule,crypto,Various cryptography tools,,+libopenssl))
+$(eval $(call BuildKamailioModule,ctl,BINRPC transport interface,,))
+$(eval $(call BuildKamailioModule,db2_ldap,DBv2 LDAP module,,+libopenldap))
+$(eval $(call BuildKamailioModule,db2_ops,Run SQL queries from script,,))
+$(eval $(call BuildKamailioModule,db_berkeley,Berkeley DB backend,,+libdb47))
+$(eval $(call BuildKamailioModule,db_cluster,Database clustering system,,))
+$(eval $(call BuildKamailioModule,db_flatstore,fast write-only text DB-backend,,))
+$(eval $(call BuildKamailioModule,db_mysql,MySQL DB-backend,,+libmysqlclient,mysql))
+$(eval $(call BuildKamailioModule,db_postgres,PostgreSQL DB-backend,,+libpq,postgres))
+$(eval $(call BuildKamailioModule,db_redis,Database backend with Redis server,,+libhiredis,db_redis))
+$(eval $(call BuildKamailioModule,db_sqlite,SQLite DB-backend,,+libsqlite3,db_sqlite))
+$(eval $(call BuildKamailioModule,db_text,Text DB-backend,,,dbtext/kamailio))
+$(eval $(call BuildKamailioModule,db_unixodbc,UnixODBC DB-backend,,+unixodbc))
+$(eval $(call BuildKamailioModule,debugger,Interactive config file debugger,,))
+$(eval $(call BuildKamailioModule,dialog,Dialog support,,+kamailio-mod-rr +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,dialplan,Dialplan management,,+libpcre))
+$(eval $(call BuildKamailioModule,dispatcher,Dispatcher,,))
+$(eval $(call BuildKamailioModule,diversion,Diversion header insertion,,))
+$(eval $(call BuildKamailioModule,dlgs,Track active calls in stateless mode,,))
+$(eval $(call BuildKamailioModule,dmq,Distributed Message Queue,,+kamailio-mod-sl +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,dmq_usrloc,DMQ USRLOC replication,,+kamailio-mod-dmq +kamailio-mod-usrloc))
+$(eval $(call BuildKamailioModule,domain,Multi-domain support,,))
+$(eval $(call BuildKamailioModule,domainpolicy,Domain policy,,))
+$(eval $(call BuildKamailioModule,drouting,Dynamic routing module,,))
+$(eval $(call BuildKamailioModule,enum,ENUM lookup,,))
+$(eval $(call BuildKamailioModule,erlang,Erlang node connector module,,@!USE_MUSL +erlang))
+$(eval $(call BuildKamailioModule,evapi,push event details via tcp,,+libev))
+$(eval $(call BuildKamailioModule,evrexec,Execut event routes at startup,,))
+$(eval $(call BuildKamailioModule,exec,External exec,,))
+$(eval $(call BuildKamailioModule,group,Database-backend user-groups,,))
+$(eval $(call BuildKamailioModule,gzcompress,Compress SIP messages,,+zlib))
+$(eval $(call BuildKamailioModule,h350,H.350,,+kamailio-mod-ldap +libopenldap))
+$(eval $(call BuildKamailioModule,htable,Hash Table,,))
+$(eval $(call BuildKamailioModule,http_client,HTTP client using CURL,,+libcurl))
+$(eval $(call BuildKamailioModule,imc,IM conferencing,,+kamailio-mod-db-mysql +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_auth,IMS authentication module,,+kamailio-lib-libkamailio-ims +kamailio-mod-cdp +kamailio-mod-cdp-avp +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_charging,IMS charging component module,,+kamailio-lib-libkamailio-ims +kamailio-mod-cdp +kamailio-mod-cdp-avp +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_dialog,IMS dialog tracking module,,+kamailio-mod-rr +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_diameter_server,IMS DIAMETER server module,,+kamailio-lib-libkamailio-ims +kamailio-mod-cdp +kamailio-mod-cdp-avp))
+$(eval $(call BuildKamailioModule,ims_icscf,IMS ICSCF component module,,+kamailio-lib-libkamailio-ims +kamailio-mod-cdp +kamailio-mod-cdp-avp +kamailio-mod-sl +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_ipsec_pcscf,Diameter server implementation,,+kamailio-lib-libkamailio-ims +kamailio-mod-ims-usrloc-pcscf +kamailio-mod-tm +libmnl))
+$(eval $(call BuildKamailioModule,ims_isc,IMS ISC component module,,+kamailio-lib-libkamailio-ims +kamailio-mod-ims-usrloc-scscf +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_ocs,MS OCS component module,,+kamailio-lib-libkamailio-ims +kamailio-mod-cdp +kamailio-mod-cdp-avp))
+$(eval $(call BuildKamailioModule,ims_qos,IMS Diameter Rx interface between PCSCF and PCRF functions,,+kamailio-lib-libkamailio-ims +kamailio-mod-cdp +kamailio-mod-cdp-avp +kamailio-mod-ims-dialog +kamailio-mod-ims-usrloc-pcscf +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_registrar_pcscf,MS PCSCF registrar module,,+kamailio-lib-libkamailio-ims +kamailio-mod-ims-usrloc-pcscf))
+$(eval $(call BuildKamailioModule,ims_registrar_scscf,IMS SCSCF registrar module,,+kamailio-lib-libkamailio-ims +kamailio-mod-cdp +kamailio-mod-cdp-avp +kamailio-mod-ims-usrloc-scscf +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ims_usrloc_pcscf,IMS PCSCF usrloc module,,))
+$(eval $(call BuildKamailioModule,ims_usrloc_scscf,IMS SCSCF usrloc module,,))
+$(eval $(call BuildKamailioModule,ipops,IP and IPv6 operations,,))
+$(eval $(call BuildKamailioModule,jansson,Access to JSON attributes,,+jansson))
+$(eval $(call BuildKamailioModule,janssonrpcc,Alternative JSONRPC server,,+kamailio-mod-jansson +libevent2))
+$(eval $(call BuildKamailioModule,json,Access to JSON document attributes,,+libjson-c))
+$(eval $(call BuildKamailioModule,jsonrpcs,JSONRPC server over HTTP,,+libevent2))
+$(eval $(call BuildKamailioModule,keepalive,SIP keepalive monitoring,+kamailio-mod-tm,))
+$(eval $(call BuildKamailioModule,kemix,KEMI extensions,,,))
+$(eval $(call BuildKamailioModule,kex,Core extensions,,))
+$(eval $(call BuildKamailioModule,lcr,Least Cost Routing,,+kamailio-mod-tm +libpcre))
+$(eval $(call BuildKamailioModule,ldap,LDAP connector,,+libopenldap))
+$(eval $(call BuildKamailioModule,log_custom,Logging to custom backends,,))
+$(eval $(call BuildKamailioModule,lost,HELD and LOST routing,,+kamailio-mod-http-client,))
+$(eval $(call BuildKamailioModule,mangler,SDP mangling,,))
+$(eval $(call BuildKamailioModule,matrix,Matrix operations,,))
+$(eval $(call BuildKamailioModule,maxfwd,Max-Forward processor,,))
+$(eval $(call BuildKamailioModule,mediaproxy,Automatic NAT traversal,,+kamailio-mod-dialog))
+$(eval $(call BuildKamailioModule,mohqueue,Music on hold queuing system,,+kamailio-mod-rtpproxy +kamailio-mod-sl +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,mqueue,Generic message queue system,,))
+$(eval $(call BuildKamailioModule,msilo,SIP message silo,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,msrp,MSRP routing engine,,+kamailio-mod-tls))
+$(eval $(call BuildKamailioModule,mtree,Memory caching system,,))
+$(eval $(call BuildKamailioModule,nathelper,NAT helper,,+kamailio-mod-usrloc))
+$(eval $(call BuildKamailioModule,nat_traversal,NAT traversal,,+kamailio-mod-dialog +kamailio-mod-sl +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,ndb_redis,Connect to REDIS NoSQL,,+libhiredis))
+$(eval $(call BuildKamailioModule,nosip,non-sip package handling,,+kamailio-mod-rr))
+$(eval $(call BuildKamailioModule,outbound,SIP Outbound implementation,,+kamailio-mod-stun +libopenssl))
+$(eval $(call BuildKamailioModule,p_usrloc,Partitioned USRLOC services,,))
+$(eval $(call BuildKamailioModule,path,SIP path insertion,,+kamailio-mod-rr))
+$(eval $(call BuildKamailioModule,pdb,Number portability module,,))
+$(eval $(call BuildKamailioModule,pdt,Prefix-to-Domain translator,,))
+$(eval $(call BuildKamailioModule,permissions,Permissions control,,))
+$(eval $(call BuildKamailioModule,pike,Flood detector,,))
+$(eval $(call BuildKamailioModule,pipelimit,Traffic shaping policies,,+kamailio-mod-sl))
+$(eval $(call BuildKamailioModule,prefix_route,Execute based on prefix,,))
+$(eval $(call BuildKamailioModule,presence,Presence server,,+kamailio-mod-sl +kamailio-mod-tm,))
+$(eval $(call BuildKamailioModule,presence_conference,Conference events,,+kamailio-mod-presence))
+$(eval $(call BuildKamailioModule,presence_dialoginfo,Dialog Event presence,,+kamailio-mod-presence))
+$(eval $(call BuildKamailioModule,presence_mwi,MWI presence,,+kamailio-mod-presence))
+$(eval $(call BuildKamailioModule,presence_profile,User profile extensions,,+kamailio-mod-presence))
+$(eval $(call BuildKamailioModule,presence_reginfo,Registration info,,+kamailio-mod-presence))
+$(eval $(call BuildKamailioModule,presence_xml,XCAP presence,,+kamailio-mod-presence +kamailio-mod-xcap-client))
+$(eval $(call BuildKamailioModule,pua,Presence User Agent,,+kamailio-mod-tm,))
+$(eval $(call BuildKamailioModule,pua_bla,Bridged Line Appearence PUA,,+kamailio-mod-presence +kamailio-mod-pua +kamailio-mod-usrloc))
+$(eval $(call BuildKamailioModule,pua_dialoginfo,Dialog Event PUA,,+kamailio-mod-dialog +kamailio-mod-pua))
+$(eval $(call BuildKamailioModule,pua_json,Presence user agent implementation with JSON messages,,+libjson-c))
+$(eval $(call BuildKamailioModule,pua_reginfo,PUA registration info,,+kamailio-mod-pua +kamailio-mod-usrloc))
+$(eval $(call BuildKamailioModule,pua_rpc,RPC extensions for PUA,,+kamailio-mod-pua))
+$(eval $(call BuildKamailioModule,pua_usrloc,PUA User Location,,+kamailio-mod-pua +kamailio-mod-usrloc))
+$(eval $(call BuildKamailioModule,pua_xmpp,PUA XMPP,,+kamailio-mod-presence +kamailio-mod-pua +kamailio-mod-xmpp))
+$(eval $(call BuildKamailioModule,pv,Pseudo-Variables,,))
+$(eval $(call BuildKamailioModule,pv_headers,Flexible SIP header management,,))
+$(eval $(call BuildKamailioModule,qos,QoS control,,+kamailio-mod-dialog))
+$(eval $(call BuildKamailioModule,ratelimit,Traffic shapping,,))
+$(eval $(call BuildKamailioModule,regex,Regular Expression,,+libpcre))
+$(eval $(call BuildKamailioModule,registrar,SIP Registrar,,+kamailio-mod-usrloc))
+$(eval $(call BuildKamailioModule,rls,Resource List Server,,+kamailio-mod-presence +kamailio-mod-pua +kamailio-mod-tm,))
+$(eval $(call BuildKamailioModule,rr,Record-Route and Route,,))
+$(eval $(call BuildKamailioModule,rtimer,Routing Timer,,))
+$(eval $(call BuildKamailioModule,rtjson,SIP routing based on JSON API,,))
+$(eval $(call BuildKamailioModule,rtpengine,RTP engine,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,rtpproxy,RTP proxy,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,sanity,SIP sanity checks,,+kamailio-mod-sl))
+$(eval $(call BuildKamailioModule,sca,Shared Call Appearances,,+kamailio-mod-sl +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,sctp,SCTP support,,+libsctp))
+$(eval $(call BuildKamailioModule,sdpops,Managing SDP payloads,,))
+$(eval $(call BuildKamailioModule,seas,Sip Express Application Server,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,secfilter,Allow/block filters,,,))
+$(eval $(call BuildKamailioModule,sipcapture,SIP capture,,))
+$(eval $(call BuildKamailioModule,sipdump,Save SIP traffic,,))
+$(eval $(call BuildKamailioModule,sipt,SIP-T and SIP-I operations,,))
+$(eval $(call BuildKamailioModule,siptrace,SIP trace,,))
+$(eval $(call BuildKamailioModule,siputils,SIP utilities,,+kamailio-mod-sl))
+$(eval $(call BuildKamailioModule,sl,Stateless replier,,))
+$(eval $(call BuildKamailioModule,sms,SIP-to-SMS IM gateway,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,smsops,Handle SMS packets in SIP,,))
+$(eval $(call BuildKamailioModule,snmpstats,SNMP interface for statistics,,+libnetsnmp))
+$(eval $(call BuildKamailioModule,speeddial,Per-user speed-dial controller,,))
+$(eval $(call BuildKamailioModule,sqlops,SQL operations,,))
+$(eval $(call BuildKamailioModule,ss7ops,JSON Operations for SS7 over HEP,,))
+$(eval $(call BuildKamailioModule,statistics,Script statistics,,))
+$(eval $(call BuildKamailioModule,statsc,Statistics collector,,))
+$(eval $(call BuildKamailioModule,statsd,Connector for statsd application,,))
+$(eval $(call BuildKamailioModule,stun,STUN server support,,))
+$(eval $(call BuildKamailioModule,sst,SIP Session Timer,,+kamailio-mod-dialog +kamailio-mod-sl))
+$(eval $(call BuildKamailioModule,tcpops,TCP options tweaking operations,,))
+$(eval $(call BuildKamailioModule,textops,Text operations,,))
+$(eval $(call BuildKamailioModule,textopsx,Extra text operations,,))
+$(eval $(call BuildKamailioModule,timer,Execute routing blocks on core timers,,))
+$(eval $(call BuildKamailioModule,tls,TLS operations,,+libopenssl,,tls.cfg))
+$(eval $(call BuildKamailioModule,tmrec,Match time recurrences,,))
+$(eval $(call BuildKamailioModule,topoh,Topology hiding,,+kamailio-mod-rr))
+$(eval $(call BuildKamailioModule,topos,Topology stripping module,,+kamailio-mod-rr))
+$(eval $(call BuildKamailioModule,topos_redis,Redis backend for topos module,,+kamailio-mod-ndb-redis +kamailio-mod-topos))
+$(eval $(call BuildKamailioModule,tm,Transaction,,))
+$(eval $(call BuildKamailioModule,tmx,Transaction module extensions,,))
+$(eval $(call BuildKamailioModule,tsilo,Transaction storage,,+kamailio-mod-registrar +kamailio-mod-sl +kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,uac,User Agent Client,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,uac_redirect,User Agent Client redirection,,+kamailio-mod-tm))
+$(eval $(call BuildKamailioModule,uid_auth_db,Authentication module,,+kamailio-mod-auth))
+$(eval $(call BuildKamailioModule,uid_avp_db,AVP database operations,,))
+$(eval $(call BuildKamailioModule,uid_domain,Domains management,,))
+$(eval $(call BuildKamailioModule,uid_gflags,Global attributes and flags,,))
+$(eval $(call BuildKamailioModule,uid_uri_db,Database URI operations,,))
+$(eval $(call BuildKamailioModule,uri_db,Database-backend SIP URI checking,,))
+$(eval $(call BuildKamailioModule,userblacklist,User blacklists,,+kamailio-lib-libtrie))
+$(eval $(call BuildKamailioModule,usrloc,User location,,))
+$(eval $(call BuildKamailioModule,utils,Misc utilities,,+libcurl,))
+$(eval $(call BuildKamailioModule,uuid,UUID utilities,,+libuuid))
+$(eval $(call BuildKamailioModule,websocket,WebSocket transport layer,,+kamailio-mod-sl +kamailio-mod-tm +libopenssl +libunistring))
+$(eval $(call BuildKamailioModule,xcap_client,XCAP Client,,+libcurl))
+$(eval $(call BuildKamailioModule,xcap_server,XCAP server implementation,,+kamailio-mod-xhttp +kamailio-mod-sl))
+$(eval $(call BuildKamailioModule,xhttp,Basic HTTP request handling server,,+kamailio-mod-sl))
+$(eval $(call BuildKamailioModule,xhttp_pi,HTTP provisioning interface,,+kamailio-mod-xhttp,xhttp_pi,pi_framework.xml))
+$(eval $(call BuildKamailioModule,xhttp_prom,Prometheus metrics,,+kamailio-mod-xhttp,))
+$(eval $(call BuildKamailioModule,xhttp_rpc,RPC commands handling over HTTP,,+kamailio-mod-xhttp))
+$(eval $(call BuildKamailioModule,xlog,Advanced logger,,))
+$(eval $(call BuildKamailioModule,xmlops,XML operations,,))
+$(eval $(call BuildKamailioModule,xmlrpc,XML RPC module,,,))
+$(eval $(call BuildKamailioModule,xmpp,SIP-to-XMPP Gateway,,+kamailio-mod-tm +libexpat))
+$(eval $(call BuildKamailioModule,xprint,Print messages with specifiers,,))
--- /dev/null
+
+config kamailio 'general'
+ option enabled 0
+ option user kamailio
+ option group kamailio
+ # Amount of shared and private memory to allocate in MByte:
+ option shm_memory 8
+ option pkg_memory 2
+ option cfg_file /etc/kamailio/kamailio.cfg
+ # The lists "listen" and "listen6" basically have the same
+ # effect - each list entry will be added to the Kamailio command
+ # line ("-l address"). However, the init script will try to
+ # resolve any interface specifier into an IPv4 ("listen") or
+ # IPv6 ("listen6") address before starting Kamailio. These lists
+ # may be helpful when using dynamic IPs.
+ #list listen udp:wan:5060
+ #list listen udp:192.168.1.1:5060
+ #list listen6 udp:wan:5060
+ # Any other option can be put between the quotes below:
+ #option options ""
+
+config kamailio 'hotplug'
+ # Uncomment to enable hotplug:
+ #option interface 'wan'
+
--- /dev/null
+#!/bin/sh
+
+[ "$ACTION" = ifup ] || exit 0
+
+NAME=kamailio
+COMMAND=/etc/init.d/$NAME
+LOGGER="/usr/bin/logger -t hotplug"
+
+$COMMAND enabled || exit 0
+
+. /lib/functions.sh
+
+config_load $NAME
+
+config_get_bool enabled general enabled 0
+[ $enabled -eq 0 ] && exit 0
+
+config_get hotplug_iface hotplug interface
+
+[ "$INTERFACE" = "$hotplug_iface" ] && {
+ $LOGGER "Restarting $NAME due to \"$ACTION\" of \"$INTERFACE\""
+ $COMMAND restart
+}
+
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 - 2018 OpenWrt.org
+
+START=99
+
+NAME=kamailio
+COMMAND=/usr/sbin/$NAME
+
+RUNDIR=/var/run/$NAME
+PIDFILE=$RUNDIR/$NAME.pid
+
+LOG_ERR="/usr/bin/logger -p user.err -s -t $NAME"
+
+USE_PROCD=1
+
+#PROCD_DEBUG=1
+
+check_listen() {
+ local value="$1"
+ local type="$2"
+
+ local address
+ local has_proto=0
+ local one two three
+ local tmp
+
+ [ -z "$value" ] && {
+ $LOG_ERR empty $type entry
+ exit 1
+ }
+
+ # IPv6 addresses need to be enclosed in square brackets. If there are
+ # square brackets in the listen entry, just copy it.
+ echo "$value" | grep "\[[0-9:A-Fa-f]*\]" &> /dev/null && {
+ options=$options" -l $value"
+ return
+ }
+
+ # Bail if more than 2 colons.
+ [ $(echo "$value" | awk -F ":" '{print NF-1}') -gt 2 ] && {
+ $LOG_ERR init script does not understand $type entry \""$value"\"
+ exit 1
+ }
+
+ IFS=":" read one two three << EOF
+$value
+EOF
+
+ case "$one" in
+ udp|tcp|tls|sctp)
+ tmp="$two"
+ has_proto=1
+ ;;
+ *)
+ tmp="$one"
+ ;;
+ esac
+
+ if [ "$type" = "listen" ]; then
+ network_get_ipaddr address "$tmp" || address="$tmp"
+ else
+ network_get_ipaddr6 address "$tmp" && address="[$address]" || \
+ address="$tmp"
+ fi
+
+ if [ -n "$three" ]; then
+ tmp="$one:$address:$three"
+ elif [ -n "$two" ]; then
+ if [ $has_proto = 1 ]; then
+ tmp="$one:$address"
+ else
+ tmp="$address:$two"
+ fi
+ else
+ tmp="$address"
+ fi
+
+ options=$options" -l $tmp"
+}
+
+start_service() {
+ local enabled
+ local user
+ local group
+ local shm_memory
+ local pkg_memory
+ local cfg_file
+ local options
+
+ config_load $NAME
+
+ config_get_bool enabled general enabled 0
+
+ if [ $enabled -eq 0 ]; then
+ $LOG_ERR service not enabled in /etc/config/$NAME
+ exit 1
+ fi
+
+ config_get user general user $NAME
+ config_get group general group $NAME
+ config_get shm_memory general shm_memory 8
+ config_get pkg_memory general pkg_memory 2
+ config_get cfg_file general cfg_file /etc/$NAME/$NAME.cfg
+ config_get options general options
+
+ . /lib/functions/network.sh
+
+ config_list_foreach general listen check_listen listen
+ config_list_foreach general listen6 check_listen listen6
+
+ if [ ! -d $RUNDIR ]; then
+ mkdir -p $RUNDIR
+ chown "$user":"$group" $RUNDIR
+ fi
+
+ procd_open_instance
+ procd_set_param command $COMMAND
+ procd_append_param command \
+ -P $PIDFILE \
+ -f "$cfg_file" \
+ -m "$shm_memory" \
+ -M "$pkg_memory" \
+ $options \
+ -u "$user" \
+ -g "$group" \
+ -DD -E
+ # forward stderr to logd
+ procd_set_param stderr 1
+ procd_close_instance
+}
+
--- /dev/null
+--- a/utils/kamctl/kamctlrc
++++ b/utils/kamctl/kamctlrc
+@@ -162,3 +162,6 @@
+ ## Extra start options - default is: not set
+ ## example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"
+ # STARTOPTIONS=
++
++# Disable colour printing in terminal
++NOHLPRINT=1
--- /dev/null
+--- a/src/modules/janssonrpcc/netstring.h
++++ b/src/modules/janssonrpcc/netstring.h
+@@ -24,6 +24,7 @@
+ #define __NETSTRING_STREAM_H
+
+ #include <string.h>
++#include <event2/buffer.h>
+ #include <event2/bufferevent.h>
+
+ typedef struct {
--- /dev/null
+--- a/src/modules/snmpstats/Makefile
++++ b/src/modules/snmpstats/Makefile
+@@ -16,7 +16,7 @@ ifeq ($(BUILDER),)
+ INSTALLMIBDIR = $(share_prefix)/share/snmp/mibs
+ else
+ BUILDAGENTLIBS = $(shell net-snmp-config --netsnmp-agent-libs)
+- INSTALLMIBDIR = $(basedir)$(shell net-snmp-config --prefix)/share/snmp/mibs
++ INSTALLMIBDIR = $(basedir)/usr/share/snmp/mibs
+ endif
+
+ ifeq ($(EMBEDDED_PERL),1)
--- /dev/null
+--- a/src/modules/cnxcc/Makefile
++++ b/src/modules/cnxcc/Makefile
+@@ -8,12 +8,10 @@ include ../../Makefile.defs
+ auto_gen=
+ NAME=cnxcc.so
+
+-ifeq ($(CROSS_COMPILE),)
+ HIREDIS_BUILDER = $(shell \
+ if pkg-config --exists hiredis; then \
+ echo 'pkg-config hiredis'; \
+ fi)
+-endif
+
+ ifeq ($(HIREDIS_BUILDER),)
+ HIREDISDEFS=-I$(LOCALBASE)/include
+--- a/src/modules/db_redis/Makefile
++++ b/src/modules/db_redis/Makefile
+@@ -5,12 +5,10 @@ include ../../Makefile.defs
+ auto_gen=
+ NAME=db_redis.so
+
+-ifeq ($(CROSS_COMPILE),)
+ HIREDIS_BUILDER = $(shell \
+ if pkg-config --exists hiredis; then \
+ echo 'pkg-config hiredis'; \
+ fi)
+-endif
+
+ ifeq ($(HIREDIS_BUILDER),)
+ HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis
+--- a/src/modules/ndb_redis/Makefile
++++ b/src/modules/ndb_redis/Makefile
+@@ -5,12 +5,10 @@ include ../../Makefile.defs
+ auto_gen=
+ NAME=ndb_redis.so
+
+-ifeq ($(CROSS_COMPILE),)
+ HIREDIS_BUILDER = $(shell \
+ if pkg-config --exists hiredis; then \
+ echo 'pkg-config hiredis'; \
+ fi)
+-endif
+
+ ifeq ($(HIREDIS_BUILDER),)
+ HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis
+--- a/src/modules/topos_redis/Makefile
++++ b/src/modules/topos_redis/Makefile
+@@ -5,12 +5,10 @@ include ../../Makefile.defs
+ auto_gen=
+ NAME=topos_redis.so
+
+-ifeq ($(CROSS_COMPILE),)
+ HIREDIS_BUILDER = $(shell \
+ if pkg-config --exists hiredis; then \
+ echo 'pkg-config hiredis'; \
+ fi)
+-endif
+
+ ifeq ($(HIREDIS_BUILDER),)
+ HIREDISDEFS=-I$(LOCALBASE)/include -I$(LOCALBASE)/include/hiredis -I/usr/include/hiredis
--- /dev/null
+--- a/src/modules/erlang/Makefile
++++ b/src/modules/erlang/Makefile
+@@ -5,20 +5,21 @@ include ../../Makefile.defs
+ auto_gen=
+ NAME=erlang.so
+
+-ERLANG=$(shell which erl)
++# In OpenWrt Erlang resides in standard locations, no special flags required
++#ERLANG=$(shell which erl)
+
+ ifneq ($(ERLANG),)
+ ERLANG_LIBDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1)
+ ERLANG_INCDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1)
+ endif
+
+-ifeq ($(ERLANG_LIBDIR)$(ERLANG_INCDIR),)
+-$(error Not found Erlang)
+-endif
++#ifeq ($(ERLANG_LIBDIR)$(ERLANG_INCDIR),)
++#$(error Not found Erlang)
++#endif
+
+-LIBS=-L$(ERLANG_LIBDIR) -lei -lpthread
++LIBS=-lei -lpthread
+
+-DEFS+=-I$(ERLANG_INCDIR)
++#DEFS+=-I$(ERLANG_INCDIR)
+ DEFS+=-D_REENTRANT
+
+