freeswitch: fix compile against musl-1.2.4
[feed/telephony.git] / net / freeswitch / Makefile
index bf4e17d9d63d8b85ce430956edcbf33efba365cb..f90522b5fa46a3056011ae27df83a3044f6777e8 100644 (file)
@@ -1,54 +1,74 @@
 #
-# Copyright (C) 2009-2016 OpenWrt.org
+# Copyright (C) 2017 Sebastian Kemper <sebastian_ml@gmx.net>
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
-#
-include $(TOPDIR)/rules.mk
 
+include $(TOPDIR)/rules.mk
 
 PKG_NAME:=freeswitch
-PKG_SOURCE_PROTO:=git
-PKG_DISTNAME:=$(PKG_NAME)_$(PKG_SOURCE_PROTO)
-PKG_VERSION:=1.9.0
-
-
-#
-# The latest FS git hash in PKG_SOURCE_VERSION can be obtained from
-# http://fisheye.freeswitch.org
-#
-PKG_SOURCE_URL:=https://$(PKG_NAME).org/stash/scm/fs/$(PKG_NAME).git
-PATCH_DIR:=./patches/$(CONFIG_LIBC)
+PKG_VERSION:=1.10.9
+PKG_RELEASE:=2
+PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
 
+PKG_SOURCE:=freeswitch-$(PKG_VERSION).-release.tar.xz
+PKG_SOURCE_URL:=https://files.freeswitch.org/releases/freeswitch
+PKG_HASH:=f649d53af7beccb59c1d03864cd8f2d287e4ea26ef652b5c4969d29121ced063
 
-FS_WITH_DEFAULT_HEAD:=77d0cfbf9e9a546b4eee23d9668cf44022f5d454
-FS_WITH_DEFAULT_HEAD_SHORT:=$(shell echo $(FS_WITH_DEFAULT_HEAD)|cut -b -7)
-PKG_SOURCE_VERSION:=$(if $(CONFIG_FS_WITH_LATEST_HEAD),$(shell git ls-remote $(PKG_SOURCE_URL) HEAD | cut -f1),$(FS_WITH_DEFAULT_HEAD))
-PKG_SOURCE_VERSION_SHORT:=$(shell echo $(PKG_SOURCE_VERSION)|cut -b -7)
-PKG_RELEASE:=$(PKG_SOURCE_VERSION_SHORT)
-PKG_SOURCE:=$(PKG_DISTNAME)-$(FS_WITH_DEFAULT_HEAD_SHORT).tar.xz
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_CPE_ID:=cpe:/a:freeswitch:freeswitch
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/freeswitch-$(PKG_VERSION).-release
 
-TAR_OPTIONS+= --strip-components=1 -C $(PKG_BUILD_DIR)
+PKG_BUILD_DEPENDS:=perl/host
 
-
-PKG_BUILD_DEPENDS:=swig/host
 PKG_FIXUP:=autoreconf
-PKG_BUILD_PARALLEL:=0
-PKG_USE_MIPS16:=0
-
-
-PKG_LICENSE:=MPL-1.1
-PKG_LICENSE_FILES:=COPYING
-
-
-ifeq ($(CONFIG_DEVEL),y)
-       export QUILT=1
-endif
 
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+PKG_LICENSE:= \
+       AGPL-3.0 \
+       Apache-2.0 \
+       BSD-2-Clause \
+       BSD-3-Clause \
+       BSD-4-Clause \
+       BSD-like \
+       Beerware \
+       GPL-1.0+ \
+       GPL-2.0 \
+       GPL-2.0+ \
+       GPL-3.0 \
+       ISC \
+       LGPL-2.0+ \
+       LGPL-2.1 \
+       LGPL-2.1+ \
+       MIT/X11 (BSD like) \
+       MPL-1.1 \
+       OpenLDAP \
+       RSA-MD \
+       zlib-acknowledgement
+
+PKG_LICENSE_FILES:=debian/copyright
+
+FS_DATA_DIR:=/usr/share/freeswitch
+
+FS_BIN_DIR:=/usr/bin
+FS_EXAMPLES_DIR:=$(FS_DATA_DIR)/examples
+FS_FONTS_DIR:=$(FS_DATA_DIR)/fonts
+FS_GRAMMAR_DIR:=$(FS_DATA_DIR)/grammar
+FS_HTDOCS_DIR:=$(FS_DATA_DIR)/htdocs
+FS_IMAGES_DIR:=$(FS_DATA_DIR)/images
+FS_INCLUDES_DIR:=/usr/include/freeswitch
+FS_LANG_DIR:=$(FS_DATA_DIR)/lang
+FS_LIB_DIR:=/usr/lib
+FS_MOD_DIR:=$(FS_LIB_DIR)/freeswitch/mod
+FS_PKGCONFIG_DIR:=$(FS_LIB_DIR)/pkgconfig
+FS_SCRIPTS_DIR:=$(FS_DATA_DIR)/scripts
+FS_SOUNDS_DIR:=$(FS_DATA_DIR)/sounds
+FS_SYSCONF_DIR:=/etc
+FS_TLS_DIR:=$(FS_SYSCONF_DIR)/freeswitch/tls
+FS_TZ_DIR:=$(FS_DATA_DIR)/tz
 
 FS_MOD_AVAILABLE:= \
        abstraction \
@@ -57,113 +77,110 @@ FS_MOD_AVAILABLE:= \
        amrwb \
        av \
        avmd \
+       b64 \
        basic \
        bert \
        blacklist \
-       bv \
        callcenter \
-       cdr-csv \
-       cdr-mongodb \
-       cdr-pg-csv \
-       cdr-sqlite \
-       cepstral \
+       cdr_csv \
+       cdr_mongodb \
+       cdr_pg_csv \
+       cdr_sqlite \
        cidlookup \
+       clearmode \
        cluechoo \
-       codec2 \
        commands \
        conference \
        console \
        curl \
-       cv \
-       dahdi-codec \
+       dahdi_codec \
        db \
-       dialplan-asterisk \
-       dialplan-directory \
-       dialplan-xml \
-       dingaling \
+       dialplan_asterisk \
+       dialplan_directory \
+       dialplan_xml \
        directory \
        distributor \
        dptools \
        easyroute \
        enum \
-       erlang-event \
+       erlang_event \
        esf \
        esl \
-       event-multicast \
-       event-socket \
-       event-zmq \
+       event_multicast \
+       event_socket \
+       event_test \
+       event_zmq \
        expr \
+       fail2ban \
        fifo \
-       file-string \
-       flite \
-       format-cdr \
-       freetdm \
+       format_cdr \
        fsk \
        fsv \
-       g723-1 \
+       g723_1 \
        g729 \
        graylog2 \
        gsmopen \
        h26x \
-       h323 \
        hash \
        hiredis \
-       html5 \
        httapi \
-       http-cache \
-       ilbc \
+       http_cache \
        isac \
-       java \
-       json-cdr \
+       json_cdr \
        kazoo \
        lcr \
        ldap \
-       local-stream \
+       local_stream \
        logfile \
        loopback \
        lua \
-       managed \
-       memcache \
-       mongo \
-       mp4 \
+       mariadb \
        mp4v \
-       native-file \
+       native_file \
        nibblebill \
+       odbc_cdr \
        opus \
+       opusfile \
        oreka \
        perl \
+       pgsql \
        png \
+       pocketsphinx \
        portaudio \
-       portaudio-stream \
-       posix-timer \
+       portaudio_stream \
+       posix_timer \
        prefix \
-       python \
-       radius-cdr \
+       python3 \
+       radius_cdr \
+       random \
+       raven \
        rayo \
        redis \
        rss \
        rtc \
        rtmp \
-       sangoma-codec \
-       say-de \
-       say-en \
-       say-es \
-       say-fa \
-       say-fr \
-       say-hu \
-       say-it \
-       say-nl \
-       say-pt \
-       say-ru \
-       say-th \
-       say-zh \
-       shell-stream \
-       silk \
-       siren \
-       skel \
+       say_de \
+       say_en \
+       say_es \
+       say_es_ar \
+       say_fa \
+       say_fr \
+       say_he \
+       say_hr \
+       say_hu \
+       say_it \
+       say_ja \
+       say_nl \
+       say_pl \
+       say_pt \
+       say_ru \
+       say_sv \
+       say_th \
+       say_zh \
+       shell_stream \
+       shout \
+       signalwire \
        skinny \
-       skypopen \
-       smpp \
        sms \
        snapshot \
        sndfile \
@@ -172,900 +189,841 @@ FS_MOD_AVAILABLE:= \
        sofia \
        sonar \
        spandsp \
-       spidermonkey \
-       spidermonkey-core-db \
-       spidermonkey-curl \
-       spidermonkey-odbc \
-       spidermonkey-socket \
-       spidermonkey-teletone \
        spy \
        ssml \
        stress \
        syslog \
-       timerfd \
-       tone-stream \
+       theora \
+       tone_stream \
        translate \
-       tts-commandline \
-       unimrcp \
-       valet-parking \
+       tts_commandline \
+       valet_parking \
        verto \
+       video_filter \
        vmd \
        voicemail \
-       voicemail-ivr \
-       xml-cdr \
-       xml-curl \
-       xml-ldap \
-       xml-radius \
-       xml-rpc \
-       xml-scgi \
+       voicemail_ivr \
+       xml_cdr \
+       xml_curl \
+       xml_ldap \
+       xml_rpc \
+       xml_scgi \
        yaml \
-
+       yuv
 
 PKG_CONFIG_DEPENDS:= \
-       CONFIG_FS_WITH_LATEST_HEAD \
-       CONFIG_FS_WITH_ALSA \
-       CONFIG_FS_WITH_APR_CONFIG_SWITCHES \
-       CONFIG_FS_WITH_APR_IPV6 \
-       CONFIG_FS_WITH_APR_SCTP \
-       CONFIG_FS_WITH_APR_THREADS \
-       CONFIG_FS_WITH_BUILTIN_ZRTP \
-       CONFIG_FS_WITH_CORE_LIBEDIT_SUPPORT \
-       CONFIG_FS_WITH_DEFAULT_HEAD \
-       CONFIG_FS_WITH_ERLANG \
-       CONFIG_FS_WITH_FHS \
-       CONFIG_FS_WITH_FIXED_POINT \
-       CONFIG_FS_WITH_LOCAL_SOURCE \
-       CONFIG_FS_WITH_LIBVPX \
+       $(patsubst %,CONFIG_PACKAGE_freeswitch-mod-%,$(subst _,-,$(FS_MOD_AVAILABLE))) \
+       CONFIG_FS_WITH_DEBUG \
+       CONFIG_FS_WITH_FREETYPE \
        CONFIG_FS_WITH_LIBYUV \
-       CONFIG_FS_WITH_LZMA \
-       CONFIG_FS_WITH_MYSQL \
        CONFIG_FS_WITH_ODBC \
-       CONFIG_FS_WITH_OGG \
-       CONFIG_FS_WITH_OPENSSL \
-       CONFIG_FS_WITH_OPENWRT_SOURCE \
-       CONFIG_FS_WITH_OPT \
-       CONFIG_FS_WITH_POSTGRESQL \
-       CONFIG_FS_WITH_PYTHON \
-       CONFIG_FS_WITH_PYTHON_PATH \
-       CONFIG_FS_WITH_SILENT_RULES \
-       CONFIG_FS_WITH_SQLITE3 \
+       CONFIG_FS_WITH_PNG \
        CONFIG_FS_WITH_SRTP \
-       CONFIG_FS_WITH_SRTP_GENERIC_AESICM \
-       CONFIG_FS_WITH_SRTP_KERNEL_LINUX \
-       CONFIG_FS_WITH_SRTP_OPENSSL \
-       CONFIG_FS_WITH_STUN \
-       CONFIG_FS_WITH_VISIBILITY \
-       $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_MOD_AVAILABLE)) \
-
+       CONFIG_FS_WITH_VPX \
+       CONFIG_LIBC \
+       CONFIG_PACKAGE_freeswitch-misc-perl-esl \
+       CONFIG_PACKAGE_freeswitch-misc-python3-esl \
+       CONFIG_SOFT_FLOAT
 
 include $(INCLUDE_DIR)/package.mk
+# iconv support
 include $(INCLUDE_DIR)/nls.mk
-include $(TOPDIR)/feeds/packages/lang/perl/perlmod.mk
 
+FS_PERL_FEED:=$(TOPDIR)/feeds/packages/lang/perl
 
-ifneq ($(CONFIG_FS_WITH_PYTHON),)
-include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
-#$(call include_mk, python3-package.mk)
-endif
+include $(TOPDIR)/feeds/packages/lang/python/python3-version.mk
+include $(FS_PERL_FEED)/perlver.mk
 
+# https://github.com/signalwire/freeswitch/issues/1670
+TARGET_CFLAGS+=-Wno-error=address
 
-ifneq ($(CONFIG_CCACHE),)
-TARGET_CC=$(TARGET_CC_NOCACHE)
-TARGET_CXX=$(TARGET_CXX_NOCACHE)
-endif
+# Allow compiling with OpenSSL 3.0
+TARGET_CFLAGS+=-Wno-error=deprecated-declarations
 
