Commit edf22481 authored by Yalu Zhang's avatar Yalu Zhang

Asterisk scripts: replace ubus call led.voice1 with led.voice

parent dd03ae48
......@@ -32,7 +32,7 @@ reload_service() {
generate_asterisk_config_files
# turn off voice led; asterisk will turn it on if there is a registered account
ubus call led.voice1 set '{"state":"off"}'
ubus call led.voice set '{"state":"off"}'
$BIN_FILE -x "telephony reload"
$BIN_FILE -x "sip reload"
......
......@@ -15,7 +15,7 @@ for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,
done
if [ $ACCOUNTENABLED -eq 0 ]; then
ubus call led.voice1 set '{"state":"off"}'
ubus call led.voice set '{"state":"off"}'
exit
fi
......@@ -39,11 +39,11 @@ count=$(db -q get hw.board.VoicePorts)
asterisk -x 'sip show registry' | grep -q "Registered" && REGISTERED=1
if [ $OFFHOOK -eq 1 ]; then
ubus call led.voice1 set '{"state":"notice"}'
ubus call led.voice set '{"state":"notice"}'
elif [ $REGISTERED -eq 1 ]; then
ubus call led.voice1 set '{"state":"ok"}'
ubus call led.voice set '{"state":"ok"}'
else
ubus call led.voice1 set '{"state":"error"}'
ubus call led.voice set '{"state":"error"}'
fi
ubus listen asterisk.registry asterisk.endpoint | \
......@@ -54,10 +54,10 @@ while read event ; do
json_get_var status status
if [ "$status" == "Registered" ]; then
REGISTERED=1
[ $OFFHOOK -eq 0 ] && ubus call led.voice1 set '{"state":"ok"}'
[ $OFFHOOK -eq 0 ] && ubus call led.voice set '{"state":"ok"}'
else
REGISTERED=0
[ $OFFHOOK -eq 0 ] && ubus call led.voice1 set '{"state":"error"}'
[ $OFFHOOK -eq 0 ] && ubus call led.voice set '{"state":"error"}'
fi
elif json_select asterisk.endpoint >/dev/null; then
json_get_var event event
......@@ -65,14 +65,14 @@ while read event ; do
case $event in
OFFHOOK)
OFFHOOK=1
ubus call led.voice1 set '{"state":"notice"}'
ubus call led.voice set '{"state":"notice"}'
;;
ONHOOK)
OFFHOOK=0
if [ $REGISTERED -eq 1 ]; then
ubus call led.voice1 set '{"state":"ok"}'
ubus call led.voice set '{"state":"ok"}'
else
ubus call led.voice1 set '{"state":"error"}'
ubus call led.voice set '{"state":"error"}'
fi
;;
*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment