#!/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)" \
			    hw_board_VoicePortNames="$(db get hw.board.VoicePortNames)" \

	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
}