+PERL_SITELIB:=/usr/lib/perl$(PERL_MAJOR)/$(PERL_VERSION2)
 
-define Package/$(PKG_NAME)/Default
-  SECTION:=net
-  CATEGORY:=Network
-  SUBMENU:=Telephony
-  URL:=http://www.$(PKG_NAME).org/
-  MAINTAINER:=Mazi Lo <openwrt.mazilo@xoxy.net>
-endef
+FS_PERL_LIBS:=$(shell grep "^libs=" \
+       $(FS_PERL_FEED)/files/base.config | \
+                       sed "s/^libs=//;s/'//g")
 
+FS_PYTHON3_SITE_DIR:=$(FS_LIB_DIR)/python$(PYTHON3_VERSION)/site-packages
 
-define Package/$(PKG_NAME)
-  $(call Package/$(PKG_NAME)/Default)
-  MENU:=1
-  TITLE:=FreeSWITCH open source telephony platform ($(PKG_SOURCE_VERSION_SHORT))
-  DEPENDS:=+FS_WITH_CORE_LIBEDIT_SUPPORT:libedit +FS_WITH_OPENSSL:libopenssl +libcurl +libdb47 +libfreetype +libgdbm $(ICONV_DEPENDS) $(INTL_DEPENDS) +libjpeg +libncurses +libopenldap +libpcre +libpng +libpthread +librt +libspeex +libspeexdsp +FS_WITH_SQLITE3:libsqlite3 +libsrtp +SSP_SUPPORT:libssp +libstdcpp +libuuid +PACKAGE_$(PKG_NAME)-mod-perl:perl
+define Download/files
+define Download/$(1)
+  FILE:=$(2)
+  URL:=$(3)
+  HASH:=$(4)
+  VERSION:=$(5)
+  SUBDIR:=$(6)
+  MIRROR_HASH:=$(7)
+  PROTO:=$(8)
 endef
-
-
-define Package/$(PKG_NAME)/description
-  FreeSWITCH is an open source telephony platform designed to
-  facilitate the creation of voice and chat driven products 
-  scaling from a soft-phone up to a soft-switch.
+$$(eval $$(call Download,$(1)))
 endef
 
-
-define Package/$(PKG_NAME)/config
-  source "$(SOURCE)/Config.in"
+define Package/freeswitch/enable/plugin
+       $(SED) '/$(1)$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf
 endef
 
-
-define Package/$(PKG_NAME)-mod-spandsp/config
-    config FS_WITH_FIXED_POINT
-    depends on PACKAGE_$(PKG_NAME)-mod-spandsp
-    bool "Enable fixed point support for spandsp (may degrade performance)"
-    default n
-    help
-       Compile spandsp package with a fixed point support. ONLY enabled this
-       option when necessary, i.e. CPU doesn't support floating computation.
+define Package/freeswitch/install/bin
+       $(INSTALL_DIR) $(1)$(FS_BIN_DIR)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)$(FS_BIN_DIR)/$(2) \
+                                       $(1)$(FS_BIN_DIR)
 endef
 
-
-define Package/$(PKG_NAME)-example-config
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH example config (commented)
-  DEPENDS:= $(PKG_NAME)
+define Package/freeswitch/install/dir
+       if [ -d $(2) ]; then $(INSTALL_DIR) $(1); fi
+       for dir in $$$$(shell [ -d $(2) ] && cd $(2) && $(FIND) -type d -print | sed 's|^./\?||'); \
+       do \
+               $(INSTALL_DIR) $(1)/$$$$$$$$dir; \
+       done
+       for file in $$$$(shell [ -d $(2) ] && cd $(2) && $(FIND) -type f -print | sed 's|^./||'); \
+       do \
+               $(INSTALL_DATA) $(2)/$$$$$$$$file $(1)/$$$$$$$$file; \
+       done
 endef
 
-
-define Package/$(PKG_NAME)-example-config/description
-  The default configuration included with FreeSWITCH. It is not intended to be
-  a final product, and is thus moved to /usr/share/$(PKG_NAME)/examples/conf to
-  be an example of how FreeSWITCH can be configured.
+define Package/freeswitch/install/lib
+       $(INSTALL_DIR) $(1)$(FS_LIB_DIR)
+       $(CP) $(PKG_INSTALL_DIR)$(FS_LIB_DIR)/$(2).so.* \
+                                       $(1)$(FS_LIB_DIR)
 endef
 
-
-define Package/$(PKG_NAME)-config-upstream-defaults
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH upstream config
-  DEPENDS:= $(PKG_NAME)
+define Package/freeswitch/install/mod
+       $(INSTALL_DIR) $(1)$(FS_MOD_DIR)
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)$(FS_MOD_DIR)/mod_$(2).so \
+                                               $(1)$(FS_MOD_DIR)
 endef
 
-
-define Package/$(PKG_NAME)-config-upstream-defaults/description
-  The default configuration included with FreeSWITCH. It is not intended to be
-  a final product, and but is included for those who don't want to use the
-  OpenWRT configuration and/or want to try things as prepared by upstream.
+define Package/freeswitch/config
+       source "$(SOURCE)/Config.in"
 endef
 
-
-define Package/$(PKG_NAME)-config-minimal
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH minimal config
-  DEPENDS:= $(PKG_NAME)
+define Package/freeswitch/Default
+  SUBMENU:=Telephony
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=https://www.freeswitch.org
 endef
 
-
-define Package/$(PKG_NAME)-config-minimal/description
-  A minimal configuration of FreeSWITCH for OpenWRT devices. Is what the UCI
-  configuration began with.
+# Note: shadow deps are a bit strange; you need to select shadow-utils
+# package first for shadow-su to be selected, even though the
+# shadow-utils package later becomes a no-op.
+define Package/freeswitch
+$(call Package/freeswitch/Default)
+  TITLE:=Open source telephony platform, v$(PKG_VERSION)
+  MENU:=1
+  USERID:=freeswitch=372:freeswitch=372
+  DEPENDS:= \
+         $(ICONV_DEPENDS) \
+         +libstdcpp \
+         +!BUSYBOX_DEFAULT_SU:shadow-utils \
+         +!BUSYBOX_DEFAULT_SU:shadow-su \
+         +@OPENSSL_WITH_DEPRECATED \
+         +FS_WITH_FREETYPE:libfreetype \
+         +FS_WITH_ODBC:unixodbc \
+         +FS_WITH_PNG:libpng \
+         +libcurl \
+         +libedit \
+         +libopenssl \
+         +libpcre \
+         +libpthread \
+         +librt \
+         +libspandsp3 \
+         +libspeex \
+         +libspeexdsp \
+         +libsqlite3 \
+         +libuuid \
+         +sofia-sip \
+         +zlib
 endef
 
-
-define Package/$(PKG_NAME)-collection-upstream-defaults
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FS upstream def sample conf
-  DEPENDS:= $(PKG_NAME) \
-               +$(PKG_NAME)-mod-callcenter \
-               +$(PKG_NAME)-mod-commands \
-               +$(PKG_NAME)-mod-conference \
-               +$(PKG_NAME)-mod-curl \
-               +$(PKG_NAME)-mod-dialplan-xml \
-               +$(PKG_NAME)-mod-dingaling \
-               +$(PKG_NAME)-mod-dptools \
-               +$(PKG_NAME)-mod-event-socket \
-               +$(PKG_NAME)-mod-g723-1 \
-               +$(PKG_NAME)-mod-g729 \
-               +$(PKG_NAME)-mod-hash \
-               +$(PKG_NAME)-mod-http-cache \
-               +$(PKG_NAME)-mod-local-stream \
-               +$(PKG_NAME)-mod-lua \
-               +$(PKG_NAME)-mod-native-file \
-               +$(PKG_NAME)-mod-say-en \
-               +$(PKG_NAME)-mod-sndfile \
-               +$(PKG_NAME)-mod-sofia \
-               +$(PKG_NAME)-mod-syslog \
-               +$(PKG_NAME)-mod-tone-stream \
-               +$(PKG_NAME)-mod-xml-curl \
-               +$(PKG_NAME)-mod-xml-rpc \
-               +$(PKG_NAME)-tools
+define Package/freeswitch/description
+FreeSWITCH is a scalable open source cross-platform telephony platform
+designed to route and interconnect popular communication protocols
+using audio, video, text or any other form of media.
 endef
 
-
-define Package/$(PKG_NAME)-collection-minimal
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH minimal package collection
-  DEFAULT:=y
-  DEPENDS:= $(PKG_NAME) \
-               +$(PKG_NAME)-config-minimal \
-               +$(PKG_NAME)-mod-commands \
-               +$(PKG_NAME)-mod-dialplan-xml \
-               +$(PKG_NAME)-mod-dptools \
-               +$(PKG_NAME)-mod-event-socket \
-               +$(PKG_NAME)-mod-hash \
-               +$(PKG_NAME)-mod-local-stream \
-               +$(PKG_NAME)-mod-sndfile \
-               +$(PKG_NAME)-mod-sofia \
-               +$(PKG_NAME)-mod-syslog \
-               +$(PKG_NAME)-mod-tone-stream \
-               +$(PKG_NAME)-tools
+define Package/freeswitch/conffiles
+$(FS_SYSCONF_DIR)/freeswitch
+$(FS_SYSCONF_DIR)/config/freeswitch
+$(FS_SYSCONF_DIR)/init.d/freeswitch
 endef
 
-
-define Package/$(PKG_NAME)-sounds-en-08KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 8KHz english sounds
-  DEPENDS:= $(PKG_NAME)
+define Package/freeswitch/install
+$(call Package/freeswitch/install/bin,$(1),freeswitch)
+$(call Package/freeswitch/install/lib,$(1),libfreeswitch)
+       $(INSTALL_DIR) $(1)$(FS_FONTS_DIR)
+       $(INSTALL_DIR) $(1)$(FS_GRAMMAR_DIR)
+       $(INSTALL_DIR) $(1)$(FS_HTDOCS_DIR)
+       $(INSTALL_DIR) $(1)$(FS_IMAGES_DIR)
+       $(INSTALL_DIR) $(1)$(FS_SCRIPTS_DIR)
+       $(INSTALL_DIR) $(1)$(FS_SOUNDS_DIR)
+       $(INSTALL_DIR) $(1)$(FS_SYSCONF_DIR)/config
+       $(INSTALL_DIR) $(1)$(FS_SYSCONF_DIR)/hotplug.d/iface
+       $(INSTALL_DIR) $(1)$(FS_SYSCONF_DIR)/init.d
+       $(INSTALL_DIR) $(1)$(FS_TLS_DIR)
+       $(INSTALL_BIN) ./files/freeswitch.init \
+               $(1)$(FS_SYSCONF_DIR)/init.d/freeswitch
+       $(INSTALL_BIN) ./files/freeswitch.hotplug \
+               $(1)$(FS_SYSCONF_DIR)/hotplug.d/iface/90-freeswitch
+       $(INSTALL_CONF) ./files/freeswitch.conf \
+               $(1)$(FS_SYSCONF_DIR)/config/freeswitch
 endef
 
-
-define Package/$(PKG_NAME)-sounds-en-16KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 16KHz english sounds
-  DEPENDS:= +$(PKG_NAME)-sounds-en-08KHz
+define Package/freeswitch/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+  echo
+  echo "o-------------------------------------------------------------------o"
+  echo "| FreeSWITCH note                                                   |"
+  echo "o-------------------------------------------------------------------o"
+  echo "| Edit /etc/config/freeswitch to change basic init configuration.   |"
+  echo "|                                                                   |"
+  echo "| Also visit the Wiki at:                                           |"
+  echo "| https://openwrt.org/docs/guide-user/services/voip/freeswitch      |"
+  echo "o-------------------------------------------------------------=^_^=-o"
+  echo
+fi
+exit 0
 endef
 
-
-define Package/$(PKG_NAME)-sounds-en-32KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 32KHz english sounds
-  DEPENDS:= +$(PKG_NAME)-sounds-en-16KHz
+define Package/freeswitch-misc-perl-esl
+$(call Package/freeswitch/Default)
+  TITLE:=Perl ESL
+  DEPENDS:=freeswitch \
+         +PACKAGE_freeswitch-misc-perl-esl:perlbase-autoloader \
+         +PACKAGE_freeswitch-misc-perl-esl:perlbase-data \
+         +PACKAGE_freeswitch-misc-perl-esl:perlbase-dynaloader \
+         @PERL_THREADS
 endef
 
-
-define Package/$(PKG_NAME)-sounds-en-48KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 48KHz english sounds
-  DEPENDS:= +$(PKG_NAME)-sounds-en-32KHz
+define Package/freeswitch-misc-perl-esl/description
+This package contains the Perl binding for FreeSWITCH's Event Socket
+Library (ESL).
 endef
 
-
-define Package/$(PKG_NAME)-sounds-moh-08KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 8KHz music-on-hold sounds
-  DEPENDS:= $(PKG_NAME)
+define Package/freeswitch-misc-perl-esl/install
+       $(INSTALL_DIR) $(1)$(PERL_SITELIB)/ESL
+       $(INSTALL_DIR) $(1)$(PERL_SITELIB)/auto/ESL
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)$(PERL_SITELIB)/ESL.so \
+                                       $(1)$(PERL_SITELIB)/auto/ESL
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(PERL_SITELIB)/ESL.pm \
+                                       $(1)$(PERL_SITELIB)
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(PERL_SITELIB)/ESL/Dispatch.pm \
+                                       $(1)$(PERL_SITELIB)/ESL
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(PERL_SITELIB)/ESL/IVR.pm \
+                                       $(1)$(PERL_SITELIB)/ESL
 endef
 
