Show SIP extensions on control panel
This commit is contained in:
parent
7e59a41e4f
commit
37be888820
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
COMPLETION_FILE=$HOME/freedombone-completed.txt
|
COMPLETION_FILE=$HOME/freedombone-completed.txt
|
||||||
SELECTED_USERNAME=
|
SELECTED_USERNAME=
|
||||||
|
SIP_CONFIG_FILE=/etc/sipwitch.conf
|
||||||
|
|
||||||
function any_key {
|
function any_key {
|
||||||
echo ' '
|
echo ' '
|
||||||
|
@ -78,6 +79,26 @@ function add_user {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show_sip_extensions {
|
||||||
|
if [ ! -f $SIP_CONFIG_FILE ]; then
|
||||||
|
return;
|
||||||
|
fi
|
||||||
|
clear
|
||||||
|
echo "SIP phone extensions:"
|
||||||
|
echo " "
|
||||||
|
while read ext; do
|
||||||
|
if [[ $ext == *"user id"* ]]; then
|
||||||
|
echo -n " "
|
||||||
|
echo -n $(echo "$ext" | awk -F '"' '{print $2}' | awk -F '"' '{print $1}')
|
||||||
|
echo -n " "
|
||||||
|
fi
|
||||||
|
if [[ $ext == *"extension"* ]]; then
|
||||||
|
echo $(echo "$ext" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}')
|
||||||
|
fi
|
||||||
|
done < $SIP_CONFIG_FILE
|
||||||
|
any_key
|
||||||
|
}
|
||||||
|
|
||||||
function select_user {
|
function select_user {
|
||||||
SELECTED_USERNAME=
|
SELECTED_USERNAME=
|
||||||
data=$(tempfile 2>/dev/null)
|
data=$(tempfile 2>/dev/null)
|
||||||
|
@ -519,13 +540,14 @@ function menu_top_level {
|
||||||
trap "rm -f $data" 0 1 2 5 15
|
trap "rm -f $data" 0 1 2 5 15
|
||||||
dialog --backtitle "Freedombone Control Panel" \
|
dialog --backtitle "Freedombone Control Panel" \
|
||||||
--title "Control Panel" \
|
--title "Control Panel" \
|
||||||
--radiolist "Choose an operation:" 13 70 6 \
|
--radiolist "Choose an operation:" 14 70 7 \
|
||||||
1 "Backup and Restore" off \
|
1 "Backup and Restore" off \
|
||||||
2 "Logging on/off" off \
|
2 "Show SIP Phone Extensions" off \
|
||||||
3 "Manage Users" off \
|
3 "Logging on/off" off \
|
||||||
4 "Email Filtering Rules" off \
|
4 "Manage Users" off \
|
||||||
5 "Security Settings" off \
|
5 "Email Filtering Rules" off \
|
||||||
6 "Exit" on 2> $data
|
6 "Security Settings" off \
|
||||||
|
7 "Exit" on 2> $data
|
||||||
sel=$?
|
sel=$?
|
||||||
case $sel in
|
case $sel in
|
||||||
1) exit 1;;
|
1) exit 1;;
|
||||||
|
@ -533,11 +555,12 @@ function menu_top_level {
|
||||||
esac
|
esac
|
||||||
case $(cat $data) in
|
case $(cat $data) in
|
||||||
1) menu_backup_restore;;
|
1) menu_backup_restore;;
|
||||||
2) logging_on_off;;
|
2) show_sip_extensions;;
|
||||||
3) menu_users;;
|
3) logging_on_off;;
|
||||||
4) menu_email;;
|
4) menu_users;;
|
||||||
5) freedombone-sec;;
|
5) menu_email;;
|
||||||
6) break;;
|
6) freedombone-sec;;
|
||||||
|
7) break;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue