#!/bin/bash
#

STANDALONE_CONFIG_FILE=standalone.config
STANDALONE_BACKUP_FILE="$STANDALONE_CONFIG_FILE-backup"
STANDALONE_CONFIG_DIR=/etc/nyquist
BOARD_NAME=$(cat /sys/devices/platform/bone_capemgr/slot-0/board-name)
standalone_string=""
SFILE=""

check_for_intercom_volume() {
        string_to_find="INTERCOM_VOLUME"
	string_to_add=$string_to_find

        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-EDP"* ]]; then
			echo -e "$string_to_add = 0\n" >> $SFILE	
        	elif [[ "$BOARD_NAME" == "Nyquist S810V2" ]]; then
			echo -e "$string_to_add = 0\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "Nyquist Mixer" ]]; then
			echo -e "$string_to_add = -6\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10P" ]]; then
			echo -e "$string_to_add = -6\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10PV" ]]; then
			echo -e "$string_to_add = -6\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA20P2" ]]; then
			echo -e "$string_to_add = -6\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA40P3" ]]; then
			echo -e "$string_to_add = -6\n" >> $SFILE
		fi
	fi

    string_to_find="INTERCOM_VOLUME_1"
	string_to_add=$string_to_find

	if [[ ${standalone_string} != *"$string_to_find"* ]];then
                #echo "file $SFILE does not contain $string_to_find"
                if [[ "$BOARD_NAME" == "NQ-A2"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                elif [[ "$BOARD_NAME" == "NQ-A4"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                elif [[ "$BOARD_NAME" == "NQ-PA"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                fi
        fi

    string_to_find="INTERCOM_VOLUME_2"
	string_to_add=$string_to_find

	if [[ ${standalone_string} != *"$string_to_find"* ]];then
                #echo "file $SFILE does not contain $string_to_find"
                if [[ "$BOARD_NAME" == "NQ-A2"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                elif [[ "$BOARD_NAME" == "NQ-A4"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                elif [[ "$BOARD_NAME" == "NQ-PA"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                fi
        fi
        
    string_to_find="INTERCOM_VOLUME_3"
	string_to_add=$string_to_find

	if [[ ${standalone_string} != *"$string_to_find"* ]];then
                #echo "file $SFILE does not contain $string_to_find"
                if [[ "$BOARD_NAME" == "NQ-A4"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                fi
        fi
        
	string_to_find="INTERCOM_VOLUME_4"
	string_to_add=$string_to_find

	if [[ ${standalone_string} != *"$string_to_find"* ]];then
                #echo "file $SFILE does not contain $string_to_find"
                if [[ "$BOARD_NAME" == "NQ-A4"* ]]; then
                        echo -e "$string_to_add = 0\n" >> $SFILE
                fi
        fi

}

check_for_external_relay_trigger() {
        string_to_find="EXTERNAL_RELAY_TRIGGER"
	string_to_add=$string_to_find

        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		echo "file $SFILE does not contain $string_to_find"
        	if [[ "$BOARD_NAME" == "Nyquist S810V2" ]]; then
			echo -e "$string_to_add = DISABLED\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10P" ]]; then
			echo -e "$string_to_add = DISABLED\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10PV" ]]; then
			echo -e "$string_to_add = DISABLED\n" >> $SFILE	
		fi	
	fi

}

check_for_sip_enable() {
        string_to_find="SIP_ENABLE"
	string_to_add=$string_to_find

        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-EDP"* ]]; then
			echo -e "$string_to_add = 1\n" >> $SFILE	
        	else
			echo -e "$string_to_add = 0\n" >> $SFILE	
		fi
	fi
}

check_for_talkback_gain() {
        string_to_find="TALKBACK_GAIN"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA10P" ]]; then
			echo -e "$string_to_add = -6\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10PV" ]]; then
			echo -e "$string_to_add = -6\n" >> $SFILE	
		fi
	fi
}

check_for_line_enable() {
        string_to_find="LINE_STREAM_ENABLE"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "LINE_STREAM_ENABLE_1 = no\n" >> $SFILE	
			echo -e "LINE_STREAM_ENABLE_2 = no\n" >> $SFILE	
		fi
	fi
}

check_for_line_streams() {
        string_to_find="LINE_STREAM"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "LINE_STREAM_1 = \n" >> $SFILE	
			echo -e "LINE_STREAM_2 = \n" >> $SFILE	
		fi
	fi
}

check_for_line_unicast_streams() {
    string_to_find="UNICAST_STREAM_ENABLE"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_STREAM_ENABLE = no\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_STREAM_SOURCE"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_STREAM_SOURCE = 1\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_STREAM_ADDRESS"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_STREAM_ADDRESS = \n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_STREAM_PORT"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_STREAM_PORT = 6700\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_STREAM_CODEC"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_STREAM_CODEC = OPUS\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_STREAM_DESCRIPTION"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_STREAM_DESCRIPTION = \n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_RECEIVE_ENABLE"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_RECEIVE_ENABLE = no\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_RECEIVE_PORT"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_RECEIVE_PORT = 6700\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_RECEIVE_LINE_OUTPUT"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_RECEIVE_LINE_OUTPUT = 1\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_RECEIVE_CODEC"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_RECEIVE_CODEC = OPUS\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_RECEIVE_CUT"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_RECEIVE_CUT = -20\n" >> $SFILE		
		fi
	fi

	string_to_find="UNICAST_RECEIVE_DESCRIPTION"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
			echo -e "UNICAST_RECEIVE_DESCRIPTION = \n" >> $SFILE		
		fi
	fi
}

check_for_dial_extension() {
        string_to_find="DIAL_EXTENSION"
	string_to_add=$string_to_find
        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA10P"* ]]; then
			echo -e "$string_to_add = \n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10PV"* ]]; then
			echo -e "$string_to_add = \n" >> $SFILE
		elif [[ "$BOARD_NAME" == "Nyquist S810V2"* ]]; then
			echo -e "$string_to_add = \n" >> $SFILE
		elif [[ "$BOARD_NAME" == "NQ-EDP"* ]]; then
			echo -e "$string_to_add = \n" >> $SFILE
		fi
	fi
}

check_for_output_power() {
    string_to_find="OUTPUT_POWER"
	string_to_add=$string_to_find

        if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA10P"* ]]; then
			echo -e "$string_to_add = 1/2\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10PV"* ]]; then
			echo -e "$string_to_add = 1/2\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA20P2"* ]]; then
			echo -e "$string_to_add = 1/2\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA40P3"* ]]; then
			echo -e "$string_to_add = 1/2\n" >> $SFILE
		elif [[ "$BOARD_NAME" == "Nyquist S810V2"* ]]; then
			echo -e "$string_to_add = 1/2\n" >> $SFILE	
		fi
	fi
}

check_for_port_type() {
    string_to_find="PORT_TYPE"
	string_to_add=$string_to_find
    if [[ ${standalone_string} != *"$string_to_find"* ]];then
		#echo "file $SFILE does not contain $string_to_find"
		if [[ "$BOARD_NAME" == "NQ-GA10P"* ]]; then
			echo -e "$string_to_add = Digital-Call-Switch-With-Speaker\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "NQ-GA10PV"* ]]; then
			echo -e "$string_to_add = Digital-Call-Switch-With-Speaker\n" >> $SFILE	
		elif [[ "$BOARD_NAME" == "Nyquist S810V2"* ]]; then
			echo -e "$string_to_add = Digital-Call-Switch-With-Speaker\n" >> $SFILE	
		fi
	fi
}

update_missing_params() {
	echo " updating missing parameters"
	if [ -f "$STANDALONE_CONFIG_DIR/$STANDALONE_CONFIG_FILE" ]
	then
		echo "file $STANDALONE_CONFIG_FILE exists"
		SFILE=$STANDALONE_CONFIG_DIR/$STANDALONE_CONFIG_FILE
	elif [ -f "$STANDALONE_CONFIG_DIR/$STANDALONE_BACKUP_FILE" ]
        then
		echo "file $STANDALONE_BACKUP_FILE exists"
		SFILE=$STANDALONE_CONFIG_DIR/$STANDALONE_BACKUP_FILE
        fi
        standalone_string=$(cat $SFILE)
	#echo "$standalone_string"

	check_for_intercom_volume
	check_for_sip_enable
	check_for_external_relay_trigger
	check_for_line_enable
	check_for_line_streams
    check_for_output_power
    check_for_talkback_gain
	check_for_dial_extension
	check_for_port_type
	check_for_line_unicast_streams
}

echo "BOARD_NAME=$BOARD_NAME"
if [[ "$BOARD_NAME" == "NQ-A2"* ]]; then
  DEVICE_TYPE="$BOARD_NAME-Amplifier"
  AMP_SETTINGS="PORT_TYPE_1 = Paging-Audio Amp
ACCOUNT_ID_1 =
LOCAL_PORT_1 =
ACCOUNT_USERNAME_1 =
ACCOUNT_PASSWORD_1 =
LOAD_IMPEDANCE_1 = low
OUTPUT_POWER_1 = 0
INTERCOM_VOLUME_1 = 0

PORT_TYPE_2 = Paging-Audio Amp
ACCOUNT_ID_2 =
LOCAL_PORT_2 =
ACCOUNT_USERNAME_2 =
ACCOUNT_PASSWORD_2 =
LOAD_IMPEDANCE_2 = low
OUTPUT_POWER_2 = 0
INTERCOM_VOLUME_2 = 0

SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-A4"* ]]; then
  DEVICE_TYPE="$BOARD_NAME-Amplifier"
  AMP_SETTINGS="PORT_TYPE_1 = Paging-Audio Amp
ACCOUNT_ID_1 =
LOCAL_PORT_1 =
ACCOUNT_USERNAME_1 =
ACCOUNT_PASSWORD_1 =
LOAD_IMPEDANCE_1 = low
OUTPUT_POWER_1 = 0
INTERCOM_VOLUME_1 = 0

PORT_TYPE_2 = Paging-Audio Amp
ACCOUNT_ID_2 =
LOCAL_PORT_2 =
ACCOUNT_USERNAME_2 =
ACCOUNT_PASSWORD_2 =
LOAD_IMPEDANCE_2 = low
OUTPUT_POWER_2 = 0 
INTERCOM_VOLUME_2 = 0

PORT_TYPE_3 = Paging-Audio Amp
ACCOUNT_ID_3 =
LOCAL_PORT_3 =
ACCOUNT_USERNAME_3 =
ACCOUNT_PASSWORD_3 =
LOAD_IMPEDANCE_3 = low
OUTPUT_POWER_3 = 0
INTERCOM_VOLUME_3 = 0

PORT_TYPE_4 = Paging-Audio Amp
ACCOUNT_ID_4 =
LOCAL_PORT_4 =
ACCOUNT_USERNAME_4 =
ACCOUNT_PASSWORD_4 =
LOAD_IMPEDANCE_4 = low
OUTPUT_POWER_4 = 0
INTERCOM_VOLUME_4 = 0

SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-PA"* ]]; then
  DEVICE_TYPE="$BOARD_NAME Public Address Mixer Amplifier"
  AMP_SETTINGS="PORT_TYPE_1 = Paging-Audio Amp
ACCOUNT_ID_1 =
LOCAL_PORT_1 =
ACCOUNT_USERNAME_1 =
ACCOUNT_PASSWORD_1 =
LOAD_IMPEDANCE_1 = low
OUTPUT_POWER_1 = 0
INTERCOM_VOLUME_1 = 0

PORT_TYPE_2 = Paging-Audio Amp
ACCOUNT_ID_2 =
LOCAL_PORT_2 =
ACCOUNT_USERNAME_2 =
ACCOUNT_PASSWORD_2 =
SPEAKER_LOAD_IMPEDANCE = low
SPEAKER_OUTPUT_POWER = 0
INTERCOM_VOLUME_2 = 0


PTT_OUTPUT = Both

SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "Nyquist Mixer" ]]; then
  DEVICE_TYPE="NQ-P0100-Matrix Mixer Pre Amp"
  AMP_SETTINGS="ACCOUNT_ID =
LOCAL_PORT =
ACCOUNT_USERNAME =
ACCOUNT_PASSWORD = 

INTERCOM_VOLUME = -6

PTT_OUTPUT = Line-Out
SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "Nyquist S810V2" ]]; then
  DEVICE_TYPE="NQ-S1810-E7020 VoIP Speaker"
  AMP_SETTINGS="ACCOUNT_ID =
LOCAL_PORT =
ACCOUNT_USERNAME =
ACCOUNT_PASSWORD = 
DIAL_EXTENSION = 
PORT_TYPE = Digital-Call-Switch-With-Speaker

INTERCOM_VOLUME = -6
EXTERNAL_RELAY_TRIGGER = DISABLED 
SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-GA10P" ]]; then
  DEVICE_TYPE="NQ-GA10P-Intercom Module"
  AMP_SETTINGS="ACCOUNT_ID =
LOCAL_PORT =
ACCOUNT_USERNAME =
ACCOUNT_PASSWORD = 
DIAL_EXTENSION = 
PORT_TYPE = Digital-Call-Switch-With-Speaker

INTERCOM_VOLUME = -6
EXTERNAL_RELAY_TRIGGER = DISABLED
TALKBACK_GAIN = -6 
SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-GA10PV" ]]; then
  DEVICE_TYPE="NQ-GA10PV-Intercom HDMI Module"
  AMP_SETTINGS="ACCOUNT_ID =
LOCAL_PORT =
ACCOUNT_USERNAME =
ACCOUNT_PASSWORD = 
DIAL_EXTENSION = 
PORT_TYPE = Digital-Call-Switch-With-Speaker

INTERCOM_VOLUME = -6
EXTERNAL_RELAY_TRIGGER = DISABLED 
TALKBACK_GAIN = -6 
SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-GA20P2" ]]; then
  DEVICE_TYPE="NQ-GA20P2-Amplifier with Line Output"
  AMP_SETTINGS="ACCOUNT_ID =
LOCAL_PORT =
ACCOUNT_USERNAME =
ACCOUNT_PASSWORD = 

INTERCOM_VOLUME = -6
OUTPUT_POWER = 1/2
SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-GA400"* ]]; then
  DEVICE_TYPE="NQ-GA400P-AoIP Gateway"
  AMP_SETTINGS="PORT_TYPE_1 = Audio Gateway
ACCOUNT_ID_1 =
LOCAL_PORT_1 =
ACCOUNT_USERNAME_1 =
ACCOUNT_PASSWORD_1 =
LOAD_IMPEDANCE_1 = low
OUTPUT_POWER_1 = 0
INTERCOM_VOLUME_1 = 0
EXTERNAL_RELAY_TRIGGER_1 = DISABLED 

PORT_TYPE_2 = Audio Gateway
ACCOUNT_ID_2 =
LOCAL_PORT_2 =
ACCOUNT_USERNAME_2 =
ACCOUNT_PASSWORD_2 =
SPEAKER_LOAD_IMPEDANCE = low
SPEAKER_OUTPUT_POWER = 0
INTERCOM_VOLUME_2 = 0
EXTERNAL_RELAY_TRIGGER_2 = DISABLED 

LINE_STREAM_ENABLE_1 = no
LINE_STREAM_ENABLE_2 = no

LINE_STREAM_1 = 
LINE_STREAM_2 = 

SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-GA40P3" ]]; then
  DEVICE_TYPE="NQ-GA40P3-Amplifier with Line In/Out"
  AMP_SETTINGS="PORT_TYPE = Paging-Audio Amp
ACCOUNT_ID =
LOCAL_PORT =
ACCOUNT_USERNAME =
ACCOUNT_PASSWORD = 
DIAL_EXTENSION = 

OUTPUT_POWER = 1/2

INTERCOM_VOLUME = -6

SIP_ENABLED = 0"

elif [[ "$BOARD_NAME" == "NQ-EDP"* ]]; then
  DEVICE_TYPE="Entry Door Phone"
  AMP_SETTINGS="ACCOUNT_ID =
LOCAL_PORT =
ACCOUNT_USERNAME =
ACCOUNT_PASSWORD = 
DIAL_EXTENSION = 

INTERCOM_VOLUME = -6

SIP_ENABLED = 1"

else
  exit 0
fi

FILE_TO_WRITE=$STANDALONE_CONFIG_DIR/$STANDALONE_BACKUP_FILE
echo "STANDALONE_CONFIG_FILE = $STANDALONE_CONFIG_FILE"
echo "STANDALONE_BACKUP_FILE = $STANDALONE_BACKUP_FILE"
echo "Appliance Board Name: $BOARD_NAME"

if [ -f "$STANDALONE_CONFIG_DIR/$STANDALONE_CONFIG_FILE" ] || [ -f "$STANDALONE_CONFIG_DIR/$STANDALONE_BACKUP_FILE" ]
then
	echo "standalone configuration exists, check for missing parameters"
	update_missing_params
	exit 0
else
	cat > ${FILE_TO_WRITE} <<EOF
# Autogenerated - File contains all of the default configuration information for
# Web interface access on the device

DEVICE_TYPE = ${DEVICE_TYPE}
DEVICE_NAME = ${BOARD_NAME}
WEB_USERNAME = admin
WEB_PASSWORD = bogen
FW_FILENAME =
NTP_SERVER_CONFIG = ntp
NTP_SERVER =
TIMEZONE =

# VLAN_ID               The VLAN ID to use.
VLAN_ID =
# PRIORITY_802_1P       The 802.1p Priority to use.
PRIORITY_802_1P =
  
ACCOUNT_REG_URI =

REALM = *

MULTICAST_E_ALL_CALL = 239.1.1.1:6000[-9]{1,2}
MULTICAST_ALL_CALL = 239.1.1.2:6004[-18]{1,2}
MULTICAST_AUDIO_DIST = 239.1.1.3:6008[-38]{1,2}

PTT_EXTENSION =
PTT_CHANNEL =
PTT_TYPE = None
PTT_ZONES =
PTT_SRC_TO_OUT = Analog


LINE_IN_PRIORITY = 0

${AMP_SETTINGS}

EOF
fi

sudo chown root:www-data $FILE_TO_WRITE
sudo chmod 664 $FILE_TO_WRITE
