diff --git a/resources/templates/provision/fanvil/x7c/{$mac}.cfg b/resources/templates/provision/fanvil/x7c/{$mac}.cfg index f6140b1fb..6b79330ba 100644 --- a/resources/templates/provision/fanvil/x7c/{$mac}.cfg +++ b/resources/templates/provision/fanvil/x7c/{$mac}.cfg @@ -1,5 +1,5 @@ - + 2.0000000000 @@ -21,6 +21,7 @@ password 2 1500 + @@ -32,6 +33,7 @@ 0 0 Fanvil X7C + {$fanvil_wifi_enable} 0 @@ -47,6 +49,7 @@ 1 0 Fanvil X7C + 0 user123 password @@ -60,6 +63,7 @@ 1 0 Fanvil X7C + 10 @@ -81,6 +85,7 @@ 0 117 0 + 98 10000 1000 1 @@ -113,6 +118,9 @@ 2000000 4 2 + 0 + 0 + 0 @@ -147,6 +155,8 @@ 3600 0 {if isset($account.1.password)}1{else}0{/if} + 0 + 0 {$account.1.outbound_proxy_primary} {$account.1.sip_port} {$account.1.auth_id} @@ -160,6 +170,7 @@ 0 3 + 0 0 0 @@ -223,6 +234,7 @@ + 0 0 @@ -252,6 +264,7 @@ 0 0 4 + 0 0 1 @@ -292,6 +305,8 @@ 5000 0 0 + + {$account.2.user_id} @@ -309,6 +324,8 @@ 3600 0 {if isset($account.2.password)}1{else}0{/if} + 0 + 0 {$account.2.outbound_proxy_primary} {$account.2.sip_port} {$account.2.auth_id} @@ -322,6 +339,7 @@ 0 3 + 0 0 0 @@ -385,6 +403,7 @@ + 0 0 @@ -414,6 +433,7 @@ 0 0 4 + 0 0 1 @@ -454,6 +474,8 @@ 5000 0 0 + + {$account.3.user_id} @@ -471,6 +493,8 @@ 3600 0 {if isset($account.3.password)}1{else}0{/if} + 0 + 0 {$account.3.outbound_proxy_primary} {$account.3.sip_port} {$account.3.auth_id} @@ -484,6 +508,7 @@ 0 3 + 0 0 0 @@ -547,6 +572,7 @@ + 0 0 @@ -576,6 +602,7 @@ 0 0 4 + 0 0 1 @@ -616,6 +643,8 @@ 5000 0 0 + + {$account.4.user_id} @@ -633,6 +662,8 @@ 3600 0 {if isset($account.4.password)}1{else}0{/if} + 0 + 0 {$account.4.outbound_proxy_primary} {$account.4.sip_port} {$account.4.auth_id} @@ -646,6 +677,7 @@ 0 3 + 0 0 0 @@ -709,6 +741,7 @@ + 0 0 @@ -738,6 +771,7 @@ 0 0 4 + 0 0 1 @@ -778,6 +812,8 @@ 5000 0 0 + + {$account.5.user_id} @@ -795,6 +831,8 @@ 3600 0 {if isset($account.5.password)}1{else}0{/if} + 0 + 0 {$account.5.outbound_proxy_primary} {$account.5.sip_port} {$account.5.auth_id} @@ -808,6 +846,7 @@ 0 3 + 0 0 0 @@ -871,6 +910,7 @@ + 0 0 @@ -900,6 +940,7 @@ 0 0 4 + 0 0 1 @@ -940,6 +981,8 @@ 5000 0 0 + + {$account.6.user_id} @@ -957,6 +1000,8 @@ 3600 0 {if isset($account.6.password)}1{else}0{/if} + 0 + 0 {$account.6.outbound_proxy_primary} {$account.6.sip_port} {$account.6.auth_id} @@ -970,6 +1015,7 @@ 0 3 + 0 0 0 @@ -1033,6 +1079,7 @@ + 0 0 @@ -1062,6 +1109,7 @@ 0 0 4 + 0 0 1 @@ -1102,6 +1150,8 @@ 5000 0 0 + + {$account.7.user_id} @@ -1119,6 +1169,8 @@ 3600 0 {if isset($account.7.password)}1{else}0{/if} + 0 + 0 {$account.7.outbound_proxy_primary} {$account.7.sip_port} {$account.7.auth_id} @@ -1132,6 +1184,7 @@ 0 3 + 0 0 0 @@ -1195,6 +1248,7 @@ + 0 0 @@ -1224,6 +1278,7 @@ 0 0 4 + 0 0 1 @@ -1264,6 +1319,8 @@ 5000 0 0 + + {$account.8.user_id} @@ -1281,6 +1338,8 @@ 3600 0 {if isset($account.8.password)}1{else}0{/if} + 0 + 0 {$account.8.outbound_proxy_primary} {$account.8.sip_port} {$account.8.auth_id} @@ -1294,6 +1353,7 @@ 0 3 + 0 0 0 @@ -1357,6 +1417,7 @@ + 0 0 @@ -1386,6 +1447,7 @@ 0 0 4 + 0 0 1 @@ -1426,6 +1488,8 @@ 5000 0 0 + + {$account.9.user_id} @@ -1443,6 +1507,8 @@ 3600 0 {if isset($account.9.password)}1{else}0{/if} + 0 + 0 {$account.9.outbound_proxy_primary} {$account.9.sip_port} {$account.9.auth_id} @@ -1456,6 +1522,7 @@ 0 3 + 0 0 0 @@ -1519,6 +1586,7 @@ + 0 0 @@ -1548,6 +1616,7 @@ 0 0 4 + 0 0 1 @@ -1588,6 +1657,8 @@ 5000 0 0 + + {$account.10.user_id} @@ -1605,6 +1676,8 @@ 3600 0 {if isset($account.10.password)}1{else}0{/if} + 0 + 0 {$account.10.outbound_proxy_primary} {$account.10.sip_port} {$account.10.auth_id} @@ -1618,6 +1691,7 @@ 0 3 + 0 0 0 @@ -1681,6 +1755,7 @@ + 0 0 @@ -1710,6 +1785,7 @@ 0 0 4 + 0 0 1 @@ -1750,6 +1826,8 @@ 5000 0 0 + + {$account.11.user_id} @@ -1767,6 +1845,8 @@ 3600 0 {if isset($account.11.password)}1{else}0{/if} + 0 + 0 {$account.11.outbound_proxy_primary} {$account.11.sip_port} {$account.11.auth_id} @@ -1780,6 +1860,7 @@ 0 3 + 0 0 0 @@ -1843,6 +1924,7 @@ + 0 0 @@ -1872,6 +1954,7 @@ 0 0 4 + 0 0 1 @@ -1912,6 +1995,8 @@ 5000 0 0 + + {$account.12.user_id} @@ -1929,6 +2014,8 @@ 3600 0 {if isset($account.12.password)}1{else}0{/if} + 0 + 0 {$account.12.outbound_proxy_primary} {$account.12.sip_port} {$account.12.auth_id} @@ -1942,6 +2029,7 @@ 0 3 + 0 0 0 @@ -2005,6 +2093,7 @@ + 0 0 @@ -2034,6 +2123,7 @@ 0 0 4 + 0 0 1 @@ -2074,6 +2164,8 @@ 5000 0 0 + + {$account.13.user_id} @@ -2090,6 +2182,8 @@ 3600 0 {if isset($account.13.password)}1{else}0{/if} + 0 + 0 {$account.13.outbound_proxy_primary} {$account.13.sip_port} {$account.13.auth_id} @@ -2103,6 +2197,7 @@ 0 3 + 0 0 0 @@ -2166,6 +2261,7 @@ + 0 0 @@ -2195,6 +2291,7 @@ 0 0 4 + 0 0 1 @@ -2235,6 +2332,8 @@ 5000 0 0 + + {$account.14.user_id} @@ -2252,6 +2351,8 @@ 3600 0 {if isset($account.14.password)}1{else}0{/if} + 0 + 0 {$account.14.outbound_proxy_primary} {$account.14.sip_port} {$account.14.auth_id} @@ -2265,6 +2366,7 @@ 0 3 + 0 0 0 @@ -2328,6 +2430,7 @@ + 0 0 @@ -2357,6 +2460,7 @@ 0 0 4 + 0 0 1 @@ -2397,6 +2501,8 @@ 5000 0 0 + + {$account.15.user_id} @@ -2414,6 +2520,8 @@ 3600 0 {if isset($account.15.password)}1{else}0{/if} + 0 + 0 {$account.15.outbound_proxy_primary} {$account.15.sip_port} {$account.15.auth_id} @@ -2427,6 +2535,7 @@ 0 3 + 0 0 0 @@ -2490,6 +2599,7 @@ + 0 0 @@ -2519,6 +2629,7 @@ 0 0 4 + 0 0 1 @@ -2559,6 +2670,8 @@ 5000 0 0 + + {$account.16.user_id} @@ -2576,6 +2689,8 @@ 3600 0 {if isset($account.16.password)}1{else}0{/if} + 0 + 0 {$account.16.outbound_proxy_primary} {$account.16.sip_port} {$account.16.auth_id} @@ -2589,6 +2704,7 @@ 0 3 + 0 0 0 @@ -2652,6 +2768,7 @@ + 0 0 @@ -2681,6 +2798,7 @@ 0 0 4 + 0 0 1 @@ -2721,6 +2839,8 @@ 5000 0 0 + + {$account.17.user_id} @@ -2738,6 +2858,8 @@ 3600 0 {if isset($account.17.password)}1{else}0{/if} + 0 + 0 {$account.17.outbound_proxy_primary} {$account.17.sip_port} {$account.17.auth_id} @@ -2751,6 +2873,7 @@ 0 3 + 0 0 0 @@ -2814,6 +2937,7 @@ + 0 0 @@ -2843,6 +2967,7 @@ 0 0 4 + 0 0 1 @@ -2883,6 +3008,8 @@ 5000 0 0 + + {$account.18.user_id} @@ -2900,6 +3027,8 @@ 3600 0 {if isset($account.18.password)}1{else}0{/if} + 0 + 0 {$account.18.outbound_proxy_primary} {$account.18.sip_port} {$account.18.auth_id} @@ -2913,6 +3042,7 @@ 0 3 + 0 0 0 @@ -2976,6 +3106,7 @@ + 0 0 @@ -3005,6 +3136,7 @@ 0 0 4 + 0 0 1 @@ -3045,6 +3177,8 @@ 5000 0 0 + + {$account.19.user_id} @@ -3062,6 +3196,8 @@ 3600 0 {if isset($account.19.password)}1{else}0{/if} + 0 + 0 {$account.19.outbound_proxy_primary} {$account.19.sip_port} {$account.19.auth_id} @@ -3075,6 +3211,7 @@ 0 3 + 0 0 0 @@ -3138,6 +3275,7 @@ + 0 0 @@ -3167,6 +3305,7 @@ 0 0 4 + 0 0 1 @@ -3207,6 +3346,8 @@ 5000 0 0 + + {$account.20.user_id} @@ -3224,6 +3365,8 @@ 3600 0 {if isset($account.20.password)}1{else}0{/if} + 0 + 0 {$account.20.outbound_proxy_primary} {$account.20.sip_port} {$account.20.auth_id} @@ -3237,6 +3380,7 @@ 0 3 + 0 0 0 @@ -3300,6 +3444,7 @@ + 0 0 @@ -3329,6 +3474,7 @@ 0 0 4 + 0 0 1 @@ -3369,6 +3515,8 @@ 5000 0 0 + + 0 @@ -3546,6 +3694,11 @@ 0 0 + 0 + 0 + + + 0 {$fanvil_greeting} 5 @@ -3566,6 +3719,7 @@ 0 0 3 + 1 0 @@ -3750,6 +3904,7 @@ (|(telephoneNumber=%)(mobile=%)(other=%)) (|(cn=%)(sn=%)) 50 + 0 @@ -3774,6 +3929,7 @@ (|(telephoneNumber=%)(mobile=%)(other=%)) (|(cn=%)(sn=%)) 50 + 0 @@ -3798,6 +3954,7 @@ (|(telephoneNumber=%)(mobile=%)(other=%)) (|(cn=%)(sn=%)) 50 + 0 @@ -3822,6 +3979,7 @@ (|(telephoneNumber=%)(mobile=%)(other=%)) (|(cn=%)(sn=%)) 50 + 0 @@ -3854,6 +4012,7 @@ -1 -1 + 0 @@ -3862,6 +4021,7 @@ -1 -1 + 0 @@ -3870,6 +4030,7 @@ -1 -1 + 0 @@ -3878,6 +4039,7 @@ -1 -1 + 0 @@ -3886,6 +4048,7 @@ -1 -1 + 0 @@ -3942,6 +4105,8 @@ + + @@ -3954,6 +4119,8 @@ 0 0 1 + 0 + 0 @@ -4030,6 +4197,7 @@ 360 1080 1 + 1 0 0 0 @@ -4045,75 +4213,87 @@ - {strip}{*-- 12 dssSide keys --*}{/strip} - - {foreach $keys["line"] as $row} - {if $row.device_key_id <= 12} - - {if $row.device_key_type == 3}0{elseif $row.device_key_type == 1}2{else}1{/if} - {if $row.device_key_type == 3}{elseif $row.device_key_type == 1}SIP{$row.device_key_line}{else}{$row.device_key_value}@{$row.device_key_line}/{$row.device_key_type}{/if} - {$row.device_key_label} - {$row.device_key_icon} - - {/if} - {/foreach} + {strip}{*-- 5 pages of 12 dssSide keys --*}{/strip} + + {* 1. Consolidate and sort keys by index *} + {$sorted_keys = []} + {foreach $keys["line"] as $row} {$sorted_keys[$row.device_key_id] = $row} {/foreach} + {foreach $keys["memory"] as $row} {$sorted_keys[$row.device_key_id] = $row} {/foreach} + {$tmp = ksort($sorted_keys)} + + {* 2. Loop through Expansion Pages *} + {foreach range(1, 5) as $page} + + {math assign="offset" equation="($page - 1) * 12"} + + {* 3. Loop 12 times per page to ensure every slot is filled *} + {for $slot=1 to 12} + {$absolute_id = $slot + $offset} + + {if isset($sorted_keys[$absolute_id])} + {$row = $sorted_keys[$absolute_id]} + + {* DEBUG: print out the row *} + {* {$row|@print_r} *} + + {$k_category = $row.device_key_category} + {$k_type = $row.device_key_type} + + + {if $k_category == 'line'}2{elseif $k_category == 'memory'}1{else}0{/if} + {if $k_category == 'line'}SIP{$row.device_key_line+1}{else}{$row.device_key_value}@{$row.device_key_line}/{$k_type}{/if} + {$row.device_key_label} + {$row.device_key_icon} + + {else} + {* DEFAULT KEY: Fill the gap for empty slots *} + +{if $absolute_id == 7} + 3 + F_MWI +{elseif $absolute_id == 8} + 3 + F_HEADSET +{elseif $absolute_id <= 12} + 2 + SIP{$absolute_id} +{else} + 0 + +{/if} + + Green + + {/if} + {/for} - - {foreach $keys["line"] as $row} - {if $row.device_key_id > 12 && $row.device_key_id <= 24} - - {if $row.device_key_type == 3}0{elseif $row.device_key_type == 1}2{else}1{/if} - {if $row.device_key_type == 3}{elseif $row.device_key_type == 1}SIP{$row.device_key_line}{else}{$row.device_key_value}@{$row.device_key_line}/{$row.device_key_type}{/if} - {$row.device_key_label} - {$row.device_key_icon} - - {/if} - {/foreach} - - - {foreach $keys["line"] as $row} - {if $row.device_key_id > 24 && $row.device_key_id <= 36} - - {if $row.device_key_type == 3}0{elseif $row.device_key_type == 1}2{else}1{/if} - {if $row.device_key_type == 3}{elseif $row.device_key_type == 1}SIP{$row.device_key_line}{else}{$row.device_key_value}@{$row.device_key_line}/{$row.device_key_type}{/if} - {$row.device_key_label} - {$row.device_key_icon} - - {/if} - {/foreach} - - - {foreach $keys["line"] as $row} - {if $row.device_key_id > 36 && $row.device_key_id <= 48} - - {if $row.device_key_type == 3}0{elseif $row.device_key_type == 1}2{else}1{/if} - {if $row.device_key_type == 3}{elseif $row.device_key_type == 1}SIP{$row.device_key_line}{else}{$row.device_key_value}@{$row.device_key_line}/{$row.device_key_type}{/if} - {$row.device_key_label} - {$row.device_key_icon} - - {/if} - {/foreach} - - - {foreach $keys["line"] as $row} - {if $row.device_key_id > 48 && $row.device_key_id <= 60} - - {if $row.device_key_type == 3}0{elseif $row.device_key_type == 1}2{else}1{/if} - {if $row.device_key_type == 3}{elseif $row.device_key_type == 1}SIP{$row.device_key_line}{else}{$row.device_key_value}@{$row.device_key_line}/{$row.device_key_type}{/if} - {$row.device_key_label} - {$row.device_key_icon} - - {/if} - {/foreach} - - {strip}{*-- 10 dssSoft keys --*}{/strip} - {foreach $keys["programmable"] as $row} - - {if $row.device_key_type == 3}0{elseif $row.device_key_type == 1}2{else}1{/if} - {if $row.device_key_type == 3}{elseif $row.device_key_type == 1}SIP{$row.device_key_line}{else}{$row.device_key_value}@{$row.device_key_line}/{$row.device_key_type}{/if} - {$row.device_key_label} - {/foreach} + + {strip}{*-- 10 dssSoft keys --*}{/strip} + {foreach $keys["programmable"] as $row} {$soft_keys[$row.device_key_id] = $row} {/foreach} + {$soft_keys = array_values($soft_keys|default:[])} + + {* 4. Loop 10 times to ensure every slot is filled *} + {for $slot=0 to 9} + {if isset($soft_keys[$slot])} + {$row = $soft_keys[$slot]} + + + {if $row.device_key_category == 'line'}2{elseif $row.device_key_category == 'memory'}1{else}0{/if} + {if $row.device_key_category == 'line'}SIP{$row.device_key_line+1}{else}{$row.device_key_value}@{$row.device_key_line}/{$row.device_key_type}{/if} + {$row.device_key_label} + {$row.device_key_icon} + + {else} + + 0 + + + Green + + + {/if} + {/for} 0 @@ -4140,13 +4320,7 @@ INFO - {if $fanvil_syslog_enable == '1'}syslog - {elseif $fanvil_output_device == ''} - {elseif $fanvil_output_device == 'syslog'}syslog - {elseif $fanvil_output_device == 'stdout'}stdout - {elseif $fanvil_output_device == 'syslog,stdout'}syslog,stdout - {elseif $fanvil_output_device == 'stdout,syslog'}syslog,stdout - {/if} + {if $fanvil_syslog_enable == '1'},syslog{else}stdout{/if} platform.log 512KB platform @@ -4177,6 +4351,7 @@ 0 1 + 1 0 224.0.2.0 16360 @@ -4310,6 +4485,7 @@ 0 0 0 + 1 @@ -4338,6 +4514,7 @@ 1 60 132 + 0 @@ -4350,6 +4527,9 @@ 0 + + 0 + 1 0 @@ -4392,5 +4572,10 @@ 0 1,1,1,1 0 + 1 + 1 + 57600 + 0 + 0