#!/bin/sh

. /lib/functions.sh

ME="asterisk-chan-quectel"

set_call_action_ignore() {
	local section="$1"
	local action

	config_get action "$section" action
	case "$action" in
	""|reject)
		uci -q set "call_utils.$section.action=ignore"
		changed=1
		;;
	esac
}

me_en="$(jsonfilter -q -i /etc/board.json -e "@.hwinfo[\"asterisk\"]" 2>/dev/null)"
[ "$me_en" = "true" ] || exit 0

changed=0
config_load call_utils || exit 0
config_foreach set_call_action_ignore call
[ "$changed" = 1 ] && uci commit call_utils

exit 0
