Add freeswitch package.
authorJiri Slachta <slachta@cesnet.cz>
Thu, 4 Apr 2013 16:09:53 +0000 (18:09 +0200)
committerJiri Slachta <slachta@cesnet.cz>
Thu, 4 Apr 2013 16:09:53 +0000 (18:09 +0200)
Signed-off-by: Jiri Slachta <slachta@cesnet.cz>
27 files changed:
freeswitch/Makefile [new file with mode: 0644]
freeswitch/files/freeswitch.config [new file with mode: 0644]
freeswitch/files/freeswitch.default [new file with mode: 0644]
freeswitch/files/freeswitch.hotplug [new file with mode: 0644]
freeswitch/files/freeswitch.init [new file with mode: 0644]
freeswitch/patches/000-build-openwrt_rules.mk.patch [new file with mode: 0644]
freeswitch/patches/001-build-modules_conf_in.patch [new file with mode: 0644]
freeswitch/patches/002-configure_in.patch [new file with mode: 0644]
freeswitch/patches/003-Makefile.am.patch [new file with mode: 0644]
freeswitch/patches/100-libs-esl-Makefile.patch [new file with mode: 0644]
freeswitch/patches/101-libs-spandsp-src-spandsp-fast_convert_h.patch [new file with mode: 0644]
freeswitch/patches/103-libs-spandsp-src-t4_rx_c.patch [new file with mode: 0644]
freeswitch/patches/104-libs-spandsp-src-t4_tx_c.patch [new file with mode: 0644]
freeswitch/patches/105-libs-xmlrpc-c-config_mk_in.patch [new file with mode: 0644]
freeswitch/patches/106-libs-xmlrpc-c-lib-expat-gennmtab-Makefile.patch [new file with mode: 0644]
freeswitch/patches/107-libs-libzrtp-include-zrtp_config_h.patch [new file with mode: 0644]
freeswitch/patches/200-src-include-timerfd_wrap_h.patch [new file with mode: 0644]
freeswitch/patches/201-src-mod-applications-mod_mp4-mp4_helper_hpp.patch [new file with mode: 0644]
freeswitch/patches/202-src-mod-codecs-mod_opus-Makefile.patch [new file with mode: 0644]
freeswitch/patches/203-src-mod-codecs-mod_silk-Makefile.patch [new file with mode: 0644]
freeswitch/patches/204-src-mod-directories-mod_ldap-Makefile.patch [new file with mode: 0644]
freeswitch/patches/205-src-mod-endpoints-mod_gsmopen-Makefile.patch [new file with mode: 0644]
freeswitch/patches/206-src-mod-event_handlers-mod_snmp-Makefile.patch [new file with mode: 0644]
freeswitch/patches/207-src-mod-xml_int-mod_xml_ldap-Makefile.patch [new file with mode: 0644]
freeswitch/patches/208-src-mod-xml_int-mod_xml_rpc-Makefile.patch [new file with mode: 0644]
freeswitch/patches/209-src-mod-codecs-mod_isac-typedefs_h.patch [new file with mode: 0644]
freeswitch/patches/210-src-mod-endpoints-mod_dingaling-Makefile.patch [new file with mode: 0644]

diff --git a/freeswitch/Makefile b/freeswitch/Makefile
new file mode 100644 (file)
index 0000000..ab66c45
--- /dev/null
@@ -0,0 +1,1086 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+#
+include $(TOPDIR)/rules.mk
+
+
+PKG_NAME:=freeswitch
+PKG_DISTNAME:=$(PKG_NAME)_git
+PKG_VERSION:=1.3.17
+
+
+#
+# The latest FS git hash in PKG_SOURCE_VERSION can be obtained from http://fisheye.freeswitch.org
+#
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://git.$(PKG_NAME).org/$(PKG_NAME).git
+FS_DEFAULT_HEAD:=6af84a870c21836e20077f27a85d94fd382a02be
+FS_LATEST_HEAD:=$(if $(DUMP),$(FS_DEFAULT_HEAD),$(shell git ls-remote $(PKG_SOURCE_URL) HEAD | cut -f1))
+PKG_SOURCE_VERSION:=$(if $(CONFIG_FS_SOFIA_WITH_PULL_CURRENT),$(FS_LATEST_HEAD),$(FS_DEFAULT_HEAD))
+PKG_SOURCE_VERSION_SHORT:=$(shell echo $(PKG_SOURCE_VERSION)|cut -b -7)
+PKG_RELEASE:=$(PKG_SOURCE_VERSION_SHORT)
+PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_SOURCE_VERSION_SHORT).tar.bz2
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+
+
+FS_MOD_AVAILABLE:= \
+       abstraction \
+       alsa \
+       amr \
+       amrwb \
+       avmd \
+       blacklist \
+       bv \
+       callcenter \
+       cdr-csv \
+       cdr-pg-csv \
+       cdr-sqlite \
+       celt \
+       cepstral \
+       cidlookup \
+       cluechoo \
+       codec2 \
+       commands \
+       conference \
+       console \
+       curl \
+       dahdi-codec \
+       db \
+       dialplan-asterisk \
+       dialplan-directory \
+       dialplan-xml \
+       dingaling \
+       directory \
+       distributor \
+       dptools \
+       easyroute \
+       enum \
+       erlang-event \
+       esf \
+       event-multicast \
+       event-socket \
+       event-zmq \
+       expr \
+       fifo \
+       file-string \
+       flite \
+       fsk \
+       fsv \
+       g723-1 \
+       g729 \
+       gsmopen \
+       h26x \
+       h323 \
+       hash \
+       html5 \
+       httapi \
+       http-cache \
+       ilbc \
+       isac \
+       java \
+       json-cdr \
+       lcr \
+       local-stream \
+       logfile \
+       loopback \
+       lua \
+       managed \
+       mp4 \
+       mp4v \
+       native-file \
+       nibblebill \
+       openzap \
+       opus \
+       oreka \
+       portaudio \
+       portaudio-stream \
+       posix-timer \
+       radius-cdr \
+       redis \
+       rss \
+       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 \
+       skinny \
+       skypopen \
+       sms \
+       snapshot \
+       snipe-hunt \
+       sndfile \
+       snmp \
+       snom \
+       sofia \
+       sonar \
+       spandsp \
+       speex \
+       spidermonkey \
+       spidermonkey-core-db \
+       spidermonkey-curl \
+       spidermonkey-odbc \
+       spidermonkey-socket \
+       spidermonkey-teletone \
+       spy \
+       stress \
+       syslog \
+       timerfd \
+       tone-stream \
+       tts-commandline \
+       unimrcp \
+       valet-parking \
+       vmd \
+       voicemail \
+       voicemail-ivr \
+       vp8 \
+       xml-cdr \
+       xml-curl \
+       xml-rpc \
+       xml-scgi \
+       yaml \
+
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_FS_SOFIA_WITH_BUILTIN_ZRTP \
+       CONFIG_FS_SOFIA_WITH_IPV6 \
+       CONFIG_FS_SOFIA_WITH_MYSQL \
+       CONFIG_FS_SOFIA_WITH_ODBC \
+       CONFIG_FS_SOFIA_WITH_OPT \
+       CONFIG_FS_SOFIA_WITH_PULL_CURRENT \
+       CONFIG_FS_SOFIA_WITH_SCTP \
+       $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_MOD_AVAILABLE)) \
+
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+
+TAR_OPTIONS+= --strip-components=1 -C $(PKG_BUILD_DIR)
+
+
+define Package/$(PKG_NAME)/Default
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Telephony
+  URL:=http://www.$(PKG_NAME).org/
+  MAINTAINER:=Mazilo <openwrt.forum.mazilo@recursor.net>
+endef
+
+
+define Package/$(PKG_NAME)
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH open source telephony platform ($(PKG_SOURCE_VERSION_SHORT))
+  DEPENDS:=+libcurl +libiconv-full +libjpeg +libncurses +libpq +libpthread +librt +libstdcpp
+  MENU:=1
+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.  See http://wiki.$(PKG_NAME).org
+endef
+
+
+define Package/$(PKG_NAME)/config
+    config FS_SOFIA_WITH_PULL_CURRENT
+    depends on DEVEL
+    depends on PACKAGE_$(PKG_NAME)
+    bool "Pull the latest git HEAD - $(PKG_SOURCE_VERSION_SHORT) (Press < Help > for more information)"
+    default n
+    help
+       This existing git HEAD ($(FS_DEFAULT_HEAD)) is probably outdated. 
+       Enable this option for the latest git HEAD ($(FS_LATEST_HEAD)). 
+       Enable this option ONLY if you know what you are doing. It may and/or may not be cleanly 
+       compiled and may require some intervension to create new patches. If you take this route
+       and come up with some patches, please contemplate to contribute or send in your patches.
+
+    config FS_SOFIA_WITH_IPV6
+    depends on PACKAGE_$(PKG_NAME)
+    bool "Compile with IPV6 support"
+    default y
+    help
+        Compile $(PKG_NAME) with IPV6 Support.
+
+    config FS_SOFIA_WITH_OPT
+    depends on PACKAGE_$(PKG_NAME)
+    bool "Compile with optimization"
+    default y
+    help
+        Compile $(PKG_NAME) with optimization enabled.
+
+    config FS_SOFIA_WITH_BUILTIN_ZRTP
+    depends on PACKAGE_$(PKG_NAME)
+    bool "Compile with built-in ZRTP support"
+    default y
+    help
+        Compile $(PKG_NAME)-mod-sofia with ZRTP Support.
+endef
+
+
+define Package/$(PKG_NAME)-mod-sofia/config
+    config FS_SOFIA_WITH_MYSQL
+    depends on PACKAGE_$(PKG_NAME)-mod-sofia
+    bool "Compile with MySQL"
+    default n
+    select PACKAGE_libmysqlclient
+    help
+        Compile $(PKG_NAME) with MySQL.
+
+    config FS_SOFIA_WITH_ODBC
+    depends on PACKAGE_$(PKG_NAME)-mod-sofia
+    depends on PACKAGE_sqliteodbc
+    depends on PACKAGE_unixodbc_svn
+    bool "Compile with ODBC support (Requires unixodbc_svn NOT YET AVAILABLE)"
+    default n
+    help
+        Compile $(PKG_NAME)-mod-sofia with ODBC Support. Since both sqliteodbc and unixodbc_svn packages are not yet available on OpenWRT, $(PKG_NAME)-mod-sofia CAN NOT be compiled with ODBC support.
+
+    config FS_SOFIA_WITH_SCTP
+    depends on PACKAGE_$(PKG_NAME)-mod-sofia
+    depends on PACKAGE_sctp
+    bool "Compile with SCTP (Stream Control Transfer Protocol) support"
+    default y
+    help
+        Compile $(PKG_NAME)-mod-sofia with SCTP support.
+endef
+
+
+define Package/$(PKG_NAME)-example-config
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH example config (commented)
+  DEPENDS:= $(PKG_NAME)
+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.
+endef
+
+
+define Package/$(PKG_NAME)-config-upstream-defaults
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH upstream config
+  DEPENDS:= $(PKG_NAME)
+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.
+endef
+
+
+define Package/$(PKG_NAME)-config-minimal
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH minimal config
+  DEPENDS:= $(PKG_NAME)
+endef
+
+
+define Package/$(PKG_NAME)-config-minimal/description
+  A minimal configuration of FreeSWITCH for OpenWRT devices.  Is what the UCI
+  configuration began with.
+endef
+
+
+define Package/$(PKG_NAME)-collection-upstream-defaults
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FS upstream def sample conf
+  DEPENDS:= $(PKG_NAME) \
+               +$(PKG_NAME)-config-upstream-defaults \
+               +$(PKG_NAME)-mod-callcenter \
+               +$(PKG_NAME)-mod-codec2 \
+               +$(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-ilbc \
+               +$(PKG_NAME)-mod-local-stream \
+               +$(PKG_NAME)-mod-lua \
+               +$(PKG_NAME)-mod-native-file \
+               +$(PKG_NAME)-mod-sndfile \
+               +$(PKG_NAME)-mod-sofia \
+               +$(PKG_NAME)-mod-spandsp \
+               +$(PKG_NAME)-mod-speex \
+               +$(PKG_NAME)-mod-syslog \
+               +$(PKG_NAME)-mod-tone-stream \
+               +$(PKG_NAME)-mod-xml-curl \
+               +$(PKG_NAME)-mod-xml-rpc \
+               +$(PKG_NAME)-tools
+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-codec2 \
+               +$(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
+endef
+
+
+define Package/$(PKG_NAME)-sounds-en-08KHz
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH 8KHz english sounds
+  DEPENDS:= $(PKG_NAME)
+endef
+
+
+define Package/$(PKG_NAME)-sounds-en-16KHz
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH 16KHz english sounds
+  DEPENDS:= +$(PKG_NAME)-sounds-en-08KHz
+endef
+
+
+define Package/$(PKG_NAME)-sounds-en-32KHz
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH 32KHz english sounds
+  DEPENDS:= +$(PKG_NAME)-sounds-en-16KHz
+endef
+
+
+define Package/$(PKG_NAME)-sounds-en-48KHz
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH 48KHz english sounds
+  DEPENDS:= +$(PKG_NAME)-sounds-en-32KHz
+endef
+
+
+define Package/$(PKG_NAME)-sounds-moh-08KHz
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH 8KHz music-on-hold sounds
+  DEPENDS:= $(PKG_NAME)
+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
+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
+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
+endef
+
+
+define Package/$(PKG_NAME)-tools
+$(call Package/$(PKG_NAME)/Default)
+  TITLE:=FreeSWITCH control tools
+  DEPENDS:= $(PKG_NAME)
+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)))
+endef
+
+
+MAKE_INSTALL_TARGETS:=install
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),)
+ $(eval $(call Download/files,celt,celt-0.10.0.tar.gz,a656f6176e9be84027c0e51ceedd710f,,downloads/libs/,libs/))
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-curl),)
+ $(eval $(call Download/files,json-cdr,json-c-0.9.tar.gz,4653b3b9c568bb9c782178abfaac128d,,downloads/libs/,libs/))
+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/))
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-flite),)
+ $(eval $(call Download/files,flite,flite-1.5.4-current.tar.bz2,f3a2d88b1059f6f4ff3c20a8169bc0f4,,downloads/libs/,libs/))
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-opus),)
+ $(eval $(call Download/files,opus,opus-1.0.2.tar.gz,c503ad05a59ddb44deab96204401be03,,downloads/libs/,libs/))
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-08KHz),)
+ $(eval $(call Download/files,sounds-en-08KHz,$(PKG_NAME)-sounds-en-us-callie-8000-1.0.24.tar.gz,6c0a8ec292e444dff10b652644f4fc54,,,))
+       MAKE_INSTALL_TARGETS+= sounds-install
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-en-16KHz),)
+ $(eval $(call Download/files,sounds-en-16KHz,$(PKG_NAME)-sounds-en-us-callie-16000-1.0.24.tar.gz,e9b5c1cdd393660d0cdf7de6b7e03c45,,,))
+       MAKE_INSTALL_TARGETS+= hd-sounds-install
+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.24.tar.gz,fa110675de07ca5f6d85646f3093b0ce,,,))
+       MAKE_INSTALL_TARGETS+= uhd-sounds-install
+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.24.tar.gz,813ea6eeae5545bb6e11664189691f8b,,,))
+       MAKE_INSTALL_TARGETS+= cd-sounds-install
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-08KHz),)
+ $(eval $(call Download/files,sounds-moh-08KHz,$(PKG_NAME)-sounds-music-8000-1.0.8.tar.gz,f63ef3cc3507af079ae5c7b8b8a01e42,,,))
+       MAKE_INSTALL_TARGETS+= moh-install
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-16KHz),)
+ $(eval $(call Download/files,sounds-moh-16KHz,$(PKG_NAME)-sounds-music-16000-1.0.8.tar.gz,7fd0ca9a9e3878783baa39b8187743bf,,,))
+       MAKE_INSTALL_TARGETS+= hd-moh-install
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-32KHz),)
+ $(eval $(call Download/files,sounds-moh-32KHz,$(PKG_NAME)-sounds-music-32000-1.0.8.tar.gz,7e03932ea81b8d0bf6d686f838b060b4,,,))
+       MAKE_INSTALL_TARGETS+= uhd-moh-install
+endif
+
+
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-sounds-moh-48KHz),)
+ $(eval $(call Download/files,sounds-moh-48KHz,$(PKG_NAME)-sounds-music-48000-1.0.8.tar.gz,d06cd2a80379f224affab21f5180e4c6,,,))
+       MAKE_INSTALL_TARGETS+= cd-moh-install
+endif
+
+
+#
+# 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
+
+
+ifneq ($(CONFIG_USE_EGLIBC),)
+  ifeq ($(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),)
+    TARGET_CFLAGS += -DNO_GETLOGIN
+  endif
+endif
+
+
+FS_TARGET_CFLAGS:= $(TARGET_CFLAGS) -DLUA_USE_LINUX $(FPIC) -std=gnu99 -Wno-format
+FS_TARGET_CXXFLAGS:= $(TARGET_CXXFLAGS) -DLUA_USE_LINUX $(FPIC) -Wno-format
+FS_TARGET_CPPFLAGS:= -I. -I./lua $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-erlang-event),-I$(STAGING_DIR_HOST)/lib/erlang/lib/erl_interface-3.6/include) $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-json-cdr),-Wno-error) $(TARGET_CPPFLAGS)
+
+
+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/$(PKG_NAME)" \
+       --with-modinstdir="/usr/lib/$(PKG_NAME)" \
+       --with-random="/dev/urandom" \
+       $(if $(CONFIG_FS_SOFIA_WITH_MYSQL),--with-mysql,--without-mysql) \
+       $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_IPV6,ipv6) \
+       $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_OPT,optimization) \
+       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-celt),--with-ogg="$(STAGING_DIR)/usr",--without-iogg) \
+       $(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) \
+       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-java),--with-java="$(STAGING_DIR)/usr",--without-java) \
+       $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp,builtin-tiff) \
+       $(call autoconf_bool,CONFIG_PACKAGE_$(PKG_NAME)-mod-timerfd,timerfd-wrapper) \
+       $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_BUILTIN_ZRTP,zrtp) \
+       $(call autoconf_bool,CONFIG_FS_SOFIA_WITH_ODBC,core-odbc-support) \
+       $(if $(CONFIG_FS_SOFIA_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
+       $(if $(CONFIG_FS_SOFIA_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)/usr/lib") \
+
+
+CONFIGURE_VARS+= \
+       config_TARGET_CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
+       config_TARGET_CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \
+       config_TARGET_CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
+       config_TARGET_CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \
+       config_TARGET_CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \
+       config_TARGET_READLINE_INC="$(FS_TARGET_CPPFLAGS)" \
+       config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
+       config_TARGET_LIBS="$(TARGET_LDFLAGS) -lpthread -ldl" \
+       config_BUILD_CC="$(HOSTCC)" \
+       config_BUILD_CFLAGS="$(HOST_CFLAGS)" \
+       CC_FOR_BUILD="$(HOSTCC)" \
+       BUILDTOOL_CC="$(HOSTCC)" \
+       BUILDTOOL_CCLD="$(HOSTCC)" \
+       LDFLAGS="$$$$LDFLAGS" \
+       LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
+       CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
+       CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
+       AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
+       RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
+       CFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CFLAGS)" \
+       CXXFLAGS="$(FS_TARGET_CPPFLAGS) $(FS_TARGET_CXXFLAGS)" \
+       CPPFLAGS="$(FS_TARGET_CPPFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=\"$(STAGING_DIR)/usr/lib\"" \
+       PATH="$(PATH):$(STAGING_DIR)" \
+       HOST_CC="/usr/bin/cc" \
+       HOST_CXX="/usr/bin/g++" \
+       CROSS_COMPILE="1" \
+       PKG_CONFIG="$(STAGING_DIR_HOST)/bin/pkg-config" \
+       PKG_CONFIG_PATH="$(STAGING_DIR_HOST)/lib/pkgconfig" \
+       ax_cv_c_compiler_vendor="gnu" \
+       ac_cv_dev_urandom="yes" \
+       ac_cv_file_dbd_apr_dbd_mysql_c="no" \
+       ac_cv_file__dev_random="no" \
+       ac_cv_file__dev_urandom="yes" \
+       ac_cv_file___dev_urandom_="yes" \
+       ac_cv_func_mmap_fixed_mapped="yes" \
+       ac_cv_func_pthread_rwlock_init="yes" \
+       ac_cv_struct_rlimit="yes" \
+       apr_cv_mutex_recursive="yes" \
+       apr_cv_process_shared_works="no" \
+       apr_cv_tcp_nodelay_with_cork="yes" \
+       apr_cv_type_rwlock_t="yes" \
+       $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mod-perl),ac_cv_path_PERL="yes",) \
+       libzmq_cv_cxx_werror_flag="" \
+
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(call Prepare/celt)
+       $(call Prepare/event-zmq)
+       $(call Prepare/flite)
+       $(call Prepare/json-cdr)
+       $(call Prepare/opus)
+       $(call Prepare/sounds-en-08KHz)
+       $(call Prepare/sounds-en-16KHz)
+       $(call Prepare/sounds-en-32KHz)
+       $(call Prepare/sounds-en-48KHz)
+       $(call Prepare/sounds-moh-08KHz)
+       $(call Prepare/sounds-moh-16KHz)
+       $(call Prepare/sounds-moh-32KHz)
+       $(call Prepare/sounds-moh-48KHz)
+endef
+
+
+define Build/Configure
+       if [ -d $(PKG_BUILD_DIR)/libs/libcodec2/src ]; then \
+               (cd $(PKG_BUILD_DIR)/libs/libcodec2/src; $(HOSTCC) -c generate_codebook.c; $(HOSTCC) -o generate_codebook generate_codebook.o -lm) \
+       fi
+       (cd $(PKG_BUILD_DIR); $(AM_TOOL_PATHS) ./bootstrap.sh)
+       $(call Build/Configure/Default,)
+       $(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
+               )
+       )
+endef
+
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
+               RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
+               CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
+               CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CXX)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
+               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 Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/$(PKG_NAME)/include/* $(1)/usr/include/$(PKG_NAME)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib$(PKG_NAME).{a,so*} $(1)/usr/lib/
+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,sed -i -e "s#-lcurl -lz\(.*\)/usr/lib/libexpat.la\(.*\)$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)\(.*\)#-L/usr/lib -lcurl -lz /usr/lib/libexpat.la\2/usr\3#g" $(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 tones.conf 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
+
+
+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
+
+
+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
+
+
+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;
+endef
+
+
+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
+
+
+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
+
+
+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;
+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/
+endef
+
+
+#
+# 1. Name
+# 2. Title
+# 3. Package configuration files
+# 4. Inter module depends
+# 5. Extra depends
+#
+define BuildLib
+  define Package/$(PKG_NAME)-$(1)
+    $$(call Package/$(PKG_NAME)/Default)
+    TITLE:= FS $(2) library and pkgconfig files
+    DEPENDS:= $(PKG_NAME) $(foreach l,$(4),+$(PKG_NAME)-$(l)) $(5)
+  endef
+
+  define Package/$(PKG_NAME)-$(1)/install
+       [ -d "$$(1)/usr/lib/pkgconfig" ] || $(INSTALL_DIR) $$(1)/usr/lib/pkgconfig
+
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(patsubst lib%,%,$(3)).pc $$(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/$(1)* $$(1)/usr/lib/
+       $(if $$(1)/usr/lib/$(1).la,sed -i -e "s#\(^.*\)=' \(.*\)-lm\(.*\)#\1=' -L/usr/lib -L/usr/lib/libiconv-full/lib -L/usr/lib/libintl-full/lib -lm\3#g" $$(1)/usr/lib/$(1).la)
+  endef
+
+  $$(eval $$(call BuildPackage,$(PKG_NAME)-$(1)))
+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) $(PKG_INSTALL_DIR)/usr/${f} $$(1)/usr;)
+
+       #
+       # mod_$(subst -,_,$(1)): Clean installed library control files from referencig to OpenWRT PATH.
+       #
+       for f in `ls $$(1)/usr/lib/$(PKG_NAME)/*.la`; \
+       do \
+               sed -i -e "s#' \(.*\)/usr/lib/libexpat.la\(.*\)$(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)\(.*\)#' -L/usr/lib -L/usr/lib/libiconv-full/lib -L/usr/lib/libintl-full/lib /usr/lib/lib$(PKG_NAME).la /usr/lib/libexpat.la\2/usr\3#g;s#' \(.*\)/usr/lib/libintl-full/lib#' -L/usr/lib -L/usr/lib/libiconv-full/lib -L/usr/lib/libintl-full/lib#g;s#-L\.\.##g;s#$(PKG_BUILD_DIR)\(.*\)/usr/lib/libtiff.la\(.*\)#/usr/lib/libtiff.la\2#g" $$$$$$$${f}; \
+       done
+
+       #
+       # 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)
+
+       #
+       # 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)
+
+       #
+       # 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)
+
+       #
+       # 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)
+
+       #
+       # 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)
+
+       #
+       # 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_$(subst -,_,$(1))"\(.*\) *-->\(.*\)$$$$|\1\2"mod_$(subst -,_,$(1))"\3\4|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
+  endef
+
+  define Package/$(PKG_NAME)-mod-$(1)/prerm
+#!/bin/sh
+sed -i -e 's|^\([ \t]*\)\(.*\)"mod_$(subst -,_,$(1))"\(.*\)$$$$|\1<!-- \2"mod_$(subst -,_,$(1))"\3 -->|' $$$${IPKG_INSTROOT}/etc/$(PKG_NAME)/autoload_configs/modules.conf.xml
+  endef
+
+  $$(eval $$(call BuildPackage,$(PKG_NAME)-mod-$(1)))
+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 BuildLib,Name,Title,Package Configuration Files,Inter Depends,Extra Depends))
+#
+$(eval $(call BuildLib,libopenzap,OpenZAP,openzap,,))
+
+
+#
+# $(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,,,,+alsa-lib))
+$(eval $(call BuildPlugin,amr,Adaptive Multi-Rate On Bandwidth Codec,vanilla,,,,))
+$(eval $(call BuildPlugin,amrwb,Wide Band AMR,vanilla,,,,))
+$(eval $(call BuildPlugin,avmd,Advanced Voice Mail Detection,vanilla,,,,))
+$(eval $(call BuildPlugin,blacklist,Blacklist,vanilla,,,,))
+$(eval $(call BuildPlugin,bv,BroadVoice 16/32-bit Audio Codec,vanilla,,,,))
+$(eval $(call BuildPlugin,callcenter,Call Center,vanilla,,,,))
+$(eval $(call BuildPlugin,cdr-csv,CSV-CDR Handler,mod,,,,)) # ~/conf
+$(eval $(call BuildPlugin,cdr-pg-csv,Postgress CDR Handler,vanilla,,,,+coreutils +libpq))
+$(eval $(call BuildPlugin,cdr-sqlite,SQLite3 CDR Handler,vanilla,,,,+libsqlite3))
+$(eval $(call BuildPlugin,celt,CELT Ultra-Low Delay Codec,vanilla,,,,+libogg))
+$(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,,,,,))
+$(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,dahdi-codec,DAHDI Codecs,vanilla,,,,))
+$(eval $(call BuildPlugin,db,Database Backend,vanilla,,,,))
+$(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,,,,+libgcrypt +libopenssl))
+$(eval $(call BuildPlugin,directory,Search By Name Directory IVR,vanilla,,,,))
+$(eval $(call BuildPlugin,distributor,Simple Robin-Round Load to Gateway,vanilla,,,,))
+$(eval $(call BuildPlugin,dptools,Dialplan Tools,vanilla,,,,))
+$(eval $(call BuildPlugin,easyroute,Simple DID Routing,vanilla,,,,))
+$(eval $(call BuildPlugin,enum,ENUM Routing,,,,,))
+$(eval $(call BuildPlugin,erlang-event,Erlang Event Handler,vanilla,,,,+erlang))
+$(eval $(call BuildPlugin,esf,Extra SIP Functionality,vanilla,,,,))
+$(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,,,,@(!(armeb||avr32)||BROKEN)))
+$(eval $(call BuildPlugin,fsk,Bell-202 1200-Baud FSK Decoder,vanilla,,,,))
+$(eval $(call BuildPlugin,fsv,Video Player / Recorder,vanilla,,,,))
+$(eval $(call BuildPlugin,g723-1,G.723.1 Codec,vanilla,,,,))
+$(eval $(call BuildPlugin,g729,G.729 Codec,vanilla,,,,))
+$(eval $(call BuildPlugin,gsmopen,GSM Modem compatible Endpoint,mod,,,,+alsa-lib @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,html5,HTML5 Endpoint Module,vanilla,,,,))
+$(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,,,,))
+$(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,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,,,,))
+$(eval $(call BuildPlugin,managed,Media Switching Software Library,vanilla,,,,+glib2 @BROKEN)) # needs Mono
+$(eval $(call BuildPlugin,mp4,MP4 File Format Support For Video,vanilla,,,,@BROKEN)) # needs 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,oreka,Media Recording with Oreka,vanilla,,,,))
+$(eval $(call BuildPlugin,openzap,Zaptel (Superseded by FreeTDM),libs,ozmod,,,+$(PKG_NAME)-libopenzap +libpcap))
+$(eval $(call BuildPlugin,opus,Opus CoDec,vanilla,,,,))
+$(eval $(call BuildPlugin,portaudio,Portaudio To Sound Card Interface,vanilla,,,,+alsa-lib))
+$(eval $(call BuildPlugin,portaudio-stream,Portaudio Streaming Interface,vanilla,,,,+alsa-lib))
+$(eval $(call BuildPlugin,posix-timer,POSIX Compliant Soft Timer,vanilla,,,,))
+$(eval $(call BuildPlugin,radius-cdr,Radius-CDR interface,vanilla,,,,+freeradius2 @BROKEN)) # fails in freeradius-client
+$(eval $(call BuildPlugin,redis,Redis Limited Backend,vanilla,,,,))
+$(eval $(call BuildPlugin,rss,RRS Feeds via TTS,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,,,,))
+$(eval $(call BuildPlugin,siren,G.722.1 Codec,vanilla,,,,))
+$(eval $(call BuildPlugin,skel,Template For New Module,vanilla,,,,))
+$(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,snapshot,Record Audio Snapshot to File,vanilla,,,,))
+$(eval $(call BuildPlugin,sndfile,Multi-Format Sound File,vanilla,,,,))
+$(eval $(call BuildPlugin,snipe-hunt,Snipe Hunt (Simple Example Module),vanilla,,,,))
+$(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)) # ~/conf
+$(eval $(call BuildPlugin,speex,Speex codec,mod,,,,))
+$(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,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,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,vmd,VoiceMail Beep Detection,vanilla,,,,))
+$(eval $(call BuildPlugin,voicemail,VoiceMail,vanilla,,,,))
+$(eval $(call BuildPlugin,voicemail-ivr,VoiceMail IVR,vanilla,,,,))
+$(eval $(call BuildPlugin,vp8,VP8 Video Codec,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-rpc,XML-RPC Interface,vanilla,,,,))
+$(eval $(call BuildPlugin,xml-scgi,SCGI XML Gateway,vanilla,,,,))
+$(eval $(call BuildPlugin,yaml,YAML langunage,vanilla,,,,))
diff --git a/freeswitch/files/freeswitch.config b/freeswitch/files/freeswitch.config
new file mode 100644 (file)
index 0000000..9b4ab84
--- /dev/null
@@ -0,0 +1,11 @@
+
+config 'global' 'state'
+       option 'started' '0'
+
+config 'profile_top' 'internal_top'
+
+config 'profile_top' 'external_top'
+
+config 'external_gateway' 'external_example'
+
+
diff --git a/freeswitch/files/freeswitch.default b/freeswitch/files/freeswitch.default
new file mode 100644 (file)
index 0000000..079c314
--- /dev/null
@@ -0,0 +1,11 @@
+#FS_DIR="/opt"
+FS_DIR_ETC="$FS_DIR/etc/freeswitch"
+FS_DIR_MOD="$FS_DIR/usr/lib/freeswitch"
+FS_DIR_DB="$FS_DIR/tmp/freeswitch/db"
+FS_DIR_LOG="$FS_DIR/tmp/freeswitch/log"
+FS_DIR_SCRIPTS="$FS_DIR/usr/share/freeswitch/scripts"
+FS_DIR_HTDOCS="$FS_DIR/usr/share/freeswitch/htdocs"
+FS_DIR_RECORDINGS="/var/lib/freeswitch/recordings" # NOTE: must be changed in config as well
+FS_DIR_VM_STORAGE="/var/lib/freeswitch/storage" # NOTE: must be changed in config as well
+
+OPTIONS="-conf $FS_DIR_ETC -log $FS_DIR_LOG -db $FS_DIR_DB -mod $FS_DIR_MOD -htdocs $FS_DIR_HTDOCS -scripts $FS_DIR_SCRIPTS"
diff --git a/freeswitch/files/freeswitch.hotplug b/freeswitch/files/freeswitch.hotplug
new file mode 100644 (file)
index 0000000..ef9656c
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+. /lib/functions.sh
+LOAD_STATE=1
+
+if [ "$ACTION" = "ifup" ]; then
+       /etc/init.d/freeswitch enabled && {
+               local not_all_up="$(sh -c '
+                       . /lib/functions.sh
+
+                       LOAD_STATE=1
+                       local if_is_down=0
+                       local network_ignore=""
+                       
+                       check_if_down () {
+                               local cfg="$1"
+                               local up
+                               local proto
+                               config_get_bool up "$1" up 0
+                               config_get proto "$1" proto
+                               if [ "$proto" != "none" ] && [ "$up" -ne 1 ]; then
+                                       local new_down=1
+                                       local oIFS="$IFS"
+                                       local ignore
+                                       IFS=" "
+                                       for ignore in $network_ignore; do
+                                               [ "$cfg" = "$ignore" ] && new_down=0
+                                       done
+                                       IFS="$oIFS"
+                                       [ "$new_down" = "1" ] && if_is_down=1
+                               fi
+                       }
+                       
+                       append_ignore() {
+                               local cfg="$1"
+                               local network
+                               config_get network "$1" network
+                               append network_ignore "$network"
+                       }       
+
+                       LOAD_STATE=1
+                       config_load freeswitch
+                       config_foreach append_ignore network_ignore
+                       config_load network
+                       config_foreach check_if_down interface
+                       
+                       echo "$if_is_down"
+               ')"     
+               [ "$not_all_up" = "0" ] && {
+                       local started
+                       {
+                               mkdir -p /tmp/freeswitch
+                               lock /tmp/freeswitch/.start.lck
+                               config_load freeswitch
+                               config_get started "state" started
+                               [ "$started" != "1" ] && {
+                                       /etc/init.d/freeswitch start
+                                       uci_set_state freeswitch global state started 1
+                               }
+                               lock -u /tmp/freeswitch/.start.lck
+                       } &
+               }
+       }
+fi
+
diff --git a/freeswitch/files/freeswitch.init b/freeswitch/files/freeswitch.init
new file mode 100644 (file)
index 0000000..4476b47
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+START=90 
+
+DEFAULT=/etc/default/freeswitch
+OPTIONS=""
+
+boot() {
+       # Do nothing on boot
+       exit 0
+}
+
+start() {
+       [ -f $DEFAULT ] && . $DEFAULT
+       mkdir -p $FS_DIR_DB
+       mkdir -p $FS_DIR_LOG
+       mkdir -p $FS_DIR_RECORDINGS
+       mkdir -p $FS_DIR_VM_STORAGE
+       ulimit -s 240
+       $FS_DIR/usr/bin/freeswitch $OPTIONS -nc
+}
+
+stop() {
+       [ -f $DEFAULT ] && . $DEFAULT
+       $FS_DIR/usr/bin/freeswitch $OPTIONS -stop
+}
+
+restart() {
+       # stopping freeswitch is non-blocking, so we wait until freeswitch's 
+       # event socket is down, and then wait an additional ten seconds so that 
+       # freeswitch should be completely shutdown before we start it again
+       local retval
+       stop
+       fs_cli -x status >/dev/null 2>&1
+       retval=$?
+       while [ $retval -eq 0 ]; do sleep 1; fs_cli -x status >/dev/null 2>&1; retval=$?; done
+       sleep 10
+       start
+}
+
diff --git a/freeswitch/patches/000-build-openwrt_rules.mk.patch b/freeswitch/patches/000-build-openwrt_rules.mk.patch
new file mode 100644 (file)
index 0000000..31fb16f
--- /dev/null
@@ -0,0 +1,10 @@
+--- /dev/null
++++ b/build/openwrt_rules.mk
+@@ -0,0 +1,7 @@
++OPENWRT_DIR=$(shell (cd $(BASE)/../../..;pwd))
++STAGING_PREFIX=$(OPENWRT_DIR)/staging_dir/host
++STAGING_DIR=$(OPENWRT_DIR)/staging_dir/$(shell (cd $(BASE)/..;basename `pwd`))
++ARCH="$(shell grep CONFIG_ARCH $(OPENWRT_DIR)/.config|cut -d= -d'"' -f2)"
++GNU_TARGET_NAME=$(ARCH)-openwrt-linux
++
++include $(OPENWRT_DIR)/rules.mk
diff --git a/freeswitch/patches/001-build-modules_conf_in.patch b/freeswitch/patches/001-build-modules_conf_in.patch
new file mode 100644 (file)
index 0000000..736d9a4
--- /dev/null
@@ -0,0 +1,65 @@
+--- a/build/modules.conf.in
++++ b/build/modules.conf.in
+@@ -3,6 +3,9 @@
+ #applications/mod_blacklist
+ #applications/mod_callcenter
+ #applications/mod_cidlookup
++#applications/mod_skel
++#applications/mod_mp4
++#applications/mod_protovm
+ applications/mod_cluechoo
+ applications/mod_commands
+ applications/mod_conference
+@@ -27,6 +30,7 @@ applications/mod_httapi
+ #applications/mod_memcache
+ #applications/mod_mongo
+ #applications/mod_nibblebill
++#applications/mod_oreka
+ #applications/mod_osp
+ #applications/mod_redis
+ #applications/mod_rss
+@@ -34,6 +38,7 @@ applications/mod_sms
+ #applications/mod_snapshot
+ #applications/mod_snipe_hunt
+ #applications/mod_snom
++#applications/mod_sonar
+ #applications/mod_soundtouch
+ applications/mod_spandsp
+ #applications/mod_spy
+@@ -61,17 +66,20 @@ codecs/mod_h26x
+ codecs/mod_vp8
+ #codecs/mod_ilbc
+ #codecs/mod_isac
++#codecs/mod_mp4v
+ #codecs/mod_opus
+ #codecs/mod_sangoma_codec
+ #codecs/mod_silk
+ #codecs/mod_siren
+ codecs/mod_speex
++#codecs/mod_theora
+ dialplans/mod_dialplan_asterisk
+ #dialplans/mod_dialplan_directory
+ dialplans/mod_dialplan_xml
+ #directories/mod_ldap
+ #endpoints/mod_alsa
+ #endpoints/mod_dingaling
++#endpoints/mod_gsmopen
+ #endpoints/mod_h323
+ #endpoints/mod_html5
+ #endpoints/mod_khomp
+@@ -88,6 +96,7 @@ event_handlers/mod_cdr_csv
+ event_handlers/mod_cdr_sqlite
+ #event_handlers/mod_erlang_event
+ #event_handlers/mod_event_multicast
++#event_handlers/mod_json_cdr
+ event_handlers/mod_event_socket
+ #event_handlers/mod_event_zmq
+ #event_handlers/mod_radius_cdr
+@@ -113,6 +122,7 @@ loggers/mod_syslog
+ #say/mod_say_de
+ say/mod_say_en
+ #say/mod_say_es
++#say/mod_say_fa
+ #say/mod_say_fr
+ #say/mod_say_he
+ #say/mod_say_hu
diff --git a/freeswitch/patches/002-configure_in.patch b/freeswitch/patches/002-configure_in.patch
new file mode 100644 (file)
index 0000000..326112c
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/configure.in
++++ b/configure.in
+@@ -152,7 +152,7 @@ if test "${enable_optimizer}" = "yes" ;
+         AX_CC_MAXOPT
+ fi
+-AX_PATH_LIBGNUTLS()
++#AX_PATH_LIBGNUTLS()
+ # set defaults for use on all platforms
+ SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu"
+@@ -581,7 +581,7 @@ AC_CHECK_LIB(pthread, pthread_setschedpa
+ AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
+-AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
++# AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
+ AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
+ AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
diff --git a/freeswitch/patches/003-Makefile.am.patch b/freeswitch/patches/003-Makefile.am.patch
new file mode 100644 (file)
index 0000000..af128f9
--- /dev/null
@@ -0,0 +1,48 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,3 +1,7 @@
++BASE=.
++
++include $(BASE)/build/openwrt_rules.mk
++
+ EXTRA_DIST =
+ SUBDIRS = . src
+ AUTOMAKE_OPTIONS = foreign
+@@ -164,7 +168,6 @@ ZRTP_LIBS = -lbn -lzrtp
+ libfreeswitch_la_LDFLAGS += $(ZRTP_LDFLAGS)
+ libfreeswitch_la_LIBADD += $(ZRTP_LIBS)
+ CORE_LIBS += libs/libzrtp/libzrtp.a
+-LIBS += libs/libzrtp/third_party/bnlib/libbn.a
+ endif
+ library_includedir      = $(includedir)
+@@ -422,7 +425,7 @@ $(switch_builddir)/quiet_libtool: $(swit
+       @cat libtool | sed -e 's|$$show "$$command"|if test -z "$$suppress_output" ; then $$show "Compiling $$srcfile ..." ; fi|' > $(switch_builddir)/quiet_libtool
+ build/print_git_revision: build/print_git_revision.c
+-      $(CC) -o $@ $<
++      $(HOSTCC) -o $@ $<
+ src/include/switch_version.h: src/include/switch_version.h.in Makefile build/print_git_revision $(libfreeswitch_la_SOURCES) $(library_include_HEADERS)
+       @cat $< > $@; \
+@@ -648,7 +651,9 @@ sndfile-reconf:
+ tiff-reconf:
+       cd libs/tiff-4.0.2 && autoreconf -fi
+-      cd libs/tiff-4.0.2 && sh ./configure.gnu
++      cd libs/tiff-4.0.2 && sh ./configure.gnu --host="$(GNU_TARGET_NAME)" --prefix="/usr"
++      cd libs/spandsp && autoreconf -fi
++      cd libs/spandsp && sh ./configure.gnu --host="$(GNU_TARGET_NAME)" --prefix="/usr"
+       cd libs/tiff-4.0.2 && make
+ python-reconf:
+@@ -673,9 +678,6 @@ iks-reconf:
+       $(MAKE) mod_dingaling-clean
+ spandsp-reconf: tiff-reconf
+-      cd libs/spandsp && $(MAKE) clean || echo
+-      cd libs/spandsp && autoreconf -fi
+-      cd libs/spandsp && sh ./configure.gnu --prefix=$(prefix)
+       cd libs/spandsp && $(MAKE)
+ sofia-reconf:
diff --git a/freeswitch/patches/100-libs-esl-Makefile.patch b/freeswitch/patches/100-libs-esl-Makefile.patch
new file mode 100644 (file)
index 0000000..c0034ec
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/libs/esl/Makefile
++++ b/libs/esl/Makefile
+@@ -7,7 +7,7 @@ PICKY=-O2
+ CFLAGS=$(BASE_FLAGS) $(PICKY)
+ CXXFLAGS=$(BASE_FLAGS)
+ MYLIB=libesl.a
+-LIBS=-lncurses -lesl -lpthread -lm
++LIBS=-L$(STAGING_DIR)/usr/lib -lncurses -lesl -lpthread -lm
+ LDFLAGS=-L.
+ OBJS=src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o src/esl_json.o src/esl_buffer.o
+ SRC=src/esl.c src/esl_json.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c src/esl_oop.cpp src/esl_json.c src/esl_buffer.c
+@@ -19,8 +19,8 @@ OBJS += src/esl_oop.o
+ all: $(MYLIB) fs_cli testclient testserver ivrd
+ $(MYLIB): $(OBJS) $(HEADERS) $(SRC)
+-      ar rcs $(MYLIB) $(OBJS)
+-      ranlib $(MYLIB)
++      $(AR) rcs $(MYLIB) $(OBJS)
++      $(RANLIB) $(MYLIB)
+ testserver: $(MYLIB) testserver.c
+       $(CC) $(CC_CFLAGS) $(CFLAGS) testserver.c -o testserver $(LDFLAGS) $(LIBS)
diff --git a/freeswitch/patches/101-libs-spandsp-src-spandsp-fast_convert_h.patch b/freeswitch/patches/101-libs-spandsp-src-spandsp-fast_convert_h.patch
new file mode 100644 (file)
index 0000000..e2fb3da
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/libs/spandsp/src/spandsp/fast_convert.h
++++ b/libs/spandsp/src/spandsp/fast_convert.h
+@@ -195,7 +195,7 @@ extern "C"
+     {
+         return (long int) (x);
+     }
+-#elif defined(__ppc__)  ||   defined(__powerpc__)
++#elif 0 /* defined(__ppc__)  ||   defined(__powerpc__) */
+     static __inline__ long int lfastrint(register double x)
+     {
+         int res[2];
diff --git a/freeswitch/patches/103-libs-spandsp-src-t4_rx_c.patch b/freeswitch/patches/103-libs-spandsp-src-t4_rx_c.patch
new file mode 100644 (file)
index 0000000..b7057ca
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/libs/spandsp/src/t4_rx.c
++++ b/libs/spandsp/src/t4_rx.c
+@@ -45,7 +45,7 @@
+ #include <math.h>
+ #endif
+ #include "floating_fudge.h"
+-#include <tiffio.h>
++#include <tiffiop.h>
+ #include "spandsp/telephony.h"
+ #include "spandsp/logging.h"
diff --git a/freeswitch/patches/104-libs-spandsp-src-t4_tx_c.patch b/freeswitch/patches/104-libs-spandsp-src-t4_tx_c.patch
new file mode 100644 (file)
index 0000000..31264ae
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/libs/spandsp/src/t4_tx.c
++++ b/libs/spandsp/src/t4_tx.c
+@@ -45,7 +45,7 @@
+ #include <math.h>
+ #endif
+ #include "floating_fudge.h"
+-#include <tiffio.h>
++#include <tiffiop.h>
+ #include "spandsp/telephony.h"
+ #include "spandsp/logging.h"
diff --git a/freeswitch/patches/105-libs-xmlrpc-c-config_mk_in.patch b/freeswitch/patches/105-libs-xmlrpc-c-config_mk_in.patch
new file mode 100644 (file)
index 0000000..79cb33e
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/libs/xmlrpc-c/config.mk.in
++++ b/libs/xmlrpc-c/config.mk.in
+@@ -335,8 +335,8 @@ endif
+ # The cross compiling user can update config.mk or override
+ # BUILDTOOL_CC on a make command.
+-BUILDTOOL_CC = $(CC)
+-BUILDTOOL_CCLD = $(CCLD)
++BUILDTOOL_CC = $(HOSTCC)
++BUILDTOOL_CCLD = $(HOSTCC)
+ # Here are the commands 'make install' uses to install various kinds of files:
diff --git a/freeswitch/patches/106-libs-xmlrpc-c-lib-expat-gennmtab-Makefile.patch b/freeswitch/patches/106-libs-xmlrpc-c-lib-expat-gennmtab-Makefile.patch
new file mode 100644 (file)
index 0000000..d50d200
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/libs/xmlrpc-c/lib/expat/gennmtab/Makefile
++++ b/libs/xmlrpc-c/lib/expat/gennmtab/Makefile
+@@ -1,3 +1,5 @@
++TOPDIR=$(shell (cd $(SRCDIR)/../../../../..; pwd))
++
+ ifeq ($(SRCDIR),)
+   updir = $(shell echo $(dir $(1)) | sed 's/.$$//')
+   EXPATDIR := $(call updir,$(CURDIR))
+@@ -7,6 +9,7 @@ ifeq ($(SRCDIR),)
+ endif
+ SUBDIR := lib/expat/gennmtab
++include $(TOPDIR)/rules.mk
+ include $(BLDDIR)/config.mk
+ LDFLAGS = $(LADD)
diff --git a/freeswitch/patches/107-libs-libzrtp-include-zrtp_config_h.patch b/freeswitch/patches/107-libs-libzrtp-include-zrtp_config_h.patch
new file mode 100644 (file)
index 0000000..e460bc4
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/libs/libzrtp/include/zrtp_config.h
++++ b/libs/libzrtp/include/zrtp_config.h
+@@ -66,8 +66,16 @@
+  * If the byte order is not specified manually in zrtp_config_user.h - try to detect it automatically
+  */
+ #if !defined(ZRTP_BYTE_ORDER)
++#if defined(linux) || defined(__linux)
+-#if defined(_i386_) || defined(i_386_) || defined(_X86_) || defined(x86) || defined(__i386__) || \
++#include <endian.h>
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#define ZRTP_BYTE_ORDER ZBO_LITTLE_ENDIAN
++#elif __BYTE_ORDER == __BIG_ENDIAN
++#define ZRTP_BYTE_ORDER ZBO_BIG_ENDIAN
++#endif
++
++#elif defined(_i386_) || defined(i_386_) || defined(_X86_) || defined(x86) || defined(__i386__) || \
+       defined(__i386) || defined(_M_IX86) || defined(__I86__)
+ /*
+  * Generic i386 processor family, little-endian
diff --git a/freeswitch/patches/200-src-include-timerfd_wrap_h.patch b/freeswitch/patches/200-src-include-timerfd_wrap_h.patch
new file mode 100644 (file)
index 0000000..dbf995e
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/src/include/timerfd_wrap.h
++++ b/src/include/timerfd_wrap.h
+@@ -55,20 +55,12 @@ SWITCH_BEGIN_EXTERN_C
+ #ifndef __NR_timerfd
+-#if defined(__x86_64__)
+-#define __NR_timerfd_create 283
+-#define __NR_timerfd_settime 286
+-#define __NR_timerfd_gettime 287
+-#elif defined(__i386__)
+-#define __NR_timerfd_create 322
+-#define __NR_timerfd_settime 325
+-#define __NR_timerfd_gettime 326
+-#else
+-#error invalid system
+-#endif
++#include <linux/unistd.h>
+ #endif
+-#define TFD_TIMER_ABSTIME (1 << 0)
++#ifndef TFD_TIMER_ABSTIME
++#include <sys/timerfd.h>
++#endif
+ int timerfd_create(int clockid, int flags) 
+ {
diff --git a/freeswitch/patches/201-src-mod-applications-mod_mp4-mp4_helper_hpp.patch b/freeswitch/patches/201-src-mod-applications-mod_mp4-mp4_helper_hpp.patch
new file mode 100644 (file)
index 0000000..ac81dd0
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/mod/applications/mod_mp4/mp4_helper.hpp
++++ b/src/mod/applications/mod_mp4/mp4_helper.hpp
+@@ -22,8 +22,9 @@ the Initial Developer. All Rights Reserv
+ #ifndef MP4_HELPER_HPP_
+ #define MP4_HELPER_HPP_
++#include <string.h>
++#include <sys/types.h>
+ #include <mp4.h>
+-#include <string>
+ #include <exception>
+ #include <string>
diff --git a/freeswitch/patches/202-src-mod-codecs-mod_opus-Makefile.patch b/freeswitch/patches/202-src-mod-codecs-mod_opus-Makefile.patch
new file mode 100644 (file)
index 0000000..cdf710a
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/src/mod/codecs/mod_opus/Makefile
++++ b/src/mod/codecs/mod_opus/Makefile
+@@ -12,12 +12,13 @@ OPUS_LA=$(OPUS_BUILDDIR)/.libs/libopus.l
+ LOCAL_LIBADD=$(OPUS_LA)
+ include $(BASE)/build/modmake.rules
++include $(BASE)/build/openwrt_rules.mk
+ $(OPUS_DIR):
+       $(GETLIB) $(OPUS).tar.gz
+ $(OPUS_DIR)/Makefile: $(OPUS_DIR)
+-      cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure --disable-shared --with-pic --srcdir=$(OPUS_DIR)
++      cd $(OPUS_BUILDDIR) && $(DEFAULT_VARS) $(OPUS_DIR)/configure --host=$(GNU_TARGET_NAME) --disable-shared --with-pic --srcdir=$(OPUS_DIR)
+       $(TOUCH_TARGET)
+ $(OPUS_LA): $(OPUS_DIR)/Makefile
diff --git a/freeswitch/patches/203-src-mod-codecs-mod_silk-Makefile.patch b/freeswitch/patches/203-src-mod-codecs-mod_silk-Makefile.patch
new file mode 100644 (file)
index 0000000..1d4341e
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/src/mod/codecs/mod_silk/Makefile
++++ b/src/mod/codecs/mod_silk/Makefile
+@@ -1,4 +1,5 @@
+ BASE=../../../..
++include $(BASE)/build/openwrt_rules.mk
+ SILK_DIR=$(switch_srcdir)/libs/silk
+ SILK_BUILDDIR=$(switch_builddir)/libs/silk
+ LOCAL_CFLAGS=-I$(SILK_DIR)/src  -I$(SILK_DIR)/interface
+@@ -8,5 +9,5 @@ LOCAL_OBJS=$(BASE)/libs/stfu/stfu.o
+ include $(BASE)/build/modmake.rules
+ $(SILK_LA): $(SILK_DIR)/.update       
+-      cd $(SILK_BUILDDIR) && ./configure --disable-shared && make clean && $(MAKE)
++      cd $(SILK_BUILDDIR) && ./configure --host=$(GNU_TARGET_NAME) --disable-shared && make clean && $(MAKE)
+       $(TOUCH_TARGET)
diff --git a/freeswitch/patches/204-src-mod-directories-mod_ldap-Makefile.patch b/freeswitch/patches/204-src-mod-directories-mod_ldap-Makefile.patch
new file mode 100644 (file)
index 0000000..92741d1
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/mod/directories/mod_ldap/Makefile
++++ b/src/mod/directories/mod_ldap/Makefile
+@@ -21,7 +21,7 @@ $(LDAP_DIR):
+ $(LDAP_BUILDDIR)/Makefile: $(LDAP_DIR)
+       mkdir -p $(LDAP_BUILDDIR)
+-      cd $(LDAP_BUILDDIR) && $(DEFAULT_VARS) $(LDAP_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(LDAP_DIR)
++      cd $(LDAP_BUILDDIR) && $(DEFAULT_VARS) $(LDAP_DIR)/configure $(DEFAULT_ARGS) --srcdir=$(LDAP_DIR) --with-yielding_select=yes
+       $(TOUCH_TARGET)
+ $(LDAPLA) $(LIBLBERLA): $(LDAP_BUILDDIR)/Makefile
diff --git a/freeswitch/patches/205-src-mod-endpoints-mod_gsmopen-Makefile.patch b/freeswitch/patches/205-src-mod-endpoints-mod_gsmopen-Makefile.patch
new file mode 100644 (file)
index 0000000..3b24669
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/src/mod/endpoints/mod_gsmopen/Makefile
++++ b/src/mod/endpoints/mod_gsmopen/Makefile
+@@ -1,5 +1,15 @@
++BASE=../../../..
+ MODNAME=mod_gsmopen
+-LOCAL_CFLAGS += -I../../../../libs/spandsp/src -I../../../..//libs/tiff-4.0.2/libtiff -DGSMOPEN_C_VER=\"`git log -1 --format="%h" gsmopen_protocol.cpp`\" -DMODGSMOPEN_C_VER=\"`git log -1 --format="%h" mod_gsmopen.cpp`\"
+-LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp -lctb-0.16 -lgsmme
++SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"'
++
++TIFF_DIR="$(shell ls -d $(switch_srcdir)/libs/tiff*)"
++TIFF_BUILDDIR=$(TIFF_DIR)
++TIFF_LA=$(TIFF_BUILDDIR)/libtiff/libtiff.la
++
++SPANDSP_DIR=$(switch_srcdir)/libs/spandsp
++SPANDSP_BUILDDIR=$(switch_builddir)/libs/spandsp
++SPANDSP_LA=$(SPANDSP_BUILDDIR)/src/libspandsp.la
++LOCAL_CFLAGS += $(SVNDEF) -I$(BASE)/libs/spandsp/src -I$(TIFF_DIR)/libtiff -I$(BASE)/src/mod/endpoints/mod_gsmopen/libctb-0.16/include -fpermissive
++LOCAL_LDFLAGS=-L$(BASE)/libs/spandsp/src -lspandsp -L$(BASE)/src/mod/endpoints/mod_gsmopen/libctb-0.16/lib -lctb-0.16
+ LOCAL_OBJS=gsmopen_protocol.o
+ include ../../../../build/modmake.rules
diff --git a/freeswitch/patches/206-src-mod-event_handlers-mod_snmp-Makefile.patch b/freeswitch/patches/206-src-mod-event_handlers-mod_snmp-Makefile.patch
new file mode 100644 (file)
index 0000000..c85f62c
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/src/mod/event_handlers/mod_snmp/Makefile
++++ b/src/mod/event_handlers/mod_snmp/Makefile
+@@ -1,7 +1,10 @@
+-include ../../../../build/modmake.rules
++BASE=../../../..
++
++include $(BASE)/build/modmake.rules
++include $(BASE)/build/openwrt_rules.mk
++
++LOCAL_CFLAGS=$(shell $(STAGING_DIR)/host/bin/net-snmp-config --cflags --agent-libs) -DNETSNMP_NO_INLINE
+-LOCAL_CFLAGS=`net-snmp-config --cflags`
+-LOCAL_LDFLAGS=`net-snmp-config --agent-libs`
+ LOCAL_OBJS=subagent.o
+ local_depend: $(LOCAL_OBJS)
diff --git a/freeswitch/patches/207-src-mod-xml_int-mod_xml_ldap-Makefile.patch b/freeswitch/patches/207-src-mod-xml_int-mod_xml_ldap-Makefile.patch
new file mode 100644 (file)
index 0000000..0734887
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/mod/xml_int/mod_xml_ldap/Makefile
++++ b/src/mod/xml_int/mod_xml_ldap/Makefile
+@@ -14,7 +14,7 @@ LOCAL_LIBADD=$(LDAPLA) $(LIBLBERLA) $(LI
+ include $(BASE)/build/modmake.rules
+-DEFAULT_ARGS+= --disable-slapd --disable-slurpd --disable-relay --disable-bdb --disable-hdb
++DEFAULT_ARGS+= --disable-slapd --disable-slurpd --disable-relay --disable-bdb --disable-hdb --with-yielding_select=yes
+ $(LDAP_DIR):
+       $(GETLIB) $(LDAP).tar.gz
diff --git a/freeswitch/patches/208-src-mod-xml_int-mod_xml_rpc-Makefile.patch b/freeswitch/patches/208-src-mod-xml_int-mod_xml_rpc-Makefile.patch
new file mode 100644 (file)
index 0000000..7691d3e
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/mod/xml_int/mod_xml_rpc/Makefile
++++ b/src/mod/xml_int/mod_xml_rpc/Makefile
+@@ -14,7 +14,6 @@ $(XMLRPC_DIR)/lib/abyss/src/date.o\
+ $(XMLRPC_DIR)/src/double.o\
+ $(XMLRPC_DIR)/lib/libutil/error.o\
+ $(XMLRPC_DIR)/lib/abyss/src/file.o\
+-$(XMLRPC_DIR)/lib/expat/gennmtab/gennmtab.o\
+ $(XMLRPC_DIR)/lib/util/getoptx.o\
+ $(XMLRPC_DIR)/lib/abyss/src/handler.o\
+ $(XMLRPC_DIR)/lib/abyss/src/http.o\
diff --git a/freeswitch/patches/209-src-mod-codecs-mod_isac-typedefs_h.patch b/freeswitch/patches/209-src-mod-codecs-mod_isac-typedefs_h.patch
new file mode 100644 (file)
index 0000000..84de2af
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/mod/codecs/mod_isac/typedefs.h
++++ b/src/mod/codecs/mod_isac/typedefs.h
+@@ -66,7 +66,7 @@
+ #define WEBRTC_ARCH_X86
+ #define WEBRTC_ARCH_32_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
+-#elif defined(__ARMEL__)
++#elif defined(__ARMEL__) || defined(__mips__)
+ // TODO(andrew): We'd prefer to control platform defines here, but this is
+ // currently provided by the Android makefiles. Commented to avoid duplicate
+ // definition warnings.
diff --git a/freeswitch/patches/210-src-mod-endpoints-mod_dingaling-Makefile.patch b/freeswitch/patches/210-src-mod-endpoints-mod_dingaling-Makefile.patch
new file mode 100644 (file)
index 0000000..0b56586
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/mod/endpoints/mod_dingaling/Makefile
++++ b/src/mod/endpoints/mod_dingaling/Makefile
+@@ -10,7 +10,6 @@ DING_DIR=$(BASE)/libs/libdingaling
+ LOCAL_CFLAGS += -I$(DING_DIR)/src -I$(BASE)/libs/iksemel/include
+ LOCAL_OBJS=$(DING_DIR)/src/libdingaling.o $(DING_DIR)/src/sha1.o $(IKS_LA)
+ LOCAL_SOURCES=$(DING_DIR)/src/libdingaling.c $(DING_DIR)/src/sha1.c $(DING_DIR)/src/libdingaling.h
+-LOCAL_LDFLAGS=$(LIBGNUTLS_LIBS)
+ include $(BASE)/build/modmake.rules