From 1d1c621821643f466a19dcc5212143cbd15b6bbe Mon Sep 17 00:00:00 2001 From: Yalu Zhang Date: Mon, 31 Oct 2022 15:15:15 +0100 Subject: [PATCH] Add a new package voicemngr Voicemngr is an upgrading of endptmngr and supports multiple platforms. --- voicemngr/Makefile | 68 ++++++++++++++++++++++++++++ voicemngr/files/etc/init.d/voicemngr | 27 +++++++++++ 2 files changed, 95 insertions(+) create mode 100644 voicemngr/Makefile create mode 100755 voicemngr/files/etc/init.d/voicemngr diff --git a/voicemngr/Makefile b/voicemngr/Makefile new file mode 100644 index 000000000..164d02329 --- /dev/null +++ b/voicemngr/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2022 IOPSYS Software Solutions AB +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=voicemngr +PKG_VERSION:=0.1 +PKG_LICENSE:=PROPRIETARY +PKG_LICENSE_FILES:=LICENSE + +LOCAL_SRC_DIR:=~/git/voip/voicemngr +LOCAL_DEV=1 +ifneq ($(LOCAL_DEV),1) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/voicemngr.git +PKG_SOURCE_VERSION:=0901382048bb7ce01fc1767fef75e54692f56743 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_MIRROR_HASH:=skip +endif + +# All config variable that are passed to the make invocation, directly or +# indirectly. This ensures that the package is rebuilt on config-changes. +PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD + +TARGET_PLATFORM:= +ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y) + TARGET_PLATFORM:=BROADCOM +else ifeq ($(CONFIG_TARGET_iopsys_qualcomm),y) + TARGET_PLATFORM:=QUALCOMM +endif + +export TARGET_PLATFORM +export CONFIG_BRCM_SDK_VER_504040 +export CONFIG_BCM_CHIP_ID + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += -Wall -Werror + +define Package/voicemngr + CATEGORY:=Utilities + TITLE:=IOPSYS Voice Manager + URL:= + DEPENDS:= +libubox +ubus +libpicoevent +uci +TARGET_iopsys_brcm63xx_arm:bcmkernel +TARGET_iopsys_qualcomm:vtsp +endef + +define Package/voicemngr/description + Voice manager is a daemon that bridges Asterisk and platform specific DSP/SLIC APIs +endef + +ifeq ($(LOCAL_DEV),1) +define Build/Prepare + @echo "Building from the local source. TARGET_PLATFORM=$(TARGET_PLATFORM)" + rsync -av --exclude=.* $(LOCAL_SRC_DIR)/* $(PKG_BUILD_DIR)/ +endef +endif + +define Package/voicemngr/install + $(CP) ./files/* $(1)/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/voicemngr $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,voicemngr)) + diff --git a/voicemngr/files/etc/init.d/voicemngr b/voicemngr/files/etc/init.d/voicemngr new file mode 100755 index 000000000..d489dc779 --- /dev/null +++ b/voicemngr/files/etc/init.d/voicemngr @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common + +START=68 +STOP=12 + +USE_PROCD=1 +NAME=voicemngr + +start_service() { + [ "$(db -q get hw.board.hasVoice)" = "1" ] || return + + procd_open_instance + procd_set_param env hw_board_hasDect=$(db get hw.board.hasDect) + procd_set_param command $NAME + procd_set_param respawn "5" "0" "3" + procd_set_param nice -12 + procd_close_instance +} + +reload_service() { + stop + start +} + +service_triggers() { + procd_add_reload_trigger asterisk +}