Merge pull request #227 from micmac1/freeswitch-stable

New PR: freeswitch-stable
This commit is contained in:
Jiri Slachta 2017-12-27 09:45:25 +01:00 committed by GitHub
commit 9e66952479
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 65 deletions

View File

@ -15,15 +15,6 @@ config FS_STABLE_WITH_FREETYPE
help help
Add FreeType support to FreeSWITCH Add FreeType support to FreeSWITCH
config FS_STABLE_WITH_LIBEDIT
bool "Compile with libedit support"
default y
help
Compile with libedit support to enable command-line history editing
and curses functionality. Of course this feels nicer when interacting
with FreeSWITCH (without it it doesn't feel very interactive at all),
but it adds additional dependencies (libedit, libncursesw, terminfo).
config FS_STABLE_WITH_LIBYUV config FS_STABLE_WITH_LIBYUV
bool "Compile with libyuv support" bool "Compile with libyuv support"
default y if x86_64 default y if x86_64

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PRG_NAME:=freeswitch PRG_NAME:=freeswitch
PKG_NAME:=$(PRG_NAME)-stable PKG_NAME:=$(PRG_NAME)-stable
PKG_VERSION:=1.6.19 PKG_VERSION:=1.6.19
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net> PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
PKG_SOURCE:=$(PRG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PRG_NAME)-$(PKG_VERSION).tar.xz
@ -246,7 +246,6 @@ PKG_CONFIG_DEPENDS:= \
$(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_STABLE_MOD_AVAILABLE)) \ $(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_STABLE_MOD_AVAILABLE)) \
CONFIG_FS_STABLE_WITH_DEBUG \ CONFIG_FS_STABLE_WITH_DEBUG \
CONFIG_FS_STABLE_WITH_FREETYPE \ CONFIG_FS_STABLE_WITH_FREETYPE \
CONFIG_FS_STABLE_WITH_LIBEDIT \
CONFIG_FS_STABLE_WITH_LIBYUV \ CONFIG_FS_STABLE_WITH_LIBYUV \
CONFIG_FS_STABLE_WITH_MODCONF \ CONFIG_FS_STABLE_WITH_MODCONF \
CONFIG_FS_STABLE_WITH_ODBC \ CONFIG_FS_STABLE_WITH_ODBC \
@ -330,11 +329,11 @@ $(call Package/$(PKG_NAME)/Default)
USERID:=$(PRG_NAME)=372:$(PRG_NAME)=372 USERID:=$(PRG_NAME)=372:$(PRG_NAME)=372
DEPENDS:= \ DEPENDS:= \
+FS_STABLE_WITH_FREETYPE:libfreetype \ +FS_STABLE_WITH_FREETYPE:libfreetype \
+FS_STABLE_WITH_LIBEDIT:libedit \
+FS_STABLE_WITH_ODBC:unixodbc \ +FS_STABLE_WITH_ODBC:unixodbc \
+FS_STABLE_WITH_PGSQL:libpq \ +FS_STABLE_WITH_PGSQL:libpq \
+FS_STABLE_WITH_PNG:libpng \ +FS_STABLE_WITH_PNG:libpng \
+libcurl \ +libcurl \
+libedit \
+libopenssl \ +libopenssl \
+libpcre \ +libpcre \
+libpthread \ +libpthread \
@ -376,17 +375,15 @@ $(call Package/$(PKG_NAME)/install/lib,$(1),lib$(PRG_NAME))
$(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME) $(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME)
$(INSTALL_CONF) ./files/$(PRG_NAME).default \ $(INSTALL_CONF) ./files/$(PRG_NAME).default \
$(1)$(FS_STABLE_SYSCONF_DIR)/default/$(PRG_NAME) $(1)$(FS_STABLE_SYSCONF_DIR)/default/$(PRG_NAME)
ifeq ($(CONFIG_FS_STABLE_WITH_LIBEDIT),)
$(SED) '/^ #procd_append_param command -nc -nf$$$$/s/#//' \
$(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME)
endif
endef endef
define Package/$(PKG_NAME)/postinst define Package/$(PKG_NAME)/postinst
#!/bin/sh #!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then if [ -z "$${IPKG_INSTROOT}" ]; then
# Prevent autostart of $(PRG_NAME) # Prevent $(PRG_NAME) from auto-starting after an upgrade. The modules may
touch $(FS_STABLE_SYSCONF_DIR)/$(PRG_NAME)_disabled # not be upgraded yet and the user configuration may need a revision.
sed -i '/^ENABLE_FREESWITCH="yes"/s/^/#/' \
$(FS_STABLE_SYSCONF_DIR)/default/$(PRG_NAME)
echo echo
echo "o-------------------------------------------------------------------o" echo "o-------------------------------------------------------------------o"
@ -605,27 +602,6 @@ endef
define Package/$(PKG_NAME)-util-$(1)/install define Package/$(PKG_NAME)-util-$(1)/install
$(call Package/$(PKG_NAME)/install/bin,$$(1),$(1)) $(call Package/$(PKG_NAME)/install/bin,$$(1),$(1))
endef endef
ifeq ($(1)$(CONFIG_FS_STABLE_WITH_LIBEDIT),fs_cli)
define Package/$(PKG_NAME)-util-$(1)/postinst
#!/bin/sh
if [ -z "$$$${IPKG_INSTROOT}" ]; then
echo
echo "o-------------------------------------------------------------------o"
echo "| fs_cli note |"
echo "o-------------------------------------------------------------------o"
echo "| Your FreeSWITCH was compiled without libedit support. Due to an |"
echo "| interop issue it's possible that when you try to exit fs_cli with |"
echo "| Ctrl-D, you'll see messages flashing by and have to kill fs_cli |"
echo "| manually. To avoid this you can either use Ctrl-C instead (fs_cli |"
echo "| needs to be started with '-i' for this to work; you could create |"
echo "| an appropriate alias in /etc/profile) or type /exit, /quit or |"
echo "| /bye. |"
echo "o-------------------------------------------------------------=^_^=-o"
echo
fi
exit 0
endef
endif
$$(eval $$(call BuildPackage,$(PKG_NAME)-util-$(1))) $$(eval $$(call BuildPackage,$(PKG_NAME)-util-$(1)))
endef endef
@ -634,6 +610,7 @@ CONFIGURE_ARGS+= \
--disable-dependency-tracking \ --disable-dependency-tracking \
--disable-static \ --disable-static \
--disable-system-xmlrpc-c \ --disable-system-xmlrpc-c \
--enable-core-libedit-support \
--enable-fhs \ --enable-fhs \
--with-cachedir=/tmp/$(PRG_NAME)/cache \ --with-cachedir=/tmp/$(PRG_NAME)/cache \
--with-dbdir=/tmp/$(PRG_NAME)/db \ --with-dbdir=/tmp/$(PRG_NAME)/db \
@ -641,18 +618,18 @@ CONFIGURE_ARGS+= \
--with-logfiledir=/tmp/$(PRG_NAME)/log \ --with-logfiledir=/tmp/$(PRG_NAME)/log \
--with-recordingsdir=/tmp/$(PRG_NAME)/recordings \ --with-recordingsdir=/tmp/$(PRG_NAME)/recordings \
--with-storagedir=/tmp/$(PRG_NAME)/storage \ --with-storagedir=/tmp/$(PRG_NAME)/storage \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_LIBEDIT,core-libedit-support) \ $(call autoconf_bool,CONFIG_FS_STABLE_WITH_DEBUG,debug) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_LIBYUV,libyuv) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_ODBC,core-odbc-support) \ $(call autoconf_bool,CONFIG_FS_STABLE_WITH_ODBC,core-odbc-support) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_PGSQL,core-pgsql-support) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_SRTP,srtp) \ $(call autoconf_bool,CONFIG_FS_STABLE_WITH_SRTP,srtp) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_VPX,libvpx) \
$(call autoconf_bool,CONFIG_FS_STABLE_WITH_ZRTP,zrtp) \ $(call autoconf_bool,CONFIG_FS_STABLE_WITH_ZRTP,zrtp) \
$(if $(CONFIG_FS_STABLE_WITH_DEBUG),,--disable-debug) \
$(if $(CONFIG_FS_STABLE_WITH_FREETYPE),,--without-freetype) \ $(if $(CONFIG_FS_STABLE_WITH_FREETYPE),,--without-freetype) \
$(if $(CONFIG_FS_STABLE_WITH_LIBYUV),,--disable-libyuv) \
$(if $(CONFIG_FS_STABLE_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)$(FS_STABLE_LIB_DIR)") \ $(if $(CONFIG_FS_STABLE_WITH_ODBC),--with-odbc-lib="$(STAGING_DIR)$(FS_STABLE_LIB_DIR)") \
$(if $(CONFIG_FS_STABLE_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \ $(if $(CONFIG_FS_STABLE_WITH_ODBC),--with-odbc="$(STAGING_DIR)/usr") \
$(if $(CONFIG_FS_STABLE_WITH_PGSQL),--enable-core-pgsql-support,--without-pgsql) \ $(if $(CONFIG_FS_STABLE_WITH_PGSQL),,--without-pgsql) \
$(if $(CONFIG_FS_STABLE_WITH_PNG),,--without-png) \ $(if $(CONFIG_FS_STABLE_WITH_PNG),,--without-png)
$(if $(CONFIG_FS_STABLE_WITH_VPX),,--disable-libvpx)
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-python-esl)$(CONFIG_PACKAGE_$(PKG_NAME)-mod-python),) ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-python-esl)$(CONFIG_PACKAGE_$(PKG_NAME)-mod-python),)
CONFIGURE_ARGS+= \ CONFIGURE_ARGS+= \
@ -1055,7 +1032,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,clearmode,Clearmode,Clearmode codec pas
$(eval $(call Package/$(PKG_NAME)/Module,cluechoo,Clue Choo,This demo module renders a Clue Choo train on the FreeSWITCH console.,+libncurses)) $(eval $(call Package/$(PKG_NAME)/Module,cluechoo,Clue Choo,This demo module renders a Clue Choo train on the FreeSWITCH console.,+libncurses))
$(eval $(call Package/$(PKG_NAME)/Module,commands,Commands,This module provides miscellaneous API commands.,)) $(eval $(call Package/$(PKG_NAME)/Module,commands,Commands,This module provides miscellaneous API commands.,))
$(eval $(call Package/$(PKG_NAME)/Module,conference,Conference,This module provides multi-party conferencing.,)) $(eval $(call Package/$(PKG_NAME)/Module,conference,Conference,This module provides multi-party conferencing.,))
$(eval $(call Package/$(PKG_NAME)/Module,console,Console logger,Allows control over what messages get logged to the console. When\nFreeSWITCH is compiled without libedit support - this is not the\ndefault - mod_console has no effect because the init script starts\nFreeSWITCH with the console disabled to work around an\ninteroperability issue that causes high CPU load.,)) $(eval $(call Package/$(PKG_NAME)/Module,console,Console logger,Allows control over what messages get logged to the console.,))
$(eval $(call Package/$(PKG_NAME)/Module,curl,cURL,This module provides an API for making HTTP requests with cURL.,)) $(eval $(call Package/$(PKG_NAME)/Module,curl,cURL,This module provides an API for making HTTP requests with cURL.,))
$(eval $(call Package/$(PKG_NAME)/Module,cv,OpenCV,This module exposes opencv actions to enable computer vision actions.,+opencv @BROKEN)) # opencv package too stripped-down $(eval $(call Package/$(PKG_NAME)/Module,cv,OpenCV,This module exposes opencv actions to enable computer vision actions.,+opencv @BROKEN)) # opencv package too stripped-down
$(eval $(call Package/$(PKG_NAME)/Module,dahdi_codec,DAHDI codec,DAHDI codec module.,)) $(eval $(call Package/$(PKG_NAME)/Module,dahdi_codec,DAHDI codec,DAHDI codec module.,))

