mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
voice-client: turn of voice led if no sip account is enabled
This commit is contained in:
parent
bdc4c121ab
commit
26611cec75
2 changed files with 10 additions and 4 deletions
|
|
@ -2310,10 +2310,6 @@ reload_service() {
|
|||
#stop
|
||||
start
|
||||
|
||||
# turn off voice led; asterisk will turn it on
|
||||
# if there is a registered account
|
||||
ubus call led.voice1 set '{"state":"off"}'
|
||||
|
||||
asterisk -rx "config reload $ASTERISKDIR/sip.conf"
|
||||
sleep 1
|
||||
asterisk -rx "core reload"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,16 @@ fi
|
|||
|
||||
[ "$1" == "stop" ] && exit
|
||||
|
||||
ACCOUNTENABLED=0
|
||||
for peer in $(uci show voice_client | grep sip_service_provider | awk -F[.,=] '{print$2}'); do
|
||||
[ "$(uci -q get voice_client.$peer.enabled)" == "1" ] && ACCOUNTENABLED=1
|
||||
done
|
||||
|
||||
if [ $ACCOUNTENABLED -eq 0 ]; then
|
||||
ubus call led.voice1 set '{"state":"off"}'
|
||||
exit
|
||||
fi
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
OFFHOOK=0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue