diff --git a/resources/templates/provision/grandstream/gac2500/{$mac}.xml b/resources/templates/provision/grandstream/gac2500/{$mac}.xml
index 4762e5049b..d43098b3db 100644
--- a/resources/templates/provision/grandstream/gac2500/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gac2500/{$mac}.xml
@@ -3771,7 +3771,7 @@
- 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 407907fb70..dbfe571a93 100644
--- a/resources/templates/provision/grandstream/grp2612/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2612/{$mac}.xml
@@ -1927,7 +1927,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 289a40ddca..dadda5b812 100644
--- a/resources/templates/provision/grandstream/grp2612w/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2612w/{$mac}.xml
@@ -1927,7 +1927,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 4494504b70..4c59aa8fdb 100644
--- a/resources/templates/provision/grandstream/grp2613/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2613/{$mac}.xml
@@ -2879,7 +2879,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 bf4b837ff1..9b8bc65605 100644
--- a/resources/templates/provision/grandstream/grp2614/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2614/{$mac}.xml
@@ -3834,7 +3834,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 9884ea4be4..7107dd29fd 100644
--- a/resources/templates/provision/grandstream/grp2615/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2615/{$mac}.xml
@@ -4866,7 +4866,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 7a6e28320c..72be3c7a69 100644
--- a/resources/templates/provision/grandstream/grp2616/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp2616/{$mac}.xml
@@ -5740,7 +5740,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 acfacb9e22..c3350960fc 100644
--- a/resources/templates/provision/grandstream/grp26xx/{$mac}.xml
+++ b/resources/templates/provision/grandstream/grp26xx/{$mac}.xml
@@ -4888,7 +4888,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 6efccdb3cc..ffacc1510a 100644
--- a/resources/templates/provision/grandstream/gxp16xx/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp16xx/{$mac}.xml
@@ -1792,7 +1792,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 86e99e4b61..bfb62b6b77 100644
--- a/resources/templates/provision/grandstream/gxp17xx/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp17xx/{$mac}.xml
@@ -5818,7 +5818,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 b968967f98..c5615e3ffe 100644
--- a/resources/templates/provision/grandstream/gxp2130/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2130/{$mac}.xml
@@ -5744,7 +5744,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 fbc9308df5..ae10e1ef0f 100644
--- a/resources/templates/provision/grandstream/gxp2135/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2135/{$mac}.xml
@@ -5744,7 +5744,7 @@
- 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 8c8108c20b..512abbbd9e 100644
--- a/resources/templates/provision/grandstream/gxp2140/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2140/{$mac}.xml
@@ -5744,7 +5744,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 7c2c94e6f6..11089a69b8 100644
--- a/resources/templates/provision/grandstream/gxp2160/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2160/{$mac}.xml
@@ -5744,7 +5744,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 31f531b988..ccce52b8ee 100644
--- a/resources/templates/provision/grandstream/gxp2170/{$mac}.xml
+++ b/resources/templates/provision/grandstream/gxp2170/{$mac}.xml
@@ -5744,7 +5744,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/ht801/{$mac}.xml b/resources/templates/provision/grandstream/ht801/{$mac}.xml
index e6150054d8..720faf2153 100644
--- a/resources/templates/provision/grandstream/ht801/{$mac}.xml
+++ b/resources/templates/provision/grandstream/ht801/{$mac}.xml
@@ -1804,7 +1804,7 @@
- 2
+ {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 96849e029e..9b300803fb 100644
--- a/resources/templates/provision/grandstream/ht802/{$mac}.xml
+++ b/resources/templates/provision/grandstream/ht802/{$mac}.xml
@@ -2371,7 +2371,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}