View File

@ -1,5 +1,9 @@
### FreeSWITCH configuration ### ### FreeSWITCH configuration ###
# Uncomment once you verified your configuration, otherwise the init script will
# not start FreeSWITCH.
#ENABLE_FREESWITCH="yes"
#FS_USER=freeswitch #FS_USER=freeswitch
#FS_GROUP=freeswitch #FS_GROUP=freeswitch
@ -16,8 +20,8 @@
#FS_DIR_STORAGE="/tmp/freeswitch/storage" #FS_DIR_STORAGE="/tmp/freeswitch/storage"
#FS_DIR_TEMP="/tmp/freeswitch/temp" #FS_DIR_TEMP="/tmp/freeswitch/temp"
# The following is appended to the command line when starting FreeSWITCH: # The following is added to the command line when starting FreeSWITCH:
OPTIONS="-np -nonat" OPTIONS="-nonat -np"
### Hotplug configuration ### ### Hotplug configuration ###

View File

@ -11,6 +11,7 @@ FS=freeswitch
DEFAULT=/etc/default/$FS DEFAULT=/etc/default/$FS
LOGGER="/usr/bin/logger -p user.err -s -t $FS" LOGGER="/usr/bin/logger -p user.err -s -t $FS"
OPTIONS= OPTIONS=
PROG=/usr/bin/$FS
TIMEOUT=30 TIMEOUT=30
[ -f $DEFAULT ] && . $DEFAULT [ -f $DEFAULT ] && . $DEFAULT
@ -32,9 +33,9 @@ fs_dir_temp="${FS_DIR_TEMP:-/tmp/$FS/temp}"
start_service() { start_service() {
local dir= local dir=
if [ -f "/etc/${FS}_disabled" ]; then if [ "$ENABLE_FREESWITCH" != yes ]; then
$LOGGER File \"/etc/${FS}_disabled\" exists $LOGGER User configuration incomplete - not starting $FS
$LOGGER Remove it once your configuration is set up $LOGGER Check ENABLE_FREESWITCH in $DEFAULT
exit 1 exit 1
fi fi
@ -56,20 +57,23 @@ start_service() {
procd_open_instance procd_open_instance
# starting with full path seems cleaner judging by 'ps' output # starting with full path seems cleaner judging by 'ps' output
procd_set_param command /usr/bin/$FS procd_set_param command $PROG
# need to specify all or none of -conf, -log, and -db # need to specify all or none of -conf, -log, and -db
procd_append_param command -cache "$fs_dir_cache" -conf \ procd_append_param command \
"$fs_dir_etc" -db "$fs_dir_db" -log "$fs_dir_log" -recordings \ -cache "$fs_dir_cache" \
"$fs_dir_recordings" -run "$fs_dir_run" -storage "$fs_dir_storage" \ -conf "$fs_dir_etc" \
-temp "$fs_dir_temp" -db "$fs_dir_db" \
procd_append_param command -c -g "$fs_group" \
# -nc -nf: workaround for interop issue (which causes high load) -log "$fs_dir_log" \
#procd_append_param command -nc -nf -recordings "$fs_dir_recordings" \
procd_append_param command $OPTIONS -run "$fs_dir_run" \
procd_set_param user "$fs_user" -storage "$fs_dir_storage" \
# forward stdout of the command to logd -temp "$fs_dir_temp" \
#procd_set_param stdout 1 -u "$fs_user" \
# same for stderr $OPTIONS \
-nc \
-nf
# forward stderr to logd
procd_set_param stderr 1 procd_set_param stderr 1
procd_close_instance procd_close_instance
} }
@ -107,7 +111,7 @@ stop_service() {
} }
timeout=$TIMEOUT timeout=$TIMEOUT
kill $mypid kill $mypid 2>/dev/null
pgrep $FS | grep -w $mypid &>/dev/null pgrep $FS | grep -w $mypid &>/dev/null
retval=$? retval=$?