Merge pull request #496 from micmac1/backport-sigwire

[19.07] freeswitch-stable: backport mod-signalwire + libs from master
This commit is contained in:
micmac1 2019-12-17 19:10:45 +01:00 committed by GitHub
commit 483bbd79b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 206 additions and 1 deletions

66
libs/libks/Makefile Normal file
View file

@ -0,0 +1,66 @@
#
# Copyright (C) 2019 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
PKG_NAME:=libks
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/signalwire/$(PKG_NAME).git
PKG_SOURCE_DATE=2019-09-18
PKG_SOURCE_VERSION:=df72c4c61a2deed414541735086d03259aec9679
PKG_RELEASE:=1
PKG_MIRROR_HASH:=3005101d3c80ec7d03d2097e538506a5090ded65b71169c279194ab950fd7cb5
PKG_BUILD_PARALLEL:=1
CMAKE_INSTALL:=1
PKG_LICENSE:= \
BSD-1-Clause \
BSD-3-Clause \
ISC \
MIT \
PUBLICDOMAIN \
twofish
PKG_LICENSE_FILES:=copyright
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/$(PKG_NAME)
SUBMENU:=Telephony
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Foundational support for SignalWire C products
URL:=https://github.com/signalwire/libks
ABI_VERSION:=1
DEPENDS:=+libatomic +libopenssl +libuuid
endef
# Otherwise OpenWrt's CPPFLAGS are ignored
TARGET_CFLAGS += $(TARGET_CPPFLAGS)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/*.h \
$(1)/usr/include/$(PKG_NAME)
$(INSTALL_DIR) $(1)/usr/lib/{cmake/$(PKG_NAME),pkgconfig}
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/cmake/* \
$(1)/usr/lib/cmake/$(PKG_NAME)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME).so* $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/$(PKG_NAME).pc \
$(1)/usr/lib/pkgconfig
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME).so.$(ABI_VERSION)* $(1)/usr/lib
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -0,0 +1,15 @@
--- a/cmake/FindLibM.cmake
+++ b/cmake/FindLibM.cmake
@@ -8,11 +8,7 @@
# A user may set ``LIBM_ROOT`` to a math library installation root to tell this
# module where to look.
-find_path(LIBM_INCLUDE_DIRS
- NAMES math.h
- PATHS /usr/include /usr/local/include /usr/local/bic/include
- NO_DEFAULT_PATH
-)
+find_path(LIBM_INCLUDE_DIRS math.h)
find_library(LIBM_LIBRARIES m)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibM DEFAULT_MSG LIBM_LIBRARIES LIBM_INCLUDE_DIRS)

View file

@ -0,0 +1,11 @@
--- a/src/include/libks/ks_platform.h
+++ b/src/include/libks/ks_platform.h
@@ -91,7 +91,7 @@ KS_BEGIN_EXTERN_C
#include <sys/time.h>
#include <sys/select.h>
#include <netinet/tcp.h>
-#include <sys/signal.h>
+#include <signal.h>
#include <unistd.h>
#include <strings.h>
#include <stdint.h>

View file

@ -0,0 +1,24 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,10 @@ option(WITH_LIBBACKTRACE "Enables linkin
# Must include cotire before anything else for auto pch setup
include(cmake/cotire.cmake)
+# Declare our project, libks
+project(LibKS VERSION 1.3.0 LANGUAGES C CXX)
+message("LibKS Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
+
# Load our common utility api and setup the platfomrm and build
include(cmake/ksutil.cmake)
ksutil_setup_platform()
@@ -39,10 +43,6 @@ if (KS_PLAT_WIN OR WITH_KS_TEST)
endif()
endif()
-# Declare our project, libks
-project(LibKS VERSION 1.3.0 LANGUAGES C CXX)
-message("LibKS Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
-
# Set package version
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})

View file

@ -0,0 +1,10 @@
--- a/cmake/ksutil.cmake
+++ b/cmake/ksutil.cmake
@@ -135,7 +135,6 @@ macro(ksutil_setup_platform)
set(KS_PLAT_LIN 1 CACHE INTERNAL "Platform definition" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
- add_compile_options("$<$<CONFIG:Release>:-O2>")
add_compile_options("$<$<CONFIG:Release>:-g>")
add_compile_options("$<$<CONFIG:Debug>:-O0>")

View file

@ -0,0 +1,66 @@
#
# Copyright (C) 2019 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
PKG_NAME:=signalwire-client-c
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/signalwire/signalwire-c.git
PKG_SOURCE_DATE=2019-09-20
PKG_SOURCE_VERSION:=4729b1552e5f3d8a414f5769f5ca85b4e7572305
PKG_RELEASE:=1
PKG_MIRROR_HASH:=eef97655caf076d35ee51b23de6a41b76becb6bf951348b9f981c35bb807d803
PKG_BUILD_PARALLEL:=1
CMAKE_INSTALL:=1
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=copyright
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/$(PKG_NAME)
SUBMENU:=Telephony
SECTION:=libs
CATEGORY:=Libraries
TITLE:=SignalWire C client library
URL:=https://github.com/signalwire/signalwire-c
ABI_VERSION:=1
DEPENDS:=+libatomic +libks +libopenssl
endef
# Otherwise OpenWrt's CPPFLAGS are ignored
TARGET_CFLAGS += $(TARGET_CPPFLAGS)
define Package/$(PKG_NAME)/install/headers
$(INSTALL_DIR) $(1)/usr/include/$(PKG_NAME)/$(2)
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/$(2)/*.h \
$(1)/usr/include/$(PKG_NAME)/$(2)
endef
define Build/InstallDev
$(foreach s,./ JSON blade signalwire transport,$(call Package/$(PKG_NAME)/install/headers,$(1),$(s));)
$(INSTALL_DIR) $(1)/usr/lib/{cmake/$(PKG_NAME),pkgconfig}
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/$(PKG_NAME)/cmake/* \
$(1)/usr/lib/cmake/$(PKG_NAME)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsignalwire_client.so* $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/signalwire_client.pc \
$(1)/usr/lib/pkgconfig
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsignalwire_client.so.$(ABI_VERSION)* \
$(1)/usr/lib
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View file

@ -0,0 +1,11 @@
--- a/cmake/FindLibKS.cmake
+++ b/cmake/FindLibKS.cmake
@@ -19,7 +19,7 @@ if (NOT TARGET ks)
endif()
# From here we can bootstrap into cmake stuff
- set(LIBKS_CMAKE_DIR ${LIBKS_INCLUDE_DIRS}/cmake)
+ set(LIBKS_CMAKE_DIR ${LIBKS_LIBRARY_DIRS}/cmake/libks)
# Load ks utils for our build macros
include(${LIBKS_CMAKE_DIR}/ksutil.cmake)

View file

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PRG_NAME:=freeswitch
PKG_NAME:=$(PRG_NAME)-stable
PKG_VERSION:=1.10.1
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
PKG_SOURCE:=$(PRG_NAME)-$(PKG_VERSION).-release.tar.xz
@ -192,6 +192,7 @@ FS_STABLE_MOD_AVAILABLE:= \
say_zh \
shell_stream \
shout \
signalwire \
skinny \
sms \
snapshot \
@ -1099,6 +1100,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,say_th,Thai Say,Uses prerecorded sounds
$(eval $(call Package/$(PKG_NAME)/Module,say_zh,Chinese Say,Uses prerecorded sounds to read or say various things.,))
$(eval $(call Package/$(PKG_NAME)/Module,shell_stream,Shell stream,Allows to stream audio from an arbitrary shell command.,))
$(eval $(call Package/$(PKG_NAME)/Module,shout,Shout,Allows to stream audio from MP3s or Shoutcast streams.,+lame-lib +libmpg123 +libshout))
$(eval $(call Package/$(PKG_NAME)/Module,signalwire,SignalWire,SignalWire CLOUD - FreeSWITCH connector.,+signalwire-client-c))
$(eval $(call Package/$(PKG_NAME)/Module,skinny,Skinny,Skinny Call Control Protocol endpoint support.,))
$(eval $(call Package/$(PKG_NAME)/Module,sms,SMS,This module provides an abstract facility for interfacing with SMS\nsystems.,))
$(eval $(call Package/$(PKG_NAME)/Module,snapshot,Snapshot,This module can record a sliding window of audio and take snapshots\nto disk.,))