diff --git a/app/avaya/app_config.php b/app/avaya/app_config.php
new file mode 100644
index 0000000000..2c8a5a9531
--- /dev/null
+++ b/app/avaya/app_config.php
@@ -0,0 +1,147 @@
+
diff --git a/app/avaya/resources/firmware/README.md b/app/avaya/resources/firmware/README.md
new file mode 100644
index 0000000000..fac538e9c3
--- /dev/null
+++ b/app/avaya/resources/firmware/README.md
@@ -0,0 +1 @@
+For Provisioning to work propery you will need to be on firmware 4.1.4.0.5 and greater
\ No newline at end of file
diff --git a/app/devices/resources/classes/device.php b/app/devices/resources/classes/device.php
index 5f768c07cb..0a34747748 100644
--- a/app/devices/resources/classes/device.php
+++ b/app/devices/resources/classes/device.php
@@ -70,6 +70,162 @@
case "00085d":
$device_vendor = "aastra";
break;
+ case "00040d":
+ $device_vendor = "avaya";
+ break;
+ case "001b4f":
+ $device_vendor = "avaya";
+ break;
+ case "00549f":
+ $device_vendor = "avaya";
+ break;
+ case "048a15":
+ $device_vendor = "avaya";
+ break;
+ case "10cdae":
+ $device_vendor = "avaya";
+ break;
+ case "14612f":
+ $device_vendor = "avaya";
+ break;
+ case "24b209":
+ $device_vendor = "avaya";
+ break;
+ case "24d921":
+ $device_vendor = "avaya";
+ break;
+ case "2cf4c5":
+ $device_vendor = "avaya";
+ break;
+ case "3475c7":
+ $device_vendor = "avaya";
+ break;
+ case "38bb3c":
+ $device_vendor = "avaya";
+ break;
+ case "3c3a73":
+ $device_vendor = "avaya";
+ break;
+ case "3cb15b":
+ $device_vendor = "avaya";
+ break;
+ case "44322a":
+ $device_vendor = "avaya";
+ break;
+ case "506184":
+ $device_vendor = "avaya";
+ break;
+ case "50cd22":
+ $device_vendor = "avaya";
+ break;
+ case "581626":
+ $device_vendor = "avaya";
+ break;
+ case "6049c1":
+ $device_vendor = "avaya";
+ break;
+ case "646a52":
+ $device_vendor = "avaya";
+ break;
+ case "64a7dd":
+ $device_vendor = "avaya";
+ break;
+ case "64c354":
+ $device_vendor = "avaya";
+ break;
+ case "6ca849":
+ $device_vendor = "avaya";
+ break;
+ case "6cfa58":
+ $device_vendor = "avaya";
+ break;
+ case "703018":
+ $device_vendor = "avaya";
+ break;
+ case "7038ee":
+ $device_vendor = "avaya";
+ break;
+ case "7052c5":
+ $device_vendor = "avaya";
+ break;
+ case "707c69":
+ $device_vendor = "avaya";
+ break;
+ case "801daa":
+ $device_vendor = "avaya";
+ break;
+ case "848371":
+ $device_vendor = "avaya";
+ break;
+ case "90fb5b":
+ $device_vendor = "avaya";
+ break;
+ case "a009ed":
+ $device_vendor = "avaya";
+ break;
+ case "a01290":
+ $device_vendor = "avaya";
+ break;
+ case "a051c6":
+ $device_vendor = "avaya";
+ break;
+ case "a4251b":
+ $device_vendor = "avaya";
+ break;
+ case "a47886":
+ $device_vendor = "avaya";
+ break;
+ case "b0adaa":
+ $device_vendor = "avaya";
+ break;
+ case "b4475e":
+ $device_vendor = "avaya";
+ break;
+ case "b4a95a":
+ $device_vendor = "avaya";
+ break;
+ case "b4b017":
+ $device_vendor = "avaya";
+ break;
+ case "bcadab":
+ $device_vendor = "avaya";
+ break;
+ case "c057bc":
+ $device_vendor = "avaya";
+ break;
+ case "c4bed4":
+ $device_vendor = "avaya";
+ break;
+ case "c81fea":
+ $device_vendor = "avaya";
+ break;
+ case "c8f406":
+ $device_vendor = "avaya";
+ break;
+ case "ccf954":
+ $device_vendor = "avaya";
+ break;
+ case "d47856":
+ $device_vendor = "avaya";
+ break;
+ case "d4ea0e":
+ $device_vendor = "avaya";
+ break;
+ case "e45d52":
+ $device_vendor = "avaya";
+ break;
+ case "f81547":
+ $device_vendor = "avaya";
+ break;
+ case "f873a2":
+ $device_vendor = "avaya";
+ break;
+ case "fc8399":
+ $device_vendor = "avaya";
+ break;
+ case "fca841":
+ $device_vendor = "avaya";
+ break;
case "001873":
$device_vendor = "cisco";
break;
@@ -222,6 +378,9 @@
if (preg_replace('/^.*?(flyingvoice).*$/i', '$1', $agent) == "flyingvoice") {
return "flyingvoice";
}
+ if (preg_replace('/^.*?(avaya).*$/i', '$1', $agent) == "avaya") {
+ return "avaya";
+ }
// unknown vendor
return "";
}
diff --git a/app/switch/resources/scripts/app/event_notify/index.lua b/app/switch/resources/scripts/app/event_notify/index.lua
index cde11fcf53..a9d10e65fb 100644
--- a/app/switch/resources/scripts/app/event_notify/index.lua
+++ b/app/switch/resources/scripts/app/event_notify/index.lua
@@ -185,6 +185,16 @@
end
end
+--avaya
+ if (vendor == "avaya") then
+ if (command == "reboot") then
+ event:addHeader('event-string', 'check-sync;reboot=true');
+ end
+ if (command == "check_sync") then
+ event:addHeader('event-string', 'check-sync;reboot=false');
+ end
+ end
+
--send the event
event:fire();
diff --git a/resources/templates/provision/avaya/J169/directory.xml b/resources/templates/provision/avaya/J169/directory.xml
new file mode 100644
index 0000000000..8b3dfd825e
--- /dev/null
+++ b/resources/templates/provision/avaya/J169/directory.xml
@@ -0,0 +1,14 @@
+
+{foreach $contacts as $row}
+
+ {$row.contact_name_family}
+ {$row.contact_name_given}
+
+
+ {if $row.category == "extensions"}{$row.phone_extension}{else}{$row.phone_number}{/if}
+ Work
+
+
+
+{/foreach}
+
\ No newline at end of file
diff --git a/resources/templates/provision/avaya/J169/{$mac}.cfg b/resources/templates/provision/avaya/J169/{$mac}.cfg
index 3ab4b5df63..421e32ff53 100644
--- a/resources/templates/provision/avaya/J169/{$mac}.cfg
+++ b/resources/templates/provision/avaya/J169/{$mac}.cfg
@@ -1,13 +1,19 @@
## Phone firmware
-SET APPNAME "{if isset($avaya_j169_firmware_filename)}{$avaya_j169_firmware_filename}{else}FW_S_J169_R4_0_2_1_3.bin{/if}"
+SET APPNAME "{if isset($avaya_j169_firmware_filename)}{$avaya_j169_firmware_filename}{else}FW_S_J169_R4_1_4_0_5.bin{/if}"
## JEM24 Expansion Module firmware
-SET "{if isset($avaya_jem24_firmware_filename)}{$avaya_jem24_firmware_filename}{else}JEM24_APPNAME FW_JEM24_R1_0_1_0_8.bin{/if}"
+SET "{if isset($avaya_jem24_firmware_filename)}{$avaya_jem24_firmware_filename}{else}JEM24_APPNAME FW_JEM24_R1_0_1_0_26.bin{/if}"
+
+## Enable Out-Of-Dialog REFER messages to provision or reboot the device
+SET ENABLE_OOD_RESET_NOTIFY 1
+## Do not require TLS to accept Out-Of-Dialog REFER messages
+SET ENABLE_OOD_MSG_TLS_ONLY 0
## Trust public certs rather than the phone downloading a trusted cert from the server
SET ENABLE_PUBLIC_CA_CERTS 1
## Set Admin Access
## 27238 is the Avaya default
+## Valid values are 8 to 31 alphanumeric characters.
SET ENABLE_WEBSERVER 1
SET FORCE_WEB_ADMIN_PASSWORD "{if isset($admin_password)}{$admin_password}{else}27238{/if}"
@@ -29,6 +35,25 @@ SET CODEC_PRIORITY G711U
## 7 means 1+2+4
SET CALLFWDSTAT 7
+## Sets the BLF incoming call mode
+## 0 - None (no alerting for BLF incoming call).
+## 1 - Audible (only audible alerting for BLF incoming call).
+## 2 - Visual (only visual alerting for BLF incoming call).
+## 3(default) - Both (both audible and visual alerting for BLF incoming call)
+## 4 - Force None (forced only audible alerting for BLF incoming call).
+## 5 - Force Audible (forced only audible alerting for BLF incoming call).
+## 6 - Force Visual (forced only visual alerting for BLF incoming call).
+## 7 - Force Both (forced both audible and visual alerting for BLF incoming call).
+SET BLF_INCOMING_CALL_INDICATION_MODE 0
+
+## Specifies whether Prioritize own incoming calls over BLF calls feature is enabled or not. Valid values are:
+## 0 - Feature is disabled. The phone displays all calls in the order they are received.
+## 1 - Feature is enabled. The phone displays user’s own incoming calls and own parked calls before BLF calls and BLF parked calls.
+SET PRIORITIZE_OWN_INCOMING_CALL 1
+
+## Allows the call decline button to be visible
+SET CALL_DECLINE_POLICY 1
+
## Allow the phone to be locked
SET ENABLE_PHONE_LOCK 1
@@ -107,14 +132,14 @@ SET PSTN_VM_NUM *97
## BACKGROUND_IMAGE - The selected image
## BACKGROUND_IMAGE_AVAILABLE - The list of available images
-{if isset($avaya_j179_wallpaper)}
-SET BACKGROUND_IMAGE "{$avaya_j179_wallpaper}"
-SET BACKGROUND_IMAGE_AVAILABLE "{$avaya_j169_wallpaper}"
-SET BACKGROUND_IMAGE_DISPLAY "{$avaya_j169_wallpaper}"
+{if isset($avaya_j169_wallpaper_url)}
+SET BACKGROUND_IMAGE "{$avaya_j169_wallpaper_url}"
+SET BACKGROUND_IMAGE_AVAILABLE "{$avaya_j169_wallpaper_url}"
+SET BACKGROUND_IMAGE_DISPLAY "{$avaya_j169_wallpaper_url}"
{/if}
-{if isset($avaya_jem24_wallpaper)}
-SET BACKGROUND_IMAGE_AVAILABLE_JEM "{$avaya_jem24_wallpaper}"
-SET SCREENSAVER_IMAGE_AVAILABLE_JEM "{$avaya_jem24_wallpaper}"
+{if isset($avaya_jem24_wallpaper_url)}
+SET BACKGROUND_IMAGE_AVAILABLE_JEM "{$avaya_jem24_wallpaper_url}"
+SET SCREENSAVER_IMAGE_AVAILABLE_JEM "{$avaya_jem24_wallpaper_url}"
{/if}
## Disable Avaya Mode
@@ -158,19 +183,19 @@ SET SIMULTANEOUS_REGISTRATIONS 1
{foreach $keys["line"] as $row}
{if in_array($row.device_key_type, array("callfwd", "callfwdna", "callfwdbusy", "dnd" , "autoanswer"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
{elseif in_array($row.device_key_type, array("blf"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};attr1={$row.device_key_value};attr2={$row.device_key_value};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};attr1={$row.device_key_value};attr2={$row.device_key_value};Forced"
{elseif in_array($row.device_key_type, array("lock", "logout", "screensaver"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=application;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=application;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
{elseif in_array($row.device_key_type, array("primary"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=line;Name={$row.device_key_type};attr1={$row.device_key_line};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=line;Name={$row.device_key_type};attr1={$row.device_key_line};Forced"
{elseif in_array($row.device_key_type, array("autodial"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=autodial;Name={$row.device_key_type};attr1={$row.device_key_value};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=autodial;Name={$row.device_key_type};attr1={$row.device_key_value};Label={$row.device_key_label};Forced"
{/if}
{/foreach}
diff --git a/resources/templates/provision/avaya/J179/directory.xml b/resources/templates/provision/avaya/J179/directory.xml
new file mode 100644
index 0000000000..8b3dfd825e
--- /dev/null
+++ b/resources/templates/provision/avaya/J179/directory.xml
@@ -0,0 +1,14 @@
+
+{foreach $contacts as $row}
+
+ {$row.contact_name_family}
+ {$row.contact_name_given}
+
+
+ {if $row.category == "extensions"}{$row.phone_extension}{else}{$row.phone_number}{/if}
+ Work
+
+
+
+{/foreach}
+
\ No newline at end of file
diff --git a/resources/templates/provision/avaya/J179/{$mac}.cfg b/resources/templates/provision/avaya/J179/{$mac}.cfg
index 64755f10e2..a97be627c7 100644
--- a/resources/templates/provision/avaya/J179/{$mac}.cfg
+++ b/resources/templates/provision/avaya/J179/{$mac}.cfg
@@ -1,13 +1,19 @@
## Phone firmware
-SET APPNAME "{if isset($avaya_j179_firmware_filename)}{$avaya_j179_firmware_filename}{else}FW_S_J179_R4_0_2_1_3.bin{/if}"
+SET APPNAME "{if isset($avaya_j179_firmware_filename)}{$avaya_j179_firmware_filename}{else}FW_S_J179_R4_1_4_0_5.bin{/if}"
## JEM24 Expansion Module firmware
-SET "{if isset($avaya_jem24_firmware_filename)}{$avaya_jem24_firmware_filename}{else}JEM24_APPNAME FW_JEM24_R1_0_1_0_8.bin{/if}"
+SET "{if isset($avaya_jem24_firmware_filename)}{$avaya_jem24_firmware_filename}{else}JEM24_APPNAME FW_JEM24_R1_0_1_0_26.bin{/if}"
+
+## Enable Out-Of-Dialog REFER messages to provision or reboot the device
+SET ENABLE_OOD_RESET_NOTIFY 1
+## Do not require TLS to accept Out-Of-Dialog REFER messages
+SET ENABLE_OOD_MSG_TLS_ONLY 0
## Trust public certs rather than the phone downloading a trusted cert from the server
SET ENABLE_PUBLIC_CA_CERTS 1
## Set Admin Access
## 27238 is the Avaya default
+## Valid values are 8 to 31 alphanumeric characters.
SET ENABLE_WEBSERVER 1
SET FORCE_WEB_ADMIN_PASSWORD "{if isset($admin_password)}{$admin_password}{else}27238{/if}"
@@ -29,6 +35,25 @@ SET CODEC_PRIORITY G711U
## 7 means 1+2+4
SET CALLFWDSTAT 7
+## Sets the BLF incoming call mode
+## 0 - None (no alerting for BLF incoming call).
+## 1 - Audible (only audible alerting for BLF incoming call).
+## 2 - Visual (only visual alerting for BLF incoming call).
+## 3(default) - Both (both audible and visual alerting for BLF incoming call)
+## 4 - Force None (forced only audible alerting for BLF incoming call).
+## 5 - Force Audible (forced only audible alerting for BLF incoming call).
+## 6 - Force Visual (forced only visual alerting for BLF incoming call).
+## 7 - Force Both (forced both audible and visual alerting for BLF incoming call).
+SET BLF_INCOMING_CALL_INDICATION_MODE 0
+
+## Specifies whether Prioritize own incoming calls over BLF calls feature is enabled or not. Valid values are:
+## 0 - Feature is disabled. The phone displays all calls in the order they are received.
+## 1 - Feature is enabled. The phone displays user’s own incoming calls and own parked calls before BLF calls and BLF parked calls.
+SET PRIORITIZE_OWN_INCOMING_CALL 1
+
+## Allows the call decline button to be visible
+SET CALL_DECLINE_POLICY 1
+
## Allow the phone to be locked
SET ENABLE_PHONE_LOCK 1
@@ -158,19 +183,19 @@ SET SIMULTANEOUS_REGISTRATIONS 1
{foreach $keys["line"] as $row}
{if in_array($row.device_key_type, array("callfwd", "callfwdna", "callfwdbusy", "dnd" , "autoanswer"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
{elseif in_array($row.device_key_type, array("blf"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};attr1={$row.device_key_value};attr2={$row.device_key_value};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};attr1={$row.device_key_value};attr2={$row.device_key_value};Forced"
{elseif in_array($row.device_key_type, array("lock", "logout", "screensaver"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=application;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=application;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
{elseif in_array($row.device_key_type, array("primary"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=line;Name={$row.device_key_type};attr1={$row.device_key_line};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=line;Name={$row.device_key_type};attr1={$row.device_key_line};Forced"
{elseif in_array($row.device_key_type, array("autodial"))}
-SET PHONEKEY "Key={$row.device_key_id};Type=autodial;Name={$row.device_key_type};attr1={$row.device_key_value};Forced"
+SET PHONEKEY "Key={$row.device_key_id+1};Type=autodial;Name={$row.device_key_type};attr1={$row.device_key_value};Label={$row.device_key_label};Forced"
{/if}
{/foreach}
diff --git a/resources/templates/provision/avaya/J189/directory.xml b/resources/templates/provision/avaya/J189/directory.xml
new file mode 100644
index 0000000000..8b3dfd825e
--- /dev/null
+++ b/resources/templates/provision/avaya/J189/directory.xml
@@ -0,0 +1,14 @@
+
+{foreach $contacts as $row}
+
+ {$row.contact_name_family}
+ {$row.contact_name_given}
+
+
+ {if $row.category == "extensions"}{$row.phone_extension}{else}{$row.phone_number}{/if}
+ Work
+
+
+
+{/foreach}
+
\ No newline at end of file
diff --git a/resources/templates/provision/avaya/J189/{$mac}.cfg b/resources/templates/provision/avaya/J189/{$mac}.cfg
new file mode 100644
index 0000000000..920f261b71
--- /dev/null
+++ b/resources/templates/provision/avaya/J189/{$mac}.cfg
@@ -0,0 +1,206 @@
+## Phone firmware
+SET APPNAME "{if isset($avaya_j189_firmware_filename)}{$avaya_j189_firmware_filename}{else}FW_S_J189_R4_1_4_0_5.bin{/if}"
+## JEM24 Expansion Module firmware
+SET "{if isset($avaya_jem24_firmware_filename)}{$avaya_jem24_firmware_filename}{else}JEM24_APPNAME FW_JEM24_R1_0_1_0_26.bin{/if}"
+
+## Enable Out-Of-Dialog REFER messages to provision or reboot the device
+SET ENABLE_OOD_RESET_NOTIFY 1
+## Do not require TLS to accept Out-Of-Dialog REFER messages
+SET ENABLE_OOD_MSG_TLS_ONLY 0
+
+## Trust public certs rather than the phone downloading a trusted cert from the server
+SET ENABLE_PUBLIC_CA_CERTS 1
+
+## Set Admin Access
+## 27238 is the Avaya default
+## Valid values are 8 to 31 alphanumeric characters.
+SET ENABLE_WEBSERVER 1
+SET FORCE_WEB_ADMIN_PASSWORD "{if isset($admin_password)}{$admin_password}{else}27238{/if}"
+
+SET SHA2CAPABLE 1
+SET ENABLE_PRESENCE 0
+
+## Codec Settings
+SET ENABLE_G729 0
+SET ENABLE_G722 0
+SET ENABLE_G726 0
+SET ENABLE_OPUS 0
+SET CODEC_PRIORITY G711U
+
+## Call forwarding allowed
+## 1 = permits unconditional call forwarding
+## 2 = permits call forwarding on busy
+## 4 = permits call forwarding on no answer
+## add the numbers above to get your desired combination
+## 7 means 1+2+4
+SET CALLFWDSTAT 7
+
+## Sets the BLF incoming call mode
+## 0 - None (no alerting for BLF incoming call).
+## 1 - Audible (only audible alerting for BLF incoming call).
+## 2 - Visual (only visual alerting for BLF incoming call).
+## 3(default) - Both (both audible and visual alerting for BLF incoming call)
+## 4 - Force None (forced only audible alerting for BLF incoming call).
+## 5 - Force Audible (forced only audible alerting for BLF incoming call).
+## 6 - Force Visual (forced only visual alerting for BLF incoming call).
+## 7 - Force Both (forced both audible and visual alerting for BLF incoming call).
+SET BLF_INCOMING_CALL_INDICATION_MODE 0
+
+## Specifies whether Prioritize own incoming calls over BLF calls feature is enabled or not. Valid values are:
+## 0 - Feature is disabled. The phone displays all calls in the order they are received.
+## 1 - Feature is enabled. The phone displays user’s own incoming calls and own parked calls before BLF calls and BLF parked calls.
+SET PRIORITIZE_OWN_INCOMING_CALL 1
+
+## Allows the call decline button to be visible
+SET CALL_DECLINE_POLICY 1
+
+## Allow the phone to be locked
+SET ENABLE_PHONE_LOCK 1
+
+## DISABLE Avaya Spaces
+SET SPACES_ACCESS_MODE 0
+
+SET CALL_PICKUP_BARGEIN_FAC *33
+
+SET ENCRYPT_VERSION_IN_USE 1
+SET MAX__DISPLAYED_SESSION_APPEARANCES 3
+SET ENHDIALSTAT 0
+
+## Specifies the screen mode used on the phone
+## 0 = Non-forced Half Screen mode
+## 1 = Non-forced Full Screen mode
+## 2 = Forced Half Screen mode is used
+## 3 = Forced Full Screen mode
+SET PHONE_SCREEN_MODE 2
+
+## Specifies the scrolling mode used on the phone
+## 0 = Line scrolling mode
+## 1 = Page scrolling mode
+SET SCROLLING_MODE 1
+
+SET OVERRIDE_USER_SELECTION ""
+
+SET USER_LOGGED_IN 1
+
+SET LANGUAGE_FILE_IN_USE Mlf_English.xml
+SET LANGUAGES_RESOURCE_LIST English=res://Mlf_English.xml,Canadian French=lang/Mlf_J169_J179_CanadianFrench.xml,Latin American Spanish=lang/Mlf_J169_J179_LatinAmericanSpanish.xml,Brazilian Portuguese=lang/Mlf_J169_J179_BrazilianPortuguese.xml,Italian=lang/Mlf_J169_J179_Italian.xml
+SET SYSTEM_LANGUAGE Mlf_J169_J179_English.xml
+SET LANGUAGE_IN_USE English
+SET LANGUAGES Mlf_J169_J179_CanadianFrench.xml,Mlf_J169_J179_LatinAmericanSpanish.xml,Mlf_J169_J179_BrazilianPortuguese.xml,Mlf_J169_J179_Italian.xml
+
+## DIALING_MODE_DEFAULT
+## 0 - Automatic
+## 1 - Manual
+SET DIALING_MODE_DEFAULT 0
+## Dialplan
+## |: This character is used to separate each different number pattern.
+## X: This character is a wildcard for any single digit match.
+## [ ]- Square brackets can be used to contain possible specific single digit matches. For example:
+## [1237] matches 1, 2, 3 or 7. A - character can be used to match a range of digits.
+## [1-4] matches any digit from 1 to 4.
+SET DIALPLAN "{if isset($avaya_dialplan)}{$avaya_dialplan}{else}XXX|XXXX,*XX,1XXXXXXXXXX,XXXXXXXXXX{/if}"
+## INTER_DIGIT_TIMEOUT - Set the number of seconds from the last digit dialed after which the phone assumes dialing is complete and send the digits dialed to the system
+SET INTER_DIGIT_TIMEOUT 2
+
+## GMTOFFSET
+SET GMTOFFSET "{if isset($avaya_time_zone)}{$avaya_time_zone}{else}-5:00{/if}"
+## Time format
+## 0 - 12hr, 1 - 24h, 2 - 12hr forced, 3 - 24h forced
+SET ADMINTIMEFORMAT 0
+## DST start date. Default: 2SunMar2L
+SET DSTSTART "{if isset($avaya_dst_start)}{$avaya_dst_start}{else}2SunMar2L{/if}"
+## DST stop date. Default: 1SunNov2L
+SET DSTSTOP "{if isset($avaya_dst_stop)}{$avaya_dst_stop}{else}1SunNov2L{/if}"
+
+SET ENABLE_SHOW_EMERG_SK 0
+SET ENABLE_SHOW_EMERG_SK_UNREG 0
+SET DISCOVER_AVAYA_ENVIRONMENT 0
+SET TCP_KEEP_ALIVE_TIME 30
+SET DTMF_PAYLOAD_TYPE 101
+SET RTP_PORT_LOW 40750
+SET RTP_PORT_RANGE 10000
+
+## User Key customization
+## 0 - Blocked, 1 - Limited (User customization is allowed for Applications and Contacts), 2 - Full
+SET CUSTOMIZATION_MODE {if isset($avaya_key_customization)}{$avaya_key_customization}{else}0{/if}
+
+## Specifies whether the Auto Answer feature is available to users.
+SET ENABLE_AUTO_ANSWER_SUPPORT 1
+
+## Voicemail access code
+SET PSTN_VM_NUM *97
+
+## BACKGROUND_IMAGE - The selected image
+## BACKGROUND_IMAGE_AVAILABLE - The list of available images
+{if isset($avaya_j189_wallpaper_url)}
+SET BACKGROUND_IMAGE "{$avaya_j189_wallpaper_url}"
+SET BACKGROUND_IMAGE_AVAILABLE "{$avaya_j189_wallpaper_url}"
+SET BACKGROUND_IMAGE_DISPLAY "{$avaya_j189_wallpaper_url}"
+{/if}
+{if isset($avaya_j189_secondary_wallpaper_url)}
+SET BACKGROUND_IMAGE "{$avaya_j189_secondary_wallpaper_url}"
+SET BACKGROUND_IMAGE_AVAILABLE "{$avaya_j189_secondary_wallpaper_url}"
+SET BACKGROUND_IMAGE_DISPLAY "{$avaya_j189_wallpaper_url}"
+{/if}
+{if isset($avaya_jem24_wallpaper_url)}
+SET BACKGROUND_IMAGE_AVAILABLE_JEM "{$avaya_jem24_wallpaper_url}"
+SET SCREENSAVER_IMAGE_AVAILABLE_JEM "{$avaya_jem24_wallpaper_url}"
+{/if}
+
+## Disable Avaya Mode
+SET ENABLE_IPOFFICE 0
+SET ENABLE_AVAYA_ENVIRONMENT 0
+SET ENABLE_3PCC_ENVIRONMENT 1
+SET 3PCC_SERVER_MODE 0
+
+SET DES_BLOCK 1
+SET DES_SUPPORT 0
+SET DES_STAT 0
+SET BLF_LIST_URI_CURRENT BLFfakegroup
+{if isset($avaya_directory_url)}SET DOWNLOADABLE_DIRECTORY {$avaya_directory_url}{/if}
+SET ENABLE_RCV_CONFERENCE 0
+
+{foreach $lines as $row}
+SET FORCE_SIP_EXTENSION {$row.user_id}
+SET FORCE_SIP_USERNAME {$row.user_id}
+SET FORCE_SIP_PASSWORD {$row.password}
+
+SET SIP_USER_ACCOUNT {$row.user_id}@{$row.server_address}
+SET SIP_USER_ID {$row.user_id}
+
+SET SNTPSRVR "{if isset($avaya_ntp_server)}{$avaya_ntp_server}{else}ca.pool.ntp.org{/if}"
+
+SET SIP_CONTROLLER_LIST {$row.server_address}:{$row.sip_port};transport={$row.sip_transport}
+SET SIPPROXYSRVR_IN_USE {$row.server_address}
+SET SIP_PROXY_SELECTION_POLICY 1
+SET SIPDOMAIN {$row.server_address}
+SET MWISRVR {$row.server_address}
+SET RTCPMON {$row.server_address}
+SET SIMULTANEOUS_REGISTRATIONS 1
+
+{if $row@index eq 2}{break}{/if}
+{/foreach}
+
+## Button config
+## Type can be feature,application,line,autodial
+## Name is the name of the button type. All options can be found here: https://documentation.avaya.com/bundle/InstallandAdminJ100seriesIPPhonein3PCCsetup_r4.0.11/page/PHONEKEY_parameter_values__3PCC_.html
+## attr1 is usually the specific data for the button. For example extension number
+{foreach $keys["line"] as $row}
+
+{if in_array($row.device_key_type, array("callfwd", "callfwdna", "callfwdbusy", "dnd" , "autoanswer"))}
+SET PHONEKEY "Key={$row.device_key_id+1};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
+
+{elseif in_array($row.device_key_type, array("blf"))}
+SET PHONEKEY "Key={$row.device_key_id+1};Type=feature;Name={$row.device_key_type};Label={$row.device_key_label};attr1={$row.device_key_value};attr2={$row.device_key_value};Forced"
+
+{elseif in_array($row.device_key_type, array("lock", "logout", "screensaver"))}
+SET PHONEKEY "Key={$row.device_key_id+1};Type=application;Name={$row.device_key_type};Label={$row.device_key_label};Forced"
+
+{elseif in_array($row.device_key_type, array("primary"))}
+SET PHONEKEY "Key={$row.device_key_id+1};Type=line;Name={$row.device_key_type};attr1={$row.device_key_line};Forced"
+
+{elseif in_array($row.device_key_type, array("autodial"))}
+SET PHONEKEY "Key={$row.device_key_id+1};Type=autodial;Name={$row.device_key_type};attr1={$row.device_key_value};Label={$row.device_key_label};Forced"
+
+{/if}
+{/foreach}