-
-define Package/$(PKG_NAME)-sounds-moh-16KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 16KHz music-on-hold sounds
-  DEPENDS:= +$(PKG_NAME)-sounds-moh-08KHz
+define Package/freeswitch-misc-python3-esl
+$(call Package/freeswitch/Default)
+  TITLE:=Python3 ESL
+  DEPENDS:=freeswitch +PACKAGE_freeswitch-misc-python3-esl:python3-light
 endef
 
-
-define Package/$(PKG_NAME)-sounds-moh-32KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 32KHz music-on-hold sounds
-  DEPENDS:= +$(PKG_NAME)-sounds-moh-16KHz
+define Package/freeswitch-misc-python3-esl/description
+This package contains the Python3 binding for FreeSWITCH's Event Socket
+Library (ESL).
 endef
 
-
-define Package/$(PKG_NAME)-sounds-moh-48KHz
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH 48KHz music-on-hold sounds
-  DEPENDS:= +$(PKG_NAME)-sounds-moh-32KHz
+define Package/freeswitch-misc-python3-esl/install
+       $(INSTALL_DIR) $(1)$(FS_PYTHON3_SITE_DIR)
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)$(FS_PYTHON3_SITE_DIR)/_ESL.so \
+                                       $(1)$(FS_PYTHON3_SITE_DIR)
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(FS_PYTHON3_SITE_DIR)/ESL.py \
+                                       $(1)$(FS_PYTHON3_SITE_DIR)
 endef
 
-
-define Package/$(PKG_NAME)-tools
-  $(call Package/$(PKG_NAME)/Default)
-  TITLE:=FreeSWITCH control tools
-  DEPENDS:= $(PKG_NAME)
+define Package/freeswitch-misc-timezones
+$(call Package/freeswitch/Default)
+  TITLE:=Timezones file
+  DEPENDS:=freeswitch
+  PKGARCH:=all
 endef
 
+define Package/freeswitch-misc-timezones/description
+This package includes a timezones file for FreeSWITCH.
+endef
 
-define Download/files
- define Download/$(1)
-  FILE:=$(2)
-  URL:=$(if $(4),$(4),http://files.$(PKG_NAME).org)/$(5)
-  MD5SUM:=$(3)
- endef
- define Prepare/$(1)
-  $(LN) $(DL_DIR)/$(2) $(PKG_BUILD_DIR)/$(6)
- endef
- $$(eval $$(call Download,$(1)))
+define Package/freeswitch-misc-timezones/install
+       $(INSTALL_DIR) $(1)$(FS_TZ_DIR)
+       $(INSTALL_DATA) \
+       $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/timezones.conf.xml \
+                                               $(1)$(FS_TZ_DIR)
 endef
 
+define Package/freeswitch/Example
+define Package/freeswitch-example-$(subst _,-,$(1))
+$(call Package/freeswitch/Default)
+  TITLE:=Example configuration
+  DEPENDS:=freeswitch
+  PKGARCH:=all
+endef
+define Package/freeswitch-example-$(subst _,-,$(1))/description
+This package does not install any configuration for FreeSWITCH into
+/etc/freeswitch. The system administrator is completely responsible
+for that directory. If you install one of the example configuration
+packages, it will install the corresponding sample configuration to
+/usr/share/freeswitch/examples where you can take a look at it.
+endef
+define Package/freeswitch-example-$(subst _,-,$(1))/install
+$(call Package/freeswitch/install/dir,$$(1)$(FS_EXAMPLES_DIR)/$(1),$(PKG_BUILD_DIR)/conf/$(1))
+endef
+$$(eval $$(call BuildPackage,freeswitch-example-$(subst _,-,$(1))))
+endef
 
-MAKE_INSTALL_TARGETS:=install
+define Package/freeswitch/Language
+define Package/freeswitch-lang-$(subst _,-,$(1))
+$(call Package/freeswitch/Default)
+  TITLE:=$(2) language files
+  DEPENDS:=freeswitch
+  PKGARCH:=all
+endef
+define Package/freeswitch-lang-$(subst _,-,$(1))/description
+This package includes the $(2) language files for FreeSWITCH.
+endef
+define Package/freeswitch-lang-$(subst _,-,$(1))/install
+$(call Package/freeswitch/install/dir,$$(1)$(FS_LANG_DIR)/$(1),$(PKG_BUILD_DIR)/conf/vanilla/lang/$(1))
+endef
+$$(eval $$(call BuildPackage,freeswitch-lang-$(subst _,-,$(1))))
+endef
 
+# The next package generator is for miscellaneous files that only
+# require being copied from PKG_INSTALL_DIR to the ipkg.
+define Package/freeswitch/Misc
+define Package/freeswitch-$(subst _,-,$(1))
+$(call Package/freeswitch/Default)
+  TITLE:=$(2)
+  DEPENDS:=freeswitch
+  ifeq ($(6),y)
+  PKGARCH:=all
+  endif
+endef
+define Package/freeswitch-$(subst _,-,$(1))/description
+$(subst \n,$(newline),$(3))
+endef
+define Package/freeswitch-$(subst _,-,$(1))/install
+$(call Package/freeswitch/install/dir,$$(1)$(5),$(PKG_INSTALL_DIR)$(4))
+endef
+$$(eval $$(call BuildPackage,freeswitch-$(subst _,-,$(1))))
+endef
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl),)
- $(eval $(call Download/files,json-cdr,json-c-0.9.tar.gz,4653b3b9c568bb9c782178abfaac128d,,downloads/libs/,libs/))
+define Package/freeswitch/Module
+define Package/freeswitch-mod-$(subst _,-,$(1))
+$(call Package/freeswitch/Default)
+  TITLE:=$(2) module
+  DEPENDS:=freeswitch $(patsubst +%,+PACKAGE_freeswitch-mod-$(subst _,-,$(1)):%,$(4))
+endef
+define Package/freeswitch-mod-$(subst _,-,$(1))/description
+$(subst \n,$(newline),$(3))
+endef
+define Package/freeswitch-mod-$(subst _,-,$(1))/install
+$(call Package/freeswitch/install/mod,$$(1),$(1))
+ifeq ($(CONFIG_FS_WITH_MODCONF),y)
+$(call Package/freeswitch/install/dir,$$(1)$(FS_EXAMPLES_DIR)/mod_$(1),$(PKG_BUILD_DIR)/src/mod/*/mod_$(1)/conf)
 endif
-
-
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-event-zmq),)
- $(eval $(call Download/files,event-zmq,zeromq-2.1.9.tar.gz,94c5e0262a79c5f82bc0b178c1f8a33d,http://download.zeromq.org http://download.zeromq.org/historic,,libs/))
+ifeq ($(1),perl)
+       $(INSTALL_DIR) $$(1)$(PERL_SITELIB)/auto/freeswitch
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/perl/freeswitch.so \
+                                       $$(1)$(PERL_SITELIB)/auto/freeswitch
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/perl/freeswitch.pm \
+                                                       $$(1)$(PERL_SITELIB)
 endif
-
-
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-mongo),)
- $(eval $(call Download/files,mongo,mongo-c-driver-0.92.2.tar.gz,afab25a33abd3f1e0ba79c5a9da92651,,downloads/libs/,libs/))
+ifeq ($(1),python3)
+       $(INSTALL_DIR) $$(1)$(FS_PYTHON3_SITE_DIR)
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(FS_PYTHON3_SITE_DIR)/freeswitch.py \
+                                       $$(1)$(FS_PYTHON3_SITE_DIR)
 endif
+endef
+$$(eval $$(call BuildPackage,freeswitch-mod-$(subst _,-,$(1))))
+endef
 
+define Package/freeswitch/Util
+define Package/freeswitch-util-$(subst _,-,$(1))
+$(call Package/freeswitch/Default)
+  TITLE:=$(2) utility
+  DEPENDS:=freeswitch $(patsubst +%,+PACKAGE_freeswitch-util-$(subst _,-,$(1)):%,$(4))
+  ifeq ($(5),y)
+  PKGARCH:=all
+  endif
+endef
+define Package/freeswitch-util-$(subst _,-,$(1))/description
+$(subst \n,$(newline),$(3))
+endef
+define Package/freeswitch-util-$(subst _,-,$(1))/install
+$(call Package/freeswitch/install/bin,$$(1),$(1))
+endef
+$$(eval $$(call BuildPackage,freeswitch-util-$(subst _,-,$(1))))
+endef
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-08KHz),)
- $(eval $(call Download/files,sounds-en-08KHz,$(PKG_NAME)-sounds-en-us-callie-8000-1.0.50.tar.gz,14cccba7b5c56f027fea391f1e0ee2d6,,,))
-       MAKE_INSTALL_TARGETS+= sounds-install
-endif
-
+CONFIGURE_ARGS+= \
+       --srcdir=$(PKG_BUILD_DIR) \
+       --disable-dependency-tracking \
+       --disable-static \
+       --disable-system-xmlrpc-c \
+       --enable-core-libedit-support \
+       --enable-fhs \
+       --with-cachedir=/tmp/freeswitch/cache \
+       --with-dbdir=/tmp/freeswitch/db \
+       --with-imagesdir=$(FS_IMAGES_DIR) \
+       --with-logfiledir=/tmp/freeswitch/log \
+       --with-python=no \
+       --with-recordingsdir=/tmp/freeswitch/recordings \
+       --with-storagedir=/tmp/freeswitch/storage \
+       $(call autoconf_bool,CONFIG_FS_WITH_DEBUG,debug) \
+       $(call autoconf_bool,CONFIG_FS_WITH_LIBYUV,libyuv) \
+       $(call autoconf_bool,CONFIG_FS_WITH_ODBC,core-odbc-support) \
+       $(call autoconf_bool,CONFIG_FS_WITH_SRTP,srtp) \
+       $(call autoconf_bool,CONFIG_FS_WITH_VPX,libvpx) \
+       $(if $(CONFIG_FS_WITH_FREETYPE),,--without-freetype) \
+       $(if $(CONFIG_FS_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)$(FS_LIB_DIR)") \
+       $(if $(CONFIG_FS_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
+       $(if $(CONFIG_FS_WITH_PNG),,--without-png)
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-16KHz),)
- $(eval $(call Download/files,sounds-en-16KHz,$(PKG_NAME)-sounds-en-us-callie-16000-1.0.50.tar.gz,261f42e310baa97cc4dcfdc51971aff8,,,))
-       MAKE_INSTALL_TARGETS+= hd-sounds-install
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-python3-esl)$(CONFIG_PACKAGE_freeswitch-mod-python3),)
+CONFIGURE_ARGS+= \
+       --with-python3=$(STAGING_DIR_HOST)/bin/python3
+else
+CONFIGURE_ARGS+= \
+       --with-python3=no
 endif
 
-
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-32KHz),)
- $(eval $(call Download/files,sounds-en-32KHz,$(PKG_NAME)-sounds-en-us-callie-32000-1.0.50.tar.gz,f204512fadc49a3267ff4a5e899b77a5,,,))
-       MAKE_INSTALL_TARGETS+= uhd-sounds-install
+ifeq ($(CONFIG_PACKAGE_freeswitch-mod-erlang-event)$(CONFIG_PACKAGE_freeswitch-mod-kazoo),)
+CONFIGURE_ARGS+= \
+       --with-erlang=no
 endif
 
-
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-48KHz),)
- $(eval $(call Download/files,sounds-en-48KHz,$(PKG_NAME)-sounds-en-us-callie-48000-1.0.50.tar.gz,8622a77a5d6dcf5e47bdf30d6a33e27c,,,))
-       MAKE_INSTALL_TARGETS+= cd-sounds-install
+# FreeSWITCH dropped postgresql support from the core. postgresql
+# support is now available via mod_pgsql. We still need to pass
+# '--without-pgsql', otherwise apr-util links to libpq and we still
+# would have the core link to it.
+CONFIGURE_ARGS+= \
+       --without-pgsql
+
+# Don't want host-php
+CONFIGURE_VARS+= \
+       ac_cv_have_php=no \
+       ac_cv_have_php_config=no \
+       ac_cv_prog_PHP=false \
+       ac_cv_prog_PHP_CONFIG=false
+
+# The autoconf variables in this block are OK for both musl and glibc
+CONFIGURE_VARS+= \
+       ac_cv_dev_urandom=yes \
+       ac_cv_file__dev_ptmx=yes \
+       ac_cv_file__dev_urandom=yes \
+       ac_cv_file_dbd_apr_dbd_mysql_c=no \
+       ac_cv_free_null=yes \
+       ac_cv_func_mmap_fixed_mapped=yes \
+       ac_cv_func_pthread_rwlock_init=yes \
+       ac_cv_func_sem_open=yes \
+       ac_cv_have_working_memmove=yes \
+       ac_cv_negative_eai=yes \
+       ac_cv_o_nonblock_inherited=no \
+       ac_cv_struct_rlimit=yes \
+       apr_cv_epoll=yes \
+       apr_cv_gai_addrconfig=yes \
+       apr_cv_mutex_recursive=yes \
+       apr_cv_process_shared_works=yes \
+       apr_cv_pthreads_lib=-lpthread \
+       apr_cv_tcp_nodelay_with_cork=yes \
+       apr_cv_type_rwlock_t=yes
+
+# fs_cli
+CONFIGURE_VARS+= \
+       disable_cc=yes
+
+# Regarding apr_cv_mutex_robust_shared=no see
+# http://www.openwall.com/lists/musl/2016/11/26/1
+ifeq ($(call qstrip,$(CONFIG_LIBC)),musl)
+CONFIGURE_VARS+= \
+       apr_cv_mutex_robust_shared=no \
+       ac_cv_strerror_r_rc_int=yes
+else
+CONFIGURE_VARS+= \
+       apr_cv_mutex_robust_shared=yes
 endif
 
-
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-08KHz),)
- $(eval $(call Download/files,sounds-moh-08KHz,$(PKG_NAME)-sounds-music-8000-1.0.50.tar.gz,c1f62dc26360f39f8eb442d5efd0a3aa,,,))
-       MAKE_INSTALL_TARGETS+= moh-install
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-perl-esl)$(CONFIG_PACKAGE_freeswitch-mod-perl),)
+CONFIGURE_VARS+= \
+       PERL="$(STAGING_DIR_HOSTPKG)/usr/bin/perl$(PERL_VERSION)" \
+       PERL_CFLAGS="-D_LARGEFILE_SOURCE $(if $(CONFIG_USE_MUSL),-D_LARGEFILE64_SOURCE) -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -I$(STAGING_DIR)$(PERL_SITELIB)/CORE" \
+       PERL_INC="-I$(STAGING_DIR)$(PERL_SITELIB)/CORE" \
+       PERL_LDFLAGS="-Wl,-rpath,$(PERL_SITELIB)/CORE -L$(STAGING_DIR)$(PERL_SITELIB)/CORE -lperl" \
+       PERL_LIBDIR="-L$(PERL_SITELIB)/CORE" \
+       PERL_LIBS="$(FS_PERL_LIBS) $(EXTRA_LIBDIRS:%=-L%) $(EXTRA_LIBS:%=-l%)" \
+       PERL_SITEDIR="$(PERL_SITELIB)"
+else
+CONFIGURE_VARS+= \
+       ac_cv_have_perl=no \
+       ac_cv_prog_PERL=false
 endif
 
-
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-16KHz),)
- $(eval $(call Download/files,sounds-moh-16KHz,$(PKG_NAME)-sounds-music-16000-1.0.50.tar.gz,d253e26baa85e0e2e727a1cb1cca898e,,,))
-       MAKE_INSTALL_TARGETS+= hd-moh-install
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-python3-esl)$(CONFIG_PACKAGE_freeswitch-mod-python3),)
+CONFIGURE_VARS+= \
+       PYTHON3_CFLAGS="-I$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION)" \
+       PYTHON3_LDFLAGS="-lpython$(PYTHON3_VERSION)" \
+       PYTHON3_LIB="python$(PYTHON3_VERSION)" \
+       PYTHON3_LIBDIR="$(FS_LIB_DIR)" \
+       PYTHON3_SITE_DIR="$(FS_PYTHON3_SITE_DIR)"
 endif
 
+# mod_radius_cdr runs configure in libs/freeradius-client. Let
+# freeradius-client know /dev/urandom is available on target devices.
+MAKE_VARS+= \
+       ac_cv_dev_urandom=yes
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-32KHz),)
- $(eval $(call Download/files,sounds-moh-32KHz,$(PKG_NAME)-sounds-music-32000-1.0.50.tar.gz,0e3ee69cb4ba2813ed0d3f7811332b63,,,))
-       MAKE_INSTALL_TARGETS+= uhd-moh-install
+# Make sphinxbase use fixed point math when soft float support is
+# enabled on target devices.
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+MAKE_VARS+= \
+       FS_USE_FIXED_POINT="--enable-fixed"
 endif
 
+# Some common URLs
+FS_LIBS_URL:=https://files.freeswitch.org/downloads/libs
+FS_SPHINX_URL:=@SF/cmusphinx
 
-ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-48KHz),)
- $(eval $(call Download/files,sounds-moh-48KHz,$(PKG_NAME)-sounds-music-48000-1.0.50.tar.gz,873a62df1ab3be4191eb2488156ec2c2,,,))
-       MAKE_INSTALL_TARGETS+= cd-moh-install
-endif
+# mod_event_zmq
+FS_ZEROMQ_FILE:=zeromq-2.1.9.tar.gz
+FS_ZEROMQ_HASH:=f3542f756687e622beef3a75c8e027fe2d95d4654350cbca4c070ffc58d9ace0
+FS_ZEROMQ_URL:=http://download.zeromq.org
 
+# mod_pocketsphinx
+FS_POCKETSPHINX_FILE:=pocketsphinx-0.8.tar.gz
+FS_POCKETSPHINX_HASH:=874c4c083d91c8ff26a2aec250b689e537912ff728923c141c4dac48662cce7a
 
-#
-# XXX: -fgnu89-inline is not supported on all compiler versions, so only enable it on avr32 where it solves build issues
-#
-ifneq ($(CONFIG_avr32),)
-  TARGET_CFLAGS += -fgnu89-inline
-  TARGET_CXXFLAGS += -fgnu89-inline
-endif
+FS_SPHINXBASE_FILE:=sphinxbase-0.8.tar.gz
+FS_SPHINXBASE_HASH:=55708944872bab1015b8ae07b379bf463764f469163a8fd114cbb16c5e486ca8
 
+FS_SPHINXMODEL_FILE:=communicator_semi_6000_20080321.tar.gz
+FS_SPHINXMODEL_HASH:=dbb5e9fb85000a7cb97d6958a3ef8d77532dc55fc730ac6979705e8645cb0c18
 
-ifneq ($(CONFIG_USE_EGLIBC),)
-  ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
-    TARGET_CFLAGS += -DNO_GETLOGIN
-  endif
-endif
+# mod_radius_cdr
+FS_FREERADIUS_CLIENT_FILE:=freeradius-client-1.1.7.tar.gz
+FS_FREERADIUS_CLIENT_HASH:=eada2861b8f4928e3ac6b5bbfe11e92cd6cdcacfce40cae1085e77c1b6add0e9
 
-
-ifeq ($(CONFIG_LIBC),musl)
-       TARGET_CFLAGS += -D_GNU_SOURCE
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-event-zmq),)
+$(eval $(call Download/files,zmq,$(FS_ZEROMQ_FILE),$(FS_ZEROMQ_URL),$(FS_ZEROMQ_HASH)))
 endif
 
-
-MAKE_FLAGS += \
-       AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
-       CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
-       CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
-       RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
-       CC_FOR_BUILD="$(HOSTCC)" \
-
-
-MAKE_VARS += \
-       OPT_FLAGS+="$(TARGET_CFLAGS)"
-
-
-CONFIGURE_ARGS+= \
-       --host=$(GNU_TARGET_NAME) \
-       --build=$(GNU_HOST_NAME) \
-       --prefix="/usr/share/$(PKG_NAME)" \
-       --bindir="/usr/bin" \
-       --libdir="/usr/lib" \
-       --srcdir="$(PKG_BUILD_DIR)" \
-       --sysconfdir="/etc" \
-       --with-modinstdir="/usr/lib/$(PKG_NAME)" \
-       --with-random="/dev/urandom" \
-       $(call autoconf_bool,CONFIG_FS_WITH_BUILTIN_ZRTP,zrtp) \
-       $(call autoconf_bool,CONFIG_FS_WITH_CORE_LIBEDIT_SUPPORT,core-libedit-support) \
-       $(call autoconf_bool,CONFIG_FS_WITH_FHS,fhs) \
-       $(call autoconf_bool,CONFIG_FS_WITH_APR_IPV6,ipv6) \
-       $(call autoconf_bool,CONFIG_FS_WITH_LIBVPX,libvpx) \
-       $(call autoconf_bool,CONFIG_FS_WITH_LIBYUV,libyuv) \
-       $(call autoconf_bool,CONFIG_FS_WITH_LZMA,lzma) \
-       $(call autoconf_bool,CONFIG_FS_WITH_ODBC,core-odbc-support) \
-       $(call autoconf_bool,CONFIG_FS_WITH_OPT,optimization) \
-       $(call autoconf_bool,CONFIG_FS_WITH_POSTGRESQL,core-pgsql-pkgconfig) \
-       $(call autoconf_bool,CONFIG_FS_WITH_POSTGRESQL,core-pgsql-support) \
-       $(call autoconf_bool,CONFIG_FS_WITH_SILENT_RULES,silent-rules) \
-       $(call autoconf_bool,CONFIG_FS_WITH_SRTP,srtp) \
-       $(call autoconf_bool,CONFIG_FS_WITH_SRTP_GENERIC_AESICM,generic-aesicm) \
-       $(call autoconf_bool,CONFIG_FS_WITH_SRTP_KERNEL_LINUX,kernel-linux) \
-       $(call autoconf_bool,CONFIG_FS_WITH_SRTP_OPENSSL,openssl) \
-       $(call autoconf_bool,CONFIG_FS_WITH_STUN,stun) \
-       $(call autoconf_bool,CONFIG_FS_WITH_APR_THREADS,threads) \
-       $(call autoconf_bool,CONFIG_FS_WITH_VISIBILITY,visibility) \
-       $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp && CONFIG_FS_WITH_FIXED_POINT,fixed-point) \
-       $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-timerfd,timerfd-wrapper) \
-       $(if $(CONFIG_FS_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)/usr/lib") \
-       $(if $(CONFIG_FS_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
-       $(if $(CONFIG_FS_WITH_OGG),--with-ogg="$(STAGING_DIR)/usr") \
-       $(if $(CONFIG_FS_WITH_OPENSSL),--with-openssl="pkg-config") \
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),--with-erlang="$(CONFIG_FS_WITH_ERLANG)",--without-erlang) \
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-java),--with-java="$(STAGING_DIR)/usr",--without-java) \
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-python),--with-python="$(CONFIG_FS_WITH_PYTHON_PATH)",--without-python) \
-       $(if ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-cdr)|$(CONFIG_PACKAGE_$(PKG_NAME)-mod-xml-curl)),--with-libcurl="$(STAGING_DIR)/usr",--without-libcurl) \
-       --with$(if $(CONFIG_FS_WITH_MYSQL),,out)-mysql \
-       --with$(if $(CONFIG_FS_WITH_POSTGRESQL),,out)-pgsql \
-       --with$(if $(CONFIG_FS_WITH_SQLITE3),,out)-sqlite3 \
-
-
-ifeq ($(CONFIG_TARGET_ARCH_PACKAGES),"kirkwood")
-       CONFIGURE_ARGS+= --enable-arm5e-asm \
-
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-pocketsphinx)$(CONFIG_PACKAGE_freeswitch-misc-grammar),)
+$(eval $(call Download/files,pocketsphinx,$(FS_POCKETSPHINX_FILE),$(FS_SPHINX_URL),$(FS_POCKETSPHINX_HASH)))
+$(eval $(call Download/files,sphinxbase,$(FS_SPHINXBASE_FILE),$(FS_SPHINX_URL),$(FS_SPHINXBASE_HASH)))
+$(eval $(call Download/files,communicator,$(FS_SPHINXMODEL_FILE),$(FS_LIBS_URL),$(FS_SPHINXMODEL_HASH)))
 endif
 
-
-#ifeq ($(CONFIG_LIBC),"uClibc")
-ifeq ($(CONFIG_ARCH),"mips")
-       CONFIGURE_VARS+= \
-               ac_cv_file_dbd_apr_dbd_mysql_c="no" \
-
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-radius-cdr),)
+$(eval $(call Download/files,freeradius-client,$(FS_FREERADIUS_CLIENT_FILE),$(FS_LIBS_URL),$(FS_FREERADIUS_CLIENT_HASH)))
 endif
-#endif
-
 
 define Build/Prepare
        $(call Build/Prepare/Default)
-       $(call Prepare/event-zmq)
-       $(call Prepare/json-cdr)
-       $(call Prepare/mongo)
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-08KHz),$(call Prepare/sounds-en-08KHz))
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-16KHz),$(call Prepare/sounds-en-16KHz))
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-32KHz),$(call Prepare/sounds-en-32KHz))
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-48KHz),$(call Prepare/sounds-en-48KHz))
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-08KHz),$(call Prepare/sounds-moh-08KHz))
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-16KHz),$(call Prepare/sounds-moh-16KHz))
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-32KHz),$(call Prepare/sounds-moh-32KHz))
-       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-48KHz),$(call Prepare/sounds-moh-48KHz))
-ifeq ($(CONFIG_FS_WITH_LOCAL_SOURCE),y)
-       (cd $(PKG_BUILD_DIR); $(if $(CONFIG_FS_WITH_LATEST_HEAD),if $(QUILT_CMD) top > /dev/null 2>&1 && [ -f $(PKG_BUILD_DIR)/patches/series ]; then $(QUILT_CMD) pop -a; fi; git pull;) if $(QUILT_CMD) next > /dev/null 2>&1; then $(QUILT_CMD) push -a; fi)
-endif
-       (cd $(PKG_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap.sh)
-endef
 
+       echo '#applications/mod_random' >> $(PKG_BUILD_DIR)/modules.conf
+       echo '#codecs/mod_yuv' >> $(PKG_BUILD_DIR)/modules.conf
+       echo '#event_handlers/mod_event_test' >> $(PKG_BUILD_DIR)/modules.conf
+endef
 
 define Build/Configure
+       $(SED) '/^#/!s/^/#/' $(PKG_BUILD_DIR)/modules.conf
        $(foreach m,$(FS_MOD_AVAILABLE),
-               $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-$(m)),
-                       $(SED) 's|^[ #]*\([^#]*/mod_$(subst -,_,$(m))\)$$$$|\1|g' $(PKG_BUILD_DIR)/modules.conf
-               ,
-                       $(SED) 's|^\([^#]*/mod_$(subst -,_,$(m))\)$$$$|#\1|g' $(PKG_BUILD_DIR)/modules.conf
-               )
-       )
-       $(call Build/Configure/Default)
-endef
-
-
-define Build/Compile
-       $(call Build/Compile/Default, \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all $(MAKE_INSTALL_TARGETS) \
-       )
-       $(SED) 's|^\([ \t]*\)\(.*\)"mod_console"\(.*\)$$$$|\1<!-- \2"mod_console"\3 -->|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
-       $(SED) 's|^\([ \t]*\)<!-- *\(.*\)"mod_syslog"\(.*\) *-->\(.*\)$$$$|\1\2"mod_syslog"\3\4|' $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
-endef
-
-
-define Package/$(PKG_NAME)/install
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_DIR) $(1)/etc/default
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/scripts
-       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
-       $(INSTALL_DATA) ./files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
-       $(INSTALL_DATA) ./files/$(PKG_NAME).default $(1)/etc/default/$(PKG_NAME)
-       $(INSTALL_DATA) ./files/$(PKG_NAME).hotplug $(1)/etc/hotplug.d/iface/90-$(PKG_NAME)
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME)* $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(PKG_NAME).pc $(1)/usr/lib/pkgconfig/
-       $(if $(1)/usr/lib/lib$(PKG_NAME).la,$(STAGING_DIR_HOST)/bin/sed -i -re 's|$(STAGING_DIR)||g;s|$(TOOLCHAIN_DIR)||g;s|$(TARGET_CROSS)|usr|g;s|$(REAL_GNU_TARGET_NAME)|usr|g;s|-L$(PKG_BUILD_DIR)(.*)libzrtp ||g;:a;s|((-[IL]/\S+\s).*)\2|\1|;ta' $(1)/usr/lib/lib$(PKG_NAME).la)
-endef
-
-
-define Package/$(PKG_NAME)-collection-upstream-defaults/install
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
-endef
-
-
-define Package/$(PKG_NAME)-example-config/install
-       $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/examples/conf
-       $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME)/* $(1)/usr/share/$(PKG_NAME)/examples/conf/
-endef
-
-
-define Package/$(PKG_NAME)-config-upstream-defaults/install
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
-       $(CP) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME) $(1)/etc
-endef
-
-
-define Package/$(PKG_NAME)-collection-minimal/install
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
-endef
-
-
-define Package/$(PKG_NAME)-collection-uci-minimal/install
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)
-endef
-
-
-define Package/$(PKG_NAME)-config-minimal/install
-       $(INSTALL_DIR) $(1)/etc/$(PKG_NAME)/autoload_configs
-
-       #
-       # Copying dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml
-       # fur_elise.ttml mime.types tetris.ttml tones.conf vars.xml
-       #
-       $(foreach f,dialplan directory jingle_profiles sip_profiles $(PKG_NAME).xml fur_elise.ttml mime.types tetris.ttml vars.xml,$(if $(PKG_BUILD_DIR)/conf/vanilla/$(f),$(CP) $(PKG_BUILD_DIR)/conf/vanilla/$(f) $(1)/etc/$(PKG_NAME);))
-
-       #
-       # Copying acl ivr modules post_load_modules switch timezones
-       #
-       $(foreach f,acl ivr modules post_load_modules switch timezones,$(if $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml,$(CP) $(PKG_BUILD_DIR)/conf/vanilla/autoload_configs/$(f).conf.xml $(1)/etc/$(PKG_NAME)/autoload_configs;))
-endef
+               $(if $(CONFIG_PACKAGE_freeswitch-mod-$(subst _,-,$(m))),
+               $(call Package/freeswitch/enable/plugin,mod_$(m))))
 
+# Some of the dependencies that necessitate below hacks are documented in
+# src/mod/Makefile.am.
 
-define Package/$(PKG_NAME)-sounds-en-08KHz/install
-       #
-       # sounds-en-8KHz
-       #
-       for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
-       do \
-               [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \
-               $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/8000; \
-       done
-endef
-
-
-define Package/$(PKG_NAME)-sounds-en-16KHz/install
-       #
-       # sounds-en-16KHz
-       #
-       for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
-       do \
-               [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \
-               $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/16000; \
-       done
-endef
-
-
-define Package/$(PKG_NAME)-sounds-en-32KHz/install
-       #
-       # sounds-en-32KHz
-       #
-       for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
-       do \
-               [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \
-               $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/32000; \
-       done
-endef
-
+# Hack for misc-grammar - needs mod_pocketsphinx to provide grammar files
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-grammar),)
+       $(call Package/freeswitch/enable/plugin,mod_pocketsphinx)
+endif
 
-define Package/$(PKG_NAME)-sounds-en-48KHz/install
-       #
-       # sounds-en-48KHz
-       #
-       for dir in `(cd $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie;ls)`; \
-       do \
-               [ -d $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \
-               $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000/* $(1)/usr/share/$(PKG_NAME)/sounds/en/us/callie/$$$${dir}/48000; \
-       done
-endef
+# Hack for mod_gsmopen - it has a build-time dep on mod_spandsp
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-gsmopen),)
+       $(call Package/freeswitch/enable/plugin,mod_spandsp)
+endif
 
+# Hack for mod_ssml - it has a build-time dep on mod_rayo.
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-ssml),)
+       $(call Package/freeswitch/enable/plugin,mod_rayo)
+endif
 
-define Package/$(PKG_NAME)-sounds-moh-08KHz/install
-       #
-       # sounds-moh-8KHz
-       #
-       [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/8000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/8000;
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/8000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
+       $(call Build/Configure/Default)
 endef
 
+define Build/Compile
+# Copy some source files if certain modules are selected
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-event-zmq),)
+       $(CP) $(DL_DIR)/$(FS_ZEROMQ_FILE) $(PKG_BUILD_DIR)/libs
+endif
 
-define Package/$(PKG_NAME)-sounds-moh-16KHz/install
-       #
-       # sounds-moh-16KHz
-       #
-       [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/16000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/16000;
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/16000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
-endef
-
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-pocketsphinx)$(CONFIG_PACKAGE_freeswitch-misc-grammar),)
+       $(CP) $(DL_DIR)/$(FS_POCKETSPHINX_FILE) $(PKG_BUILD_DIR)/libs
+       $(CP) $(DL_DIR)/$(FS_SPHINXBASE_FILE) $(PKG_BUILD_DIR)/libs
+       $(CP) $(DL_DIR)/$(FS_SPHINXMODEL_FILE) $(PKG_BUILD_DIR)/libs
+endif
 
-define Package/$(PKG_NAME)-sounds-moh-32KHz/install
-       #
-       # sounds-moh-32KHz
-       #
-       [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/32000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/32000;
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/32000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
-endef
+ifneq ($(CONFIG_PACKAGE_freeswitch-mod-radius-cdr),)
+       $(CP) $(DL_DIR)/$(FS_FREERADIUS_CLIENT_FILE) $(PKG_BUILD_DIR)/libs
+endif
 
+       $(call Build/Compile/Default)
 
-define Package/$(PKG_NAME)-sounds-moh-48KHz/install
-       #
-       # sounds-moh-48KHz
-       #
-       [ -d $(1)/usr/share/$(PKG_NAME)/sounds/music/48000 ] || $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/sounds/music/48000;
-       $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/sounds/music/48000 $(1)/usr/share/$(PKG_NAME)/sounds/music;
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-perl-esl),)
+       $(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl perlmod)
+endif
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-python3-esl),)
+       $(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl py3mod)
+endif
 endef
 
-
-define Package/$(PKG_NAME)-tools/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_cli $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_encode $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/fs_ivrd $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/fsxs $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/gentls_cert $(1)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/tone2wav $(1)/usr/bin/
-       $(STAGING_DIR_HOST)/bin/sed -i -re 's|$(ICONV_LDFLAGS)||g;s|$(INTL_LDFLAGS)||g;s|$(PKG_BUILD_DIR)|/usr|g;s|$(STAGING_DIR)||g;s|$(STAGING_DIR_HOST)|/usr|g;s|$(TOOLCHAIN_DIR)||g;s|$(TARGET_CROSS)|usr|g;s|$(REAL_GNU_TARGET_NAME)|usr|g;:a;s|((-[IL]/\S+\s).*)[ ,\n]\1|\1|;ta' $(1)/usr/bin/fsxs
+define Build/Install
+       $(call Build/Install/Default)
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-perl-esl),)
+       $(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl DESTDIR=$(PKG_INSTALL_DIR) perlmod-install)
+endif
+ifneq ($(CONFIG_PACKAGE_freeswitch-misc-python3-esl),)
+       $(call Build/Install/Default,-C $(PKG_BUILD_DIR)/libs/esl py3mod-install)
+endif
 endef
 
-
-# 1. Name
-# 2. Title
-# 3. Selection on module configuration file
-# 4. Files (module files include different names)
-# 5. Files (supporting files include different names)
-# 6. Inter module depends
-# 7. Extra depends
-#
-define BuildPlugin
-  define Package/$(PKG_NAME)-mod-$(1)
-    $$(call Package/$(PKG_NAME)/Default)
-    TITLE:= FS $(2) module
-    DEPENDS:= $(PKG_NAME) $(foreach m,$(6),+$(PKG_NAME)-mod-$(m)) $(7)
-  endef
-
-  define Package/$(PKG_NAME)-mod-$(1)/install
-       [ -z "mod_$(subst -,_,$(1))" ] || $(INSTALL_DIR) $$(1)/usr/lib/$(PKG_NAME)
-
-       for f in $$$$(realpath $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/mod_$(subst -,_,$(1)).*)) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)/$(4)_*); \
-       do \
-               $(CP) $$$$$$$${f} $$(1)/usr/lib/$(PKG_NAME)/; \
-       done
-
-       #
-       # mod_$(subst -,_,$(1)): $(5)
-       #
-       $(foreach f,$(5),[ -d $(dir $$(1)/usr/${f}) ] || $(INSTALL_DIR) $(dir $$(1)/usr/${f});$(CP) $$$$(wildcard $(PKG_INSTALL_DIR)/usr/${f}*) $(dir $$(1)/usr/${f});)
-
-       #
-       # mod_$(subst -,_,$(1)): Clean installed library control files from referencig to OpenWRT PATH.
-       #
-       $(STAGING_DIR_HOST)/bin/sed -i -re 's|$(STAGING_DIR)||g;s|$(TOOLCHAIN_DIR)||g;s|$(TARGET_CROSS)|usr|g;s|$(REAL_GNU_TARGET_NAME)|usr|g;s|-L$(PKG_BUILD_DIR)(.*)libzrtp ||g;s|-L$(PKG_BUILD_DIR)(.*)libtiff ||g;:a;s|((-[IL]/\S+\s).*)\2|\1|;ta' $(foreach l,`find $$(1)/usr/lib -name "*.la" -print`,$(l))
-
-       #
-       # 1. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)))
-       #
-       $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml)
-
-       #
-       # 2. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)))
-       #
-       $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/$(3)/$(1)/*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml)
-
-       #
-       # 3. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)))
-       #
-       $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf/autoload_configs/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml)
-
-       #
-       # 4. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)))
-       #
-       $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/conf*/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml)
-
-       #
-       # 5. mod_$(subst -,_,$(1)) XML configuration files from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)))
-       #
-       $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)),[ -d $$(1)/etc/$(PKG_NAME)/autoload_configs ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(CP) $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/src/$(3)/*/mod_$(subst -,_,$(1))/$(subst -,_,$(1)).conf.xml)) $$(1)/etc/$(PKG_NAME)/autoload_configs;$(SED) 's|/usr/local/lib|/usr/lib|g;s|/usr/local|/etc|g' $$(1)/etc/$(PKG_NAME)/autoload_configs/$(subst -,_,$(1)).conf.xml)
-
-       #
-       # 6. Additional configuration files for mod_$(subst -,_,$(1)) from: $$$$(patsubst $(PKG_BUILD_DIR)/%,%,$$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1))))
-       #
-       $$$$(if $$$$(firstword $$$$(wildcard $(PKG_BUILD_DIR)/conf/$(3)/$(1)/*.$(1))),[ -d $$(1)/etc/$(PKG_NAME)/$(1) ] || $(INSTALL_DIR) $$(1)/etc/$(PKG_NAME)/$(1);$(CP) $(PKG_BUILD_DIR)/conf/$(3)/$(1) $$(1)/etc/$(PKG_NAME))
-  endef
-
-  define Package/$(PKG_NAME)-mod-$(1)/postinst
-#!/bin/sh
-sed -i -e 's#[^ \t]\(,*\)\(.*\)"mod_console"/>\(.*\)$$$$#\1<load module="mod_console"/>#g' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
-exit 0
-  endef
-
-  define Package/$(PKG_NAME)-mod-$(1)/prerm
-#!/bin/sh
-sed -i -e 's#[^ \t]\(,*\)\(.*\)"mod_console"/>\(.*\)$$$$#\1<!-- <load module="mod_console"/> -->#g' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
-exit 0
-  endef
-
-  $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)$(FS_INCLUDES_DIR) $(1)$(FS_LIB_DIR) \
+                                               $(1)$(FS_PKGCONFIG_DIR)
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)$(FS_INCLUDES_DIR)/*.h \
+                                               $(1)$(FS_INCLUDES_DIR)
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(FS_PKGCONFIG_DIR)/freeswitch.pc \
+                                               $(1)$(FS_PKGCONFIG_DIR)
+       $(CP) $(PKG_INSTALL_DIR)$(FS_LIB_DIR)/libfreeswitch.so* \
+                                               $(1)$(FS_LIB_DIR)
 endef
 
-
-$(eval $(call BuildPackage,$(PKG_NAME)))
-$(eval $(call BuildPackage,$(PKG_NAME)-collection-upstream-defaults))
-$(eval $(call BuildPackage,$(PKG_NAME)-collection-minimal))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-08KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-16KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-32KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-en-48KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-08KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-16KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-32KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-sounds-moh-48KHz))
-$(eval $(call BuildPackage,$(PKG_NAME)-tools))
-$(eval $(call BuildPackage,$(PKG_NAME)-example-config))
-$(eval $(call BuildPackage,$(PKG_NAME)-config-upstream-defaults))
-$(eval $(call BuildPackage,$(PKG_NAME)-config-minimal))
-
-
-#
-# $(eval $(call BuildPlugin,Name,Title,Selection on module Conf File,Files,Inter Depends,Extra Depends))
-#
-$(eval $(call BuildPlugin,abstraction,An Abstraction To API Call,vanilla,,,,))
-$(eval $(call BuildPlugin,alsa,Alsa Endpoint,vanilla,,,,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA))
-$(eval $(call BuildPlugin,amr,Adaptive Multi-Rate On Bandwidth Codec,vanilla,,,,))
-$(eval $(call BuildPlugin,amrwb,Wide Band AMR,vanilla,,,,))
-$(eval $(call BuildPlugin,av,FS Video Codec / File Format,vanilla,,,,@BROKEN))
-$(eval $(call BuildPlugin,avmd,Advanced Voice Mail Detection,vanilla,,,,))
-$(eval $(call BuildPlugin,basic,BASIC,vanilla,,,,))
-$(eval $(call BuildPlugin,bert,Naive Bit Error Rate Tester,vanilla,,,,))
-$(eval $(call BuildPlugin,blacklist,Blacklist,vanilla,,,,))
-$(eval $(call BuildPlugin,bv,BroadVoice 16/32-bit Audio Codec,vanilla,,,,@BROKEN)) # Requires unsupported libbroadvoice
-$(eval $(call BuildPlugin,callcenter,Call Center,vanilla,,,,))
-$(eval $(call BuildPlugin,cdr-csv,CSV-CDR Handler,mod,,,,)) # ~/conf
-$(eval $(call BuildPlugin,cdr-mongodb,MongoDB CDR logger,vanilla,,,,))
-$(eval $(call BuildPlugin,cdr-pg-csv,PostgreSQL CDR Handler,vanilla,,,,+coreutils +FS_WITH_POSTGRESQL:libpq @FS_WITH_POSTGRESQL))
-$(eval $(call BuildPlugin,cdr-sqlite,SQLite3 CDR Handler,vanilla,,,,@FS_WITH_SQLITE3))
-$(eval $(call BuildPlugin,cepstral,Cepstral Interface,vanilla,,,,@BROKEN)) # needs <swift.h>
-$(eval $(call BuildPlugin,cidlookup,Data Query For CID->NAME Services,mod,,,,+libcurl)) # ~/conf
-$(eval $(call BuildPlugin,cluechoo,Framework Demo,vanilla,,,,))
-$(eval $(call BuildPlugin,codec2,CoDec 2,,,,,@BROKEN)) # Requires unsupported libcodec2
-$(eval $(call BuildPlugin,commands,API Commands,vanilla,,,,))
-$(eval $(call BuildPlugin,conference,Conference Room,vanilla,,,,))
-$(eval $(call BuildPlugin,console,Console Logger,vanilla,,,,))
-$(eval $(call BuildPlugin,curl,HTTP Request,vanilla,,,,+libcurl))
-$(eval $(call BuildPlugin,cv,Detect Video motion,vanilla,,,,@BROKEN))
-$(eval $(call BuildPlugin,dahdi-codec,DAHDI Codecs,vanilla,,,,))
-$(eval $(call BuildPlugin,db,Database Backend,vanilla,,,,+libdb47))
-$(eval $(call BuildPlugin,dialplan-asterisk,Asterisk Dialplan Parser,vanilla,,,,))
-$(eval $(call BuildPlugin,dialplan-directory,Dialplan Directory,vanilla,,,,))
-$(eval $(call BuildPlugin,dialplan-xml,Dialplan-XML Interface,vanilla,,,,))
-$(eval $(call BuildPlugin,dingaling,Jabber Interface,vanilla,,,,+libopenssl))
-$(eval $(call BuildPlugin,directory,Search By Name Directory IVR,vanilla,,,,))
-$(eval $(call BuildPlugin,distributor,Simple Robin-Round Load,vanilla,,,,))
-$(eval $(call BuildPlugin,dptools,Dialplan Tools,vanilla,,,,))
-$(eval $(call BuildPlugin,easyroute,Simple DID Routing,vanilla,,,,))
-$(eval $(call BuildPlugin,enum,ENUM Routing,,,,,+libldns))
-$(eval $(call BuildPlugin,erlang-event,Erlang Event Handler,vanilla,,,,+erlang))
-$(eval $(call BuildPlugin,esf,Extra SIP Functionality,vanilla,,,,))
-$(eval $(call BuildPlugin,esl,Allow to generate remote ESL commands,vanilla,,,,@BROKEN))
-$(eval $(call BuildPlugin,event-multicast,Multicast Event Handler,vanilla,,,,))
-$(eval $(call BuildPlugin,event-socket,Socket Event Handler,vanilla,,,,))
-$(eval $(call BuildPlugin,event-zmq,Socket Event Handler By Zero MQ,vanilla,,,,+libuuid))
-$(eval $(call BuildPlugin,expr,Expression Evaluation,vanilla,,,,))
-$(eval $(call BuildPlugin,fifo,FIFO,vanilla,,,,))
-$(eval $(call BuildPlugin,file-string,Streaming Multiple Sound Files Sequentially,vanilla,,,,@OBSOLETE)) # merged into dptools
-#$(eval $(call BuildPlugin,flite,Festival TTS,vanilla,,,,+flite @BROKEN)) # flite is from old package repo
-$(eval $(call BuildPlugin,format-cdr,XML CDR Module to files or curl,vanilla,,,,))
-$(eval $(call BuildPlugin,fsk,Bell-202 1200-Baud FSK Decoder,vanilla,,,,))
-#$(eval $(call BuildPlugin,fsv,Video Player / Recorder,vanilla,,,,+libyuv @BROKEN)) # Requires unsupported libyuv.
-$(eval $(call BuildPlugin,g723-1,G.723.1 Codec,vanilla,,,,))
-$(eval $(call BuildPlugin,g729,G.729 Codec,vanilla,,,,))
-$(eval $(call BuildPlugin,graylog2,Graylog2 GELF logger,vanilla,,,,))
-$(eval $(call BuildPlugin,gsmopen,GSM Modem compatible Endpoint,mod,,,alsa,+FS_WITH_ALSA:alsa-lib +FS_WITH_LZMA:liblzma @FS_WITH_ALSA @BROKEN)) # needs gsmlib
-$(eval $(call BuildPlugin,h26x,H26X Linear Codec,vanilla,,,,))
-#$(eval $(call BuildPlugin,h323,H323 Endpoint,mod,,,,@BROKEN)) # Req. H323Plus v1.24.x or newer
-$(eval $(call BuildPlugin,hash,API For Manipulating A Hash Table,vanilla,,,,))
-$(eval $(call BuildPlugin,hiredis,Redis DB access,vanilla,,,,+libhiredis @BROKEN))
-#$(eval $(call BuildPlugin,html5,HTML5 Endpoint Module,vanilla,,,,)) # defunct?
-$(eval $(call BuildPlugin,httapi,HT Telephony API and HTTP Caching,mod,,,,)) # ~/conf
-$(eval $(call BuildPlugin,http-cache,HTTP GET With Caching,mod,,,,+libcurl)) # ~/conf
-#$(eval $(call BuildPlugin,ilbc,ILBC Codec,vanilla,,,,+libilbc @BROKEN)) # Requires unsupported libilbc.
-$(eval $(call BuildPlugin,isac,iSAC Codec,vanilla,,,,))
-#$(eval $(call BuildPlugin,java,Java Language Interface,vanilla,,,,@BROKEN)) # needs java
-$(eval $(call BuildPlugin,json-cdr,JSon-CDR Interface,mod,,,,+libcurl))
-$(eval $(call BuildPlugin,kazoo,Socket Controlled Event Handler,vanilla,,,,+erlang))
-$(eval $(call BuildPlugin,ldap,LDAP interface,vanilla,,,,+libopenldap))
-$(eval $(call BuildPlugin,lcr,Least Cost Routing,vanilla,,,,))
-$(eval $(call BuildPlugin,local-stream,Multi-Channel On Same Stream,vanilla,,,,))
-$(eval $(call BuildPlugin,logfile,File Logger,vanilla,,,,))
-$(eval $(call BuildPlugin,loopback,Loopback to Dialplan Endpoint,vanilla,,,,))
-$(eval $(call BuildPlugin,lua,LUA Language Interface,vanilla,,,,+liblua))
-#$(eval $(call BuildPlugin,managed,Media Switching Software Library,vanilla,,,,+glib2 @BROKEN)) # needs Mono
-#$(eval $(call BuildPlugin,memcache,MemCached Interface,vanilla,,,,+libmemcached @BROKEN)) # Req host libmemcached
-#$(eval $(call BuildPlugin,mongo,A Document-Oriented Database,vanilla,,,,@BROKEN))
-#$(eval $(call BuildPlugin,mp4,MP4 File Format Support For Video,vanilla,,,,@BROKEN)) # needs host libmp4v2
-$(eval $(call BuildPlugin,mp4v,MP4 CoDec Support For Video,vanilla,,,,))
-$(eval $(call BuildPlugin,native-file,WAV Format Sound Player,vanilla,,,,))
-$(eval $(call BuildPlugin,nibblebill,Credit / Debit Billing,vanilla,,,,))
-$(eval $(call BuildPlugin,opus,Opus CoDec,vanilla,,,,+libopus))
-$(eval $(call BuildPlugin,oreka,Media Recording with Oreka,vanilla,,,,))
-$(eval $(call BuildPlugin,png,play a png as video with audio,vanilla,,,,+libpng))
-$(eval $(call BuildPlugin,perl,Perl Language Interface,vanilla,,lib/perl5/$(PERL_VERSION)/CORE/$(PKG_NAME).la lib/perl5/$(PERL_VERSION)/CORE/$(PKG_NAME).pm lib/perl5/$(PERL_VERSION)/CORE/$(PKG_NAME).so,,+perl +libdb47 +libgdbm))
-$(eval $(call BuildPlugin,portaudio,Portaudio To Sound Card Interface,vanilla,,,alsa,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA @BROKEN)) # needs portaudio
-$(eval $(call BuildPlugin,portaudio-stream,Portaudio Streaming Interface,vanilla,,,alsa,+FS_WITH_ALSA:alsa-lib @FS_WITH_ALSA @BROKEN)) # needs portaudio
-$(eval $(call BuildPlugin,posix-timer,POSIX Compliant Soft Timer,vanilla,,,,))
-$(eval $(call BuildPlugin,prefix,longest-prefix match in store,mod,,,,))
-$(eval $(call BuildPlugin,python,Python Language Interface,vanilla,,lib/python$(PYTHON3_VERSION)/site-packages/freeswitch.py,,+FS_WITH_PYTHON:python3 @FS_WITH_PYTHON))
-#$(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,vanilla,,,,+freeradius3 @BROKEN)) # fails in freeradius-client
-$(eval $(call BuildPlugin,rayo,Rayo server & node implementation,vanilla,,,,))
-$(eval $(call BuildPlugin,redis,Redis limit backend,vanilla,,,,))
-$(eval $(call BuildPlugin,rss,RRS Feeds via TTS,vanilla,,,,))
-$(eval $(call BuildPlugin,rtc,RTC endpoint,vanilla,,,,))
-$(eval $(call BuildPlugin,rtmp,RTMP Protocol Handler,vanilla,,,,))
-#$(eval $(call BuildPlugin,sangoma-codec,Sangoma Codec,vanilla,,,,@BROKEN)) # Req. Sangoma CoDec source
-$(eval $(call BuildPlugin,say-de,German Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-en,English Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-es,Spanish Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-fa,Persian Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-fr,French Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-hu,Hungarian Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-it,Italian Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-nl,Dutch Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-pt,Portugeese Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-ru,Russian Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-th,Thai Say,vanilla,,,,))
-$(eval $(call BuildPlugin,say-zh,Chineese Say,vanilla,,,,))
-$(eval $(call BuildPlugin,shell-stream,Streaming Audio Through CLI,vanilla,,,,))
-#$(eval $(call BuildPlugin,silk,Skype(TM) SILK Codec Module,vanilla,,,,+libsilk @BROKEN)) # Requires unsupported libsilk
-#$(eval $(call BuildPlugin,siren,G.722.1 Codec,vanilla,,,,+libg7221 @BROKEN)) # Requires unsupported libg7221
-#$(eval $(call BuildPlugin,skel,Template For New Module,vanilla,,,,@BROKEN))
-$(eval $(call BuildPlugin,skinny,Skinny Call Control Protocol (SCCP),vanilla,,,,))
-$(eval $(call BuildPlugin,skypopen,Skype Compatible Endpoint,mod,,,,@FEATURE_drawing-backend_libX11))
-$(eval $(call BuildPlugin,sms,SMS,vanilla,,,,))
-#$(eval $(call BuildPlugin,smpp,smpp client and server implementation,vanilla,,,,@BROKEN))
-$(eval $(call BuildPlugin,snapshot,Record Audio Snapshot to File,vanilla,,,,))
-$(eval $(call BuildPlugin,sndfile,Multi-Format Sound File,vanilla,,,,+libsndfile))
-$(eval $(call BuildPlugin,snmp,SNMP AgentX Subagent,vanilla,,,,+libnetsnmp))
-$(eval $(call BuildPlugin,snom,SNOM specific features,vanilla,,,,))
-$(eval $(call BuildPlugin,sofia,SOFIA SIP,mod,,,,)) # ~/conf
-$(eval $(call BuildPlugin,sonar,Sonar Ping Timer,vanilla,,,,))
-$(eval $(call BuildPlugin,spandsp,Span DSP,mod,,,,+libjpeg +FS_WITH_LZMA:liblzma @FS_WITH_LZMA +libtiff)) # ~/conf
-$(eval $(call BuildPlugin,spidermonkey,JavaScript,vanilla,,,,@BROKEN)) # fails in js
-#$(eval $(call BuildPlugin,spidermonkey-core_db,JavaScript DB,vanilla,,,,@BROKEN))
-#$(eval $(call BuildPlugin,spidermonkey-curl,JavaScript Curl,vanilla,,,,@BROKEN))
-#$(eval $(call BuildPlugin,spidermonkey-odbc,JavaScript ODBC,vanilla,,,,@BROKEN))
-#$(eval $(call BuildPlugin,spidermonkey-socket,JavaScript Socket,vanilla,,,,@BROKEN))
-#$(eval $(call BuildPlugin,spidermonkey-teletone,JavaScript Teletone,vanilla,,,,@BROKEN))
-$(eval $(call BuildPlugin,spy,User Spy,vanilla,,,,))
-$(eval $(call BuildPlugin,ssml,SSML audio rendering format,mod,,,rayo,))
-$(eval $(call BuildPlugin,stress,Voice Stress Detection,vanilla,,,,))
-$(eval $(call BuildPlugin,syslog,SysLog logger,vanilla,,,,))
-$(eval $(call BuildPlugin,timerfd,Linux Kernel timerfd API,vanilla,,,,))
-$(eval $(call BuildPlugin,tone-stream,Tone Generation Stream,vanilla,,,,))
-$(eval $(call BuildPlugin,translate,Translate,vanilla,,,,))
-$(eval $(call BuildPlugin,tts-commandline,ASR TTS Command Interface,vanilla,,,,))
-#$(eval $(call BuildPlugin,unimrcp,UniMRCP (MRCP Client),vanilla,,,,@BROKEN))
-$(eval $(call BuildPlugin,valet-parking,Valet Parking Application,vanilla,,,,))
-$(eval $(call BuildPlugin,verto,HTML5 Verto interface,vanilla,,,perl rtc,+perl))
-$(eval $(call BuildPlugin,vmd,VoiceMail Beep Detection,vanilla,,,,))
-$(eval $(call BuildPlugin,voicemail,VoiceMail,vanilla,,,,))
-$(eval $(call BuildPlugin,voicemail-ivr,VoiceMail IVR,vanilla,,,,))
-$(eval $(call BuildPlugin,xml-cdr,XML-CDR Handler,vanilla,,,,+libcurl))
-$(eval $(call BuildPlugin,xml-curl,XML-Curl Gateway,vanilla,,,,+libcurl))
-$(eval $(call BuildPlugin,xml-ldap,LDAP-XML Gateway,vanilla,,,,+PACKAGE_$(PKG_NAME)-mod-ldap:libopenldap))
-$(eval $(call BuildPlugin,xml-rpc,XML-RPC Interface,vanilla,,,,))
-$(eval $(call BuildPlugin,xml-radius,Radius authentication and authorization,vanilla,,,,+freeradius3))
-$(eval $(call BuildPlugin,xml-scgi,SCGI XML Gateway,vanilla,,,,))
-$(eval $(call BuildPlugin,yaml,YAML language,vanilla,,,,+libyaml))
+$(eval $(call BuildPackage,freeswitch))
+$(eval $(call BuildPackage,freeswitch-misc-perl-esl))
+$(eval $(call BuildPackage,freeswitch-misc-python3-esl))
+$(eval $(call BuildPackage,freeswitch-misc-timezones))
+
+################################
+# FreeSWITCH example configs
+# Params:
+# 1 - Package subname
+################################
+
+$(eval $(call Package/freeswitch/Example,curl))
+$(eval $(call Package/freeswitch/Example,insideout))
+$(eval $(call Package/freeswitch/Example,minimal))
+$(eval $(call Package/freeswitch/Example,rayo))
+$(eval $(call Package/freeswitch/Example,sbc))
+$(eval $(call Package/freeswitch/Example,softphone))
+$(eval $(call Package/freeswitch/Example,testing))
+$(eval $(call Package/freeswitch/Example,vanilla))
+
+################################
+# FreeSWITCH language files
+# Params:
+# 1 - Language code
+# 2 - Language
+################################
+
+$(eval $(call Package/freeswitch/Language,de,German))
+$(eval $(call Package/freeswitch/Language,en,English))
+$(eval $(call Package/freeswitch/Language,es,Spanish))
+$(eval $(call Package/freeswitch/Language,fr,French))
+$(eval $(call Package/freeswitch/Language,he,Hebrew))
+$(eval $(call Package/freeswitch/Language,pt,Portuguese))
+$(eval $(call Package/freeswitch/Language,ru,Russian))
+$(eval $(call Package/freeswitch/Language,sv,Swedish))
+
+################################
+# FreeSWITCH misc packages
+# Params:
+# 1 - Package subname
+# 2 - Package title
+# 3 - Package description
+# 4 - Source dir relative to
+#     PKG_INSTALL_DIR
+# 5 - Dest dir relative to ipkg
+# 6 - Arch independent files
+################################
+
+$(eval $(call Package/freeswitch/Misc,misc-fonts,Fonts,This package includes the fonts bundled with FreeSWITCH.,$(FS_FONTS_DIR),$(FS_FONTS_DIR),y))
+$(eval $(call Package/freeswitch/Misc,misc-grammar,Grammar,This package contains grammar files. mod_pocketsphinx would be a\npotential user.,$(FS_GRAMMAR_DIR),$(FS_GRAMMAR_DIR),y))
+$(eval $(call Package/freeswitch/Misc,misc-images,Images,This package includes the images bundled with FreeSWITCH.,$(FS_IMAGES_DIR),$(FS_IMAGES_DIR),y))
+
+################################
+# FreeSWITCH modules
+# Params:
+# 1 - Package subname
+# 2 - Package title
+# 3 - Module description
+# 4 - Module dependencies
+################################
+
+$(eval $(call Package/freeswitch/Module,abstraction,API abstraction,This module provides a way to create new API functions via regex\nrewriting.,))
+$(eval $(call Package/freeswitch/Module,alsa,ALSA endpoint,ALSA endpoint module.,+alsa-lib))
+$(eval $(call Package/freeswitch/Module,amr,AMR passthrough,Passthrough AMR codec support.,))
+$(eval $(call Package/freeswitch/Module,amrwb,AMR wideband passthrough,Passthrough AMR wideband codec support.,))
+$(eval $(call Package/freeswitch/Module,av,AV,Video codec and format support via FFmpeg.,+libffmpeg-full @BROKEN @x86_64))
+$(eval $(call Package/freeswitch/Module,avmd,Voicemail detection,This module attempts to determine when a voicemail system has answered\nthe call.,))
+$(eval $(call Package/freeswitch/Module,b64,Base64,Transfers data Base64 encoded.,))
+$(eval $(call Package/freeswitch/Module,basic,BASIC,BASIC module for FreeSWITCH.,))
+$(eval $(call Package/freeswitch/Module,bert,BERT,Line testing tool.,))
+$(eval $(call Package/freeswitch/Module,blacklist,Blacklist helper,This module provides tools to blacklist callers.,))
+$(eval $(call Package/freeswitch/Module,callcenter,Call center,This module implements Automated Call Distribution queues.,))
+$(eval $(call Package/freeswitch/Module,cdr_csv,CSV CDR,CSV Call Detail Record handler.,))
+$(eval $(call Package/freeswitch/Module,cdr_mongodb,MongoDB CDR,MongoDB Call Detail Record handler.,))
+$(eval $(call Package/freeswitch/Module,cdr_pg_csv,PostgreSQL CDR,PostgreSQL Call Detail Record handler.,+libpq))
+$(eval $(call Package/freeswitch/Module,cdr_sqlite,SQLite CDR,SQLite Call Detail Record handler.,))
+$(eval $(call Package/freeswitch/Module,cidlookup,Caller ID lookup,This module provides an API for querying caller ID name and location\ndata.,))
+$(eval $(call Package/freeswitch/Module,clearmode,Clearmode,Clearmode codec passthrough support.,))
+$(eval $(call Package/freeswitch/Module,cluechoo,Clue Choo,This demo module renders a Clue Choo train on the FreeSWITCH console.,+libncurses))
+$(eval $(call Package/freeswitch/Module,commands,Commands,This module provides miscellaneous API commands.,))
+$(eval $(call Package/freeswitch/Module,conference,Conference,This module provides multi-party conferencing.,))
+$(eval $(call Package/freeswitch/Module,console,Console logger,Allows control over what messages get logged to the console.,))
+$(eval $(call Package/freeswitch/Module,curl,cURL,This module provides an API for making HTTP requests with cURL.,))
+$(eval $(call Package/freeswitch/Module,dahdi_codec,DAHDI codec,DAHDI codec module.,))
+$(eval $(call Package/freeswitch/Module,db,DB,This module implements a simple db API with group support. Also can be\nused as a limit db backend.,))
+$(eval $(call Package/freeswitch/Module,dialplan_asterisk,Asterisk dialplan,Asterisk extensions.conf style dialplan parser.,))
+$(eval $(call Package/freeswitch/Module,dialplan_directory,Directory dialplan,Directory dialplan support.,))
+$(eval $(call Package/freeswitch/Module,dialplan_xml,XML dialplan,Standard FreeSWITCH XML dialplan support.,))
+$(eval $(call Package/freeswitch/Module,directory,Dial-by-name directory,This module implements a dial-by-name directory IVR.,))
+$(eval $(call Package/freeswitch/Module,distributor,Load distributor,This module implements a mechanism for performing load balancing.,))
+$(eval $(call Package/freeswitch/Module,dptools,Dialplan tools,This module implements basic dialplan tools.,))
+$(eval $(call Package/freeswitch/Module,easyroute,DID routing,This module does destination lookup based on DID.,))
+$(eval $(call Package/freeswitch/Module,enum,ENUM routing,This module implements ENUM support.,+libldns))
+$(eval $(call Package/freeswitch/Module,erlang_event,Erlang event,Erlang event module.,+erlang))
+$(eval $(call Package/freeswitch/Module,esf,Multicast,This module adds multi-cast support.,))
+$(eval $(call Package/freeswitch/Module,esl,Single ESL,This module adds an API for generating one-off ESL requests.,))
+$(eval $(call Package/freeswitch/Module,event_multicast,Multicast Event,Multicast Event System for FreeSWITCH.,))
+$(eval $(call Package/freeswitch/Module,event_socket,Event socket,Sends events via a single socket. Needed for fs_cli.,))
+$(eval $(call Package/freeswitch/Module,event_test,Event test,Event demo module.,))
+$(eval $(call Package/freeswitch/Module,event_zmq,ZMQ event,ZMQ event module.,))
+$(eval $(call Package/freeswitch/Module,expr,Expr,This module adds expr support for expression evaluation.,))
+$(eval $(call Package/freeswitch/Module,fail2ban,Fail2ban logging,Provides support for Fail2ban logging.,))
+$(eval $(call Package/freeswitch/Module,fifo,FIFO,This module adds a first-in first-out queue system.,))
+$(eval $(call Package/freeswitch/Module,format_cdr,Multiformat CDR,A superset of mod_json_cdr and mod_xml_cdr.,))
+$(eval $(call Package/freeswitch/Module,fsk,FSK,This module adds frequency-shift keying support which can be used to\nsend and receive caller ID.,))
+$(eval $(call Package/freeswitch/Module,fsv,FSV,This module provides dialplan applications for recording and playing\nvideos.,))
+$(eval $(call Package/freeswitch/Module,g723_1,G.723.1 passthrough,G.723.1 codec passthrough.,))
+$(eval $(call Package/freeswitch/Module,g729,G.729 passthrough,G.729 codec passthrough.,))
+$(eval $(call Package/freeswitch/Module,graylog2,Graylog2 logger,GELF logger for Graylog2 and Logstash.,))
+$(eval $(call Package/freeswitch/Module,gsmopen,GSM endpoint,GSMopen is a channel driver that allows an SMS to be sent to and from\nFreeSWITCH as well as incoming and outgoing GSM voice calls.,+gsmlib +libctb +libjpeg-turbo +libtiff))
+$(eval $(call Package/freeswitch/Module,h26x,H.26x passthrough,H.26x video codec passthrough.,))
+$(eval $(call Package/freeswitch/Module,hash,Hash,This module provides a key-value in-memory datastore. Usable as a\nlimit backend.,))
+$(eval $(call Package/freeswitch/Module,hiredis,Redis client,This module provides a mechanism to use Redis as a datastore.,+libhiredis))
+$(eval $(call Package/freeswitch/Module,httapi,HT-TAPI,This module provides an API for controlling the switch by responding\nto HTTP requests.,))
+$(eval $(call Package/freeswitch/Module,http_cache,HTTP GET with caching,This module provides an API for making HTTP GET requests where the\nresult is cached.,))
+$(eval $(call Package/freeswitch/Module,isac,iSAC,iSAC codec support.,@arm||i386||mips||mips64||mips64el||mipsel||x86_64))
+$(eval $(call Package/freeswitch/Module,json_cdr,JSON CDR,JSON-based Call Detail Record handler.,))
+$(eval $(call Package/freeswitch/Module,kazoo,Kazoo,Kazoo module for FreeSWITCH.,+erlang))
+$(eval $(call Package/freeswitch/Module,lcr,LCR,This module adds a facility for least-cost routing.,))
+$(eval $(call Package/freeswitch/Module,ldap,LDAP,LDAP module for FreeSWITCH.,+libopenldap))
+$(eval $(call Package/freeswitch/Module,local_stream,Local stream,Connects multiple channels to a looped stream.,))
+$(eval $(call Package/freeswitch/Module,logfile,File logger,Logs FreeSWITCH output to a file.,))
+$(eval $(call Package/freeswitch/Module,loopback,Loopback,A loopback channel driver.,))
+$(eval $(call Package/freeswitch/Module,lua,Lua,Lua language interface for FreeSWITCH.,+liblua))
+$(eval $(call Package/freeswitch/Module,mariadb,MariaDB,Adds MariaDB support.,+libmariadb))
+$(eval $(call Package/freeswitch/Module,mp4v,MP4 video passthrough,MP4 video passthrough.,))
+$(eval $(call Package/freeswitch/Module,native_file,Native file,Plays files that are already encoded in the right format.,))
+$(eval $(call Package/freeswitch/Module,nibblebill,Nibblebill,This module allows for real-time accounting of a cash balance and\nusing that information for call routing.,))
+$(eval $(call Package/freeswitch/Module,odbc_cdr,ODBC CDR,ODBC Call Detail Record handler.,))
+$(eval $(call Package/freeswitch/Module,opus,Opus,Opus codec support.,+libopus))
+$(eval $(call Package/freeswitch/Module,opusfile,Opus file,Read and Write OGG/Opus files.,+libopusenc +libopusfile))
+$(eval $(call Package/freeswitch/Module,oreka,Oreka,This module provides media recording with the Oreka cross-platform\naudio stream recording and retrieval system.,))
+$(eval $(call Package/freeswitch/Module,perl,Perl,This package contains mod_perl for FreeSWITCH.,+libdb47 +libgdbm +perlbase-essential @PERL_THREADS))
+$(eval $(call Package/freeswitch/Module,pgsql,PostgreSQL,Adds PostgreSQL support.,+libpq))
+$(eval $(call Package/freeswitch/Module,png,PNG,Allows playback of video using PNG files.,@FS_WITH_PNG))
+$(eval $(call Package/freeswitch/Module,pocketsphinx,Pocketsphinx,This module allows speech recognition. You might want to install\nfreeswitch-misc-grammar as well.,+libsamplerate)) # When libsamplerate is found it'll be linked against, there is no switch to turn it off
+$(eval $(call Package/freeswitch/Module,portaudio,Portaudio,Voice through a local soundcard.,+portaudio))
+$(eval $(call Package/freeswitch/Module,portaudio_stream,Portaudio streaming,Stream from an external audio source for Music on Hold.,+portaudio))
+$(eval $(call Package/freeswitch/Module,posix_timer,POSIX timer,Add POSIX timer support.,))
+$(eval $(call Package/freeswitch/Module,prefix,Prefix match,This module provides a data store with fast lookups by the longest\nprefix match rule.,))
+$(eval $(call Package/freeswitch/Module,python3,Python3,Python3 support module.,+python3-light))
+$(eval $(call Package/freeswitch/Module,radius_cdr,Radius CDR,Radius Call Detail Record handler.,))
+$(eval $(call Package/freeswitch/Module,random,Entropy,This module extracts entropy from FreeSWITCH and feeds it into\n/dev/random.,))
+$(eval $(call Package/freeswitch/Module,raven,Raven logging,Adds support for logging to Raven instances.,))
+$(eval $(call Package/freeswitch/Module,rayo,Rayo,Rayo/XMPP 3PCC server for FreeSWITCH.,+freeswitch-mod-ssml))
+$(eval $(call Package/freeswitch/Module,redis,Redis limit backend,This module provides a mechanism to use Redis as a limit backend data\nstore.,))
+$(eval $(call Package/freeswitch/Module,rss,RSS,Parses and reads XML based RSS feeds and reads the entries aloud via a TTS engine.,))
+$(eval $(call Package/freeswitch/Module,rtc,Media streaming,Media streaming as used by WebRTC and mod_verto.,))
+$(eval $(call Package/freeswitch/Module,rtmp,RTMP endpoint,RTMP endpoint support. Allows FreeSWITCH to be used from RTMP clients.,))
+$(eval $(call Package/freeswitch/Module,say_de,German Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_en,English Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_es,Spanish Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_es_ar,Argentinian Spanish Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_fa,Persian Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_fr,French Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_he,Hebrew Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_hr,Croatian Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_hu,Hungarian Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_it,Italian Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_ja,Japanese Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_nl,Dutch Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_pl,Polish Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_pt,Portuguese Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_ru,Russian Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_sv,Swedish Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_th,Thai Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,say_zh,Chinese Say,Uses prerecorded sounds to read or say various things.,))
+$(eval $(call Package/freeswitch/Module,shell_stream,Shell stream,Allows to stream audio from an arbitrary shell command.,))
+$(eval $(call Package/freeswitch/Module,shout,Shout,Allows to stream audio from MP3s or Shoutcast streams.,+lame-lib +libmpg123 +libshout))
+$(eval $(call Package/freeswitch/Module,signalwire,SignalWire,SignalWire CLOUD - FreeSWITCH connector.,+signalwire-client-c))
+$(eval $(call Package/freeswitch/Module,skinny,Skinny,Skinny Call Control Protocol endpoint support.,))
+$(eval $(call Package/freeswitch/Module,sms,SMS,This module provides an abstract facility for interfacing with SMS\nsystems.,))
+$(eval $(call Package/freeswitch/Module,snapshot,Snapshot,This module can record a sliding window of audio and take snapshots\nto disk.,))
+$(eval $(call Package/freeswitch/Module,sndfile,Soundfile,Adds sound format support via libsndfile.,+libsndfile))
+$(eval $(call Package/freeswitch/Module,snmp,SNMP,An SNMP stats reporter.,+libnetsnmp))
+$(eval $(call Package/freeswitch/Module,snom,SNOM,This module implements features specific to SNOM phones.,))
+$(eval $(call Package/freeswitch/Module,sofia,Sofia SIP,SIP module.,))
+$(eval $(call Package/freeswitch/Module,sonar,Sonar,This module measures the latency on an audio link by sending audible\naudio sonar pings.,))
+$(eval $(call Package/freeswitch/Module,spandsp,SpanDSP,This module implements SpanDSP fax. It includes DSP and codec\nfunctionality.,+libjpeg-turbo +liblzma +libtiff))
+$(eval $(call Package/freeswitch/Module,spy,User Spy,This module adds the ability to monitor the audio of a channel.,))
+$(eval $(call Package/freeswitch/Module,ssml,SSML,mod_ssml is a FreeSWITCH module that renders SSML into audio. This\nmodule requires a text-to-speech module for speech synthesis.,))
+$(eval $(call Package/freeswitch/Module,stress,Stress,This module attempts to detect voice stress on an audio channel.,))
+$(eval $(call Package/freeswitch/Module,syslog,Syslog logger,Logs FreeSWITCH output to the syslog.,))
+$(eval $(call Package/freeswitch/Module,theora,Theora passthrough,Theora video codec passthrough.,))
+$(eval $(call Package/freeswitch/Module,tone_stream,Tone stream,Tone generation stream.,))
+$(eval $(call Package/freeswitch/Module,translate,Number translation,This module implements number translation.,))
+$(eval $(call Package/freeswitch/Module,tts_commandline,TTS command-line,Run a command-line and play the output file.,))
+$(eval $(call Package/freeswitch/Module,valet_parking,Valet parking,This module implements the valet call parking strategy.,))
+$(eval $(call Package/freeswitch/Module,verto,Verto,Verto signaling protocol.,+libks))
+$(eval $(call Package/freeswitch/Module,video_filter,Video filter chromakey,This module provides a media bug for chromakey functionality.,))
+$(eval $(call Package/freeswitch/Module,vmd,Voicemail detection,This module detects voicemail beeps.,))
+$(eval $(call Package/freeswitch/Module,voicemail,Voicemail,This module provides a voicemail system.,))
+$(eval $(call Package/freeswitch/Module,voicemail_ivr,Voicemail IVR,This module provides an extensible voicemail IVR system.,))
+$(eval $(call Package/freeswitch/Module,xml_cdr,XML CDR,XML Call Detail Record handler.,))
+$(eval $(call Package/freeswitch/Module,xml_curl,XML cURL,Provides an XML cURL interfaces to pull dynamic XML configuration for\nFreeSWITCH over HTTP.,))
+$(eval $(call Package/freeswitch/Module,xml_ldap,XML LDAP,LDAP XML gateway.,+libopenldap))
+$(eval $(call Package/freeswitch/Module,xml_rpc,XML RPC,Allows using the webapi to control FreeSWITCH.,))
+$(eval $(call Package/freeswitch/Module,xml_scgi,XML SCGI,SCGI XML Gateway.,))
+$(eval $(call Package/freeswitch/Module,yaml,YAML,YAML language module.,+libyaml))
+$(eval $(call Package/freeswitch/Module,yuv,Raw YUV,Raw YUV I420 video codec support.,@FS_WITH_LIBYUV))
+
+################################
+# FreeSWITCH utilities
+# Params:
+# 1 - Package subname
+# 2 - Package title
+# 3 - Utility description
+# 4 - Utility dependencies
+# 5 - Utility is a script (y/n)
+################################
+
+$(eval $(call Package/freeswitch/Util,fs_cli,CLI,The fs_cli program is a Command-Line Interface that allows a user to\nconnect to a FreeSWITCH instance running on the local or a remote\nsystem.,,n))
+$(eval $(call Package/freeswitch/Util,fs_encode,Sound file conversion,Format conversion of sound files so the result can be used by\nmod_native_file.,+freeswitch-mod-native-file +freeswitch-mod-sndfile +freeswitch-mod-spandsp,n))
+$(eval $(call Package/freeswitch/Util,fs_ivrd,IVR daemon,The FreeSWITCH IVR daemon is an abstraction layer that sits on top of\nthe ESL. The basic idea is that the ivrd will allow the user to have\na STDIN/STDOUT interface for simple call control.,,n))
+$(eval $(call Package/freeswitch/Util,fs_tts,TTS to sound file,Use TTS to generate a sound file.,,n))
+$(eval $(call Package/freeswitch/Util,gentls_cert,TLS certificate,Can be used to create TLS certificates and setup CAs.,+openssl-util,y))
+$(eval $(call Package/freeswitch/Util,tone2wav,Sound file generation,Generates a sound file from a teletone script. The output can be in\nany format that is supported by libsndfile.,+freeswitch-mod-sndfile,n))