diff --git a/app/grandstream/app_config.php b/app/grandstream/app_config.php
index 278802ec7f..5f2533113e 100644
--- a/app/grandstream/app_config.php
+++ b/app/grandstream/app_config.php
@@ -750,4 +750,13 @@
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Allow DHCP Option 120 to Override SIP Server. 0 - No, 1 - Yes. Default is 0";
$y++;
+ $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3addc91a-820c-4a97-8c95-d1b404eae8b2";
+ $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision";
+ $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "grandstream_ipv_mode";
+ $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric";
+ $apps[$x]['default_settings'][$y]['default_setting_value'] = "0";
+ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
+ $apps[$x]['default_settings'][$y]['default_setting_description'] = "Internet Protocol. 0 - Both, prefer IPv4, 1 - Both, prefer IPv6, 2 - IPv4 Only, 3 - IPv6 Only. Default is 0";
+ $y++;
+
?>
diff --git a/resources/templates/provision/grandstream/gac2500/{$mac}.xml b/resources/templates/provision/grandstream/gac2500/{$mac}.xml
index 4762e5049b..1b52e4558b 100644
--- a/resources/templates/provision/grandstream/gac2500/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gac2500/{$mac}.xml
@@ -3771,7 +3771,8 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
+
diff --git a/resources/templates/provision/grandstream/grp2612/{$mac}.xml b/resources/templates/provision/grandstream/grp2612/{$mac}.xml
index 1ff06f0c43..2c39cd0953 100644
--- a/resources/templates/provision/grandstream/grp2612/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2612/{$mac}.xml
@@ -1919,7 +1919,7 @@
- 2
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/grp2612w/{$mac}.xml b/resources/templates/provision/grandstream/grp2612w/{$mac}.xml
index cb927e0014..b2c271e71b 100644
--- a/resources/templates/provision/grandstream/grp2612w/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2612w/{$mac}.xml
@@ -1919,7 +1919,7 @@
- 2
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/grp2613/{$mac}.xml b/resources/templates/provision/grandstream/grp2613/{$mac}.xml
index 1c54545259..70ad5a1c88 100644
--- a/resources/templates/provision/grandstream/grp2613/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2613/{$mac}.xml
@@ -2867,7 +2867,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/grp2614/{$mac}.xml b/resources/templates/provision/grandstream/grp2614/{$mac}.xml
index 8baa84d634..86977dc9f8 100644
--- a/resources/templates/provision/grandstream/grp2614/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2614/{$mac}.xml
@@ -3818,7 +3818,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/grp2615/{$mac}.xml b/resources/templates/provision/grandstream/grp2615/{$mac}.xml
index a1ccf5475e..59da396f8f 100644
--- a/resources/templates/provision/grandstream/grp2615/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2615/{$mac}.xml
@@ -4846,7 +4846,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/grp2616/{$mac}.xml b/resources/templates/provision/grandstream/grp2616/{$mac}.xml
index cb3fa13d02..b8be9608e0 100644
--- a/resources/templates/provision/grandstream/grp2616/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2616/{$mac}.xml
@@ -5716,7 +5716,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/grp26xx/{$mac}.xml b/resources/templates/provision/grandstream/grp26xx/{$mac}.xml
index 66d9613474..6a770d47d2 100644
--- a/resources/templates/provision/grandstream/grp26xx/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp26xx/{$mac}.xml
@@ -4868,7 +4868,7 @@
- 2
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp110x/{$mac}.xml b/resources/templates/provision/grandstream/gxp110x/{$mac}.xml
index ecb28b3e4c..51ed8c3b88 100644
--- a/resources/templates/provision/grandstream/gxp110x/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp110x/{$mac}.xml
@@ -684,7 +684,7 @@
-0
+{if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp116x/{$mac}.xml b/resources/templates/provision/grandstream/gxp116x/{$mac}.xml
index 82ff771ac4..9069b3272f 100644
--- a/resources/templates/provision/grandstream/gxp116x/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp116x/{$mac}.xml
@@ -554,7 +554,7 @@
-0
+{if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp140x/{$mac}.xml b/resources/templates/provision/grandstream/gxp140x/{$mac}.xml
index d4f246777a..03fcc26fa6 100644
--- a/resources/templates/provision/grandstream/gxp140x/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp140x/{$mac}.xml
@@ -1000,7 +1000,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp140xbk/{$mac}.xml b/resources/templates/provision/grandstream/gxp140xbk/{$mac}.xml
index 6a4f2a6822..b3974b0d2f 100644
--- a/resources/templates/provision/grandstream/gxp140xbk/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp140xbk/{$mac}.xml
@@ -1000,7 +1000,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp1450/{$mac}.xml b/resources/templates/provision/grandstream/gxp1450/{$mac}.xml
index 01cf12a222..fd521edfb7 100644
--- a/resources/templates/provision/grandstream/gxp1450/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp1450/{$mac}.xml
@@ -1313,7 +1313,7 @@
-0
+{if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp1450bk/{$mac}.xml b/resources/templates/provision/grandstream/gxp1450bk/{$mac}.xml
index 38828c6035..c893fc4fd3 100644
--- a/resources/templates/provision/grandstream/gxp1450bk/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp1450bk/{$mac}.xml
@@ -1122,7 +1122,7 @@
-0
+{if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp16xx/{$mac}.xml b/resources/templates/provision/grandstream/gxp16xx/{$mac}.xml
index 0f7ed204f3..c29799eea5 100644
--- a/resources/templates/provision/grandstream/gxp16xx/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp16xx/{$mac}.xml
@@ -1780,7 +1780,7 @@
-0
+{if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp17xx/{$mac}.xml b/resources/templates/provision/grandstream/gxp17xx/{$mac}.xml
index 6a2a4f5c42..812044fc97 100644
--- a/resources/templates/provision/grandstream/gxp17xx/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp17xx/{$mac}.xml
@@ -5806,7 +5806,7 @@
-0
+{if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp2100/{$mac}.xml b/resources/templates/provision/grandstream/gxp2100/{$mac}.xml
index 4dea5864c1..33e0d419e3 100644
--- a/resources/templates/provision/grandstream/gxp2100/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2100/{$mac}.xml
@@ -2520,7 +2520,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp2124/{$mac}.xml b/resources/templates/provision/grandstream/gxp2124/{$mac}.xml
index af6c6bcab0..fc120a10a9 100644
--- a/resources/templates/provision/grandstream/gxp2124/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2124/{$mac}.xml
@@ -1737,7 +1737,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp2130/{$mac}.xml b/resources/templates/provision/grandstream/gxp2130/{$mac}.xml
index 0ab0b1ee04..6b49a43693 100644
--- a/resources/templates/provision/grandstream/gxp2130/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2130/{$mac}.xml
@@ -5720,7 +5720,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp2135/{$mac}.xml b/resources/templates/provision/grandstream/gxp2135/{$mac}.xml
index 744e398677..f3d420b5d1 100644
--- a/resources/templates/provision/grandstream/gxp2135/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2135/{$mac}.xml
@@ -5720,7 +5720,8 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
+
diff --git a/resources/templates/provision/grandstream/gxp2140/{$mac}.xml b/resources/templates/provision/grandstream/gxp2140/{$mac}.xml
index bf619b98c7..1013d302e8 100644
--- a/resources/templates/provision/grandstream/gxp2140/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2140/{$mac}.xml
@@ -5720,7 +5720,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp2160/{$mac}.xml b/resources/templates/provision/grandstream/gxp2160/{$mac}.xml
index ea266dabf6..0fd095b8bc 100644
--- a/resources/templates/provision/grandstream/gxp2160/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2160/{$mac}.xml
@@ -5720,7 +5720,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp2170/{$mac}.xml b/resources/templates/provision/grandstream/gxp2170/{$mac}.xml
index 8ff60f4ffa..af8f1522f4 100644
--- a/resources/templates/provision/grandstream/gxp2170/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2170/{$mac}.xml
@@ -5720,7 +5720,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxp21xx/{$mac}.xml b/resources/templates/provision/grandstream/gxp21xx/{$mac}.xml
index dc666c3d41..99af016147 100644
--- a/resources/templates/provision/grandstream/gxp21xx/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp21xx/{$mac}.xml
@@ -2532,7 +2532,7 @@
- 0
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/gxv3240/{$mac}.xml b/resources/templates/provision/grandstream/gxv3240/{$mac}.xml
index d3eec5cb12..4e91560712 100644
--- a/resources/templates/provision/grandstream/gxv3240/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxv3240/{$mac}.xml
@@ -4393,7 +4393,7 @@
-0
+{if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/ht802/{$mac}.xml b/resources/templates/provision/grandstream/ht802/{$mac}.xml
index 63526f3143..7f4db0ab8d 100644
--- a/resources/templates/provision/grandstream/ht802/{$mac}.xml
+++ b/resources/templates/provision/grandstream/ht802/{$mac}.xml
@@ -2363,7 +2363,7 @@
- 2
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}
diff --git a/resources/templates/provision/grandstream/ht818/{$mac}.xml b/resources/templates/provision/grandstream/ht818/{$mac}.xml
index 88f170f8d4..625d8a49b2 100644
--- a/resources/templates/provision/grandstream/ht818/{$mac}.xml
+++ b/resources/templates/provision/grandstream/ht818/{$mac}.xml
@@ -1764,7 +1764,7 @@
- 2
+ {if isset($grandstream_ipv_mode)}{$grandstream_ipv_mode}{else}0{/if}