diff --git a/resources/templates/provision/fanvil/w611w/directory.xml b/resources/templates/provision/fanvil/w611w/directory.xml
new file mode 100644
index 0000000000..f4fe5b3d60
--- /dev/null
+++ b/resources/templates/provision/fanvil/w611w/directory.xml
@@ -0,0 +1,210 @@
+
+
+{if $smarty.get.contacts == "users"}
+Users Directory
+{elseif $smarty.get.contacts == "groups"}
+Groups Directory
+{elseif $smarty.get.contacts == "extensions"}
+Extensions Directory
+{else}
+Complete Directory
+{/if}
+
+{foreach $contacts as $row}
+{if $smarty.get.contacts == "users" && $row.category == "users"}
+
+ {if $row.contact_organization && $row.contact_name_given && $row.contact_name_family}
+ {$row.contact_organization}, {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_organization && $row.contact_name_given == "" && $row.contact_name_family == ""}
+ {$row.contact_organization}
+ {elseif $row.contact_name_given && $row.contact_name_family && $row.contact_organization == ""}
+ {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_name_given && $row.contact_name_family}
+ {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_name_given}
+ {$row.contact_name_given}
+ {elseif $row.contact_name_family}
+ {$row.contact_name_family}
+ {else}
+ {$row.effective_caller_id_name}
+ {/if}
+
+ {foreach $row.numbers as $number}
+ {if $number.phone_label == "work" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($telephone_set) && $number.phone_number != ""}
+ {$number.phone_number}
+ {$telephone_set = true}
+ {/if}
+
+ {if $number.phone_label == "mobile" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($mobile_set) && $number.phone_number != "" && !isset($telephone_set)}
+ {$number.phone_number}
+ {$mobile_set = true}
+ {/if}
+
+ {if $number.phone_label == "home" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($other_set) && $number.phone_number != "" && !isset($telephone_set) && !isset($mobile_set)}
+ {$number.phone_number}
+ {$other_set = true}
+ {/if}
+ {/foreach}
+
+ 0
+ Users
+
+
+ {* Reset variables for next contact *}
+ {$telephone_set = null}
+ {$mobile_set = null}
+ {$other_set = null}
+
+
+{elseif $smarty.get.contacts == "groups" && $row.category == "groups"}
+
+ {if $row.contact_organization && $row.contact_name_given && $row.contact_name_family}
+ {$row.contact_organization}, {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_organization && $row.contact_name_given == "" && $row.contact_name_family == ""}
+ {$row.contact_organization}
+ {elseif $row.contact_name_given && $row.contact_name_family && $row.contact_organization == ""}
+ {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_name_given && $row.contact_name_family}
+ {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_name_given}
+ {$row.contact_name_given}
+ {elseif $row.contact_name_family}
+ {$row.contact_name_family}
+ {else}
+ {$row.effective_caller_id_name}
+ {/if}
+
+ {foreach $row.numbers as $number}
+ {if $number.phone_label == "work" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($telephone_set) && $number.phone_number != ""}
+ {$number.phone_number}
+ {$telephone_set = true}
+ {/if}
+
+ {if $number.phone_label == "mobile" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($mobile_set) && $number.phone_number != "" && !isset($telephone_set)}
+ {$number.phone_number}
+ {$mobile_set = true}
+ {/if}
+
+ {if $number.phone_label == "home" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($other_set) && $number.phone_number != "" && !isset($telephone_set) && !isset($mobile_set)}
+ {$number.phone_number}
+ {$other_set = true}
+ {/if}
+ {/foreach}
+
+ 0
+ Groups
+
+
+ {* Reset variables for next contact *}
+ {$telephone_set = null}
+ {$mobile_set = null}
+ {$other_set = null}
+
+
+{elseif $smarty.get.contacts == "extensions" && $row.category == "extensions"}
+
+ {if $row.contact_name_given}
+ {$row.contact_name_given} {$row.contact_name_family}
+ {else}
+ {$row.effective_caller_id_name}
+ {/if}
+
+ {if $row.phone_number}
+ {$row.phone_number}
+ {else}
+ {$row.phone_extension}
+ {/if}
+
+
+ 0
+ Extensions
+
+
+
+{elseif $smarty.get.contacts == "all" || !$smarty.get.contacts}
+
+ {if $row.contact_organization && $row.contact_name_given && $row.contact_name_family}
+ {$row.contact_organization}, {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_organization && $row.contact_name_given == "" && $row.contact_name_family == ""}
+ {$row.contact_organization}
+ {elseif $row.contact_name_given && $row.contact_name_family && $row.contact_organization == ""}
+ {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_name_given && $row.contact_name_family}
+ {$row.contact_name_given} {$row.contact_name_family}
+ {elseif $row.contact_name_given}
+ {$row.contact_name_given}
+ {elseif $row.contact_name_family}
+ {$row.contact_name_family}
+ {else}
+ {$row.effective_caller_id_name}
+ {/if}
+
+ {if $row.category == "extensions"}
+ {if $row.phone_number}
+ {$row.phone_number}
+ {else}
+ {$row.phone_extension}
+ {/if}
+
+
+ {elseif isset($row.numbers)}
+ {foreach $row.numbers as $number}
+ {if $number.phone_label == "work" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($telephone_set) && $number.phone_number != ""}
+ {$number.phone_number}
+ {$telephone_set = true}
+ {/if}
+
+ {if $number.phone_label == "mobile" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($mobile_set) && $number.phone_number != "" && !isset($telephone_set)}
+ {$number.phone_number}
+ {$mobile_set = true}
+ {/if}
+
+ {if $number.phone_label == "home" && $number.phone_number != ""}
+ {$number.phone_number}
+ {elseif !isset($other_set) && $number.phone_number != "" && !isset($telephone_set) && !isset($mobile_set)}
+ {$number.phone_number}
+ {$other_set = true}
+ {/if}
+ {/foreach}
+ {else}
+ {$row.phone_extension}
+
+
+ {/if}
+
+ 0
+ {if $row.category == "users"}
+ Users
+ {elseif $row.category == "groups"}
+ Groups
+ {elseif $row.category == "extensions"}
+ Extensions
+ {else}
+
+ {/if}
+
+
+ {* Reset variables for next contact *}
+ {$telephone_set = null}
+ {$mobile_set = null}
+ {$other_set = null}
+
+{/if}
+{/foreach}
+
diff --git a/resources/templates/provision/fanvil/w611w/{$mac}.xml b/resources/templates/provision/fanvil/w611w/{$mac}.xml
new file mode 100644
index 0000000000..0817b936d6
--- /dev/null
+++ b/resources/templates/provision/fanvil/w611w/{$mac}.xml
@@ -0,0 +1,1424 @@
+
+
+
+ 2.0000000000
+
+ 0
+ {if isset($fanvil_enable_dhcp)}{$fanvil_enable_dhcp}{else}1{/if}
+ 1
+ 0
+ 0
+ 0
+ Fanvil W611W
+ 0
+ user123
+
+ 2
+ 1500
+ W611W
+
+
+
+
+
+
+ 0
+ 1
+ 0
+ 0
+
+
+
+ {if isset($fanvil_wifi_enable)}{$fanvil_wifi_enable}{else}1{/if}
+ 1
+ {if isset($fanvil_country_code)}{$fanvil_country_code}{else}CN{/if}
+ 0
+ {if isset($fanvil_enable_dhcp)}{$fanvil_enable_dhcp}{else}1{/if}
+ 1
+ 1
+ 0
+ Fanvil W611W
+ W611W
+ 0
+ user123
+
+
+
+
+
+
+
+ 0
+ 1
+ 0
+
+
+
+
+ 1
+
+
+ 0
+
+ 0
+
+
+
+
+ 1
+ 97
+ 20
+ 108
+ 109
+ 103
+ 104
+ 102
+ 105
+ 101
+ 107
+ 0
+ 0
+ 117
+ 0
+ 0
+ 0
+ 98
+ 121
+ 110
+ 96
+ 10000
+ 1000
+ 1
+ 0
+
+
+ 11
+ 1
+ 0
+ DEFAULT
+ 0
+ 0
+ 0
+ 0
+ 350+440/0
+ 440+480/2000,0/4000
+ 480+620/500,0/500
+
+ 440/300,0/10000,440/300,0/10000,0/0
+
+
+
+
+ 350+440/100,0/100,350+440/100,0/100,350+440/100,0/100,350+440/0
+
+
+ 400/500,0/6000
+ 1400/500,0/0
+ 440/500,0/5000
+
+ 1
+ 2
+
+ {if isset($fanvil_video_codec)}{$fanvil_video_codec}{else}G722,PCMU,PCMA,G729,opus,iLBC{/if}
+
+
+
+ {if isset($sip_port)}{$sip_port}{else}{if isset($sip_transport) && $sip_transport == 'tls'}5061{else}5060{/if}{/if}
+ {if isset($fanvil_stun_server)}{$fanvil_stun_server}{/if}
+ {if isset($fanvil_stun_port)}{$fanvil_stun_port}{else}3478{/if}
+ 50
+ 800
+
+ 50
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 1
+ 1
+ 3
+
+ {foreach $lines as $row}
+
+ {$row.user_id}
+ {$row.display_name}
+ {$row.user_id}
+ {$row.server_address}
+ {if isset($row.sip_port)}{$row.sip_port}{else}{if isset($row.sip_transport) && $row.sip_transport == 'tls'}5061{else}5060{/if}{/if}
+ {$row.user_id}
+ {$row.password}
+ {if isset($row.register_expires)}{$row.register_expires}{else}3600{/if}
+ {if isset($row.register)}{if $row.register == 'true'}1{else}0{/if}{else}0{/if}
+ {if isset($row.server_address_secondary)}{$row.server_address_secondary}{/if}
+ {if isset($row.sip_port_secondary)}{$row.sip_port_secondary}{else}{if isset($row.sip_transport_secondary) && $row.sip_transport_secondary == 'tls'}5061{else}5060{/if}{/if}
+ {if isset($row.sip_transport_secondary) && $row.sip_transport_secondary == 'tcp'}1{elseif isset($row.sip_transport_secondary) && $row.sip_transport_secondary == 'tls'}3{else}0{/if}
+ {if isset($row.register_expires_secondary)}{$row.register_expires_secondary}{else}3600{/if}
+ 0
+ {if isset($row.enabled)}{if $row.enabled == 'true'}1{else}0{/if}{else}0{/if}
+ 0
+ {if isset($row.outbound_proxy_primary)}{$row.outbound_proxy_primary}{/if}
+ {if isset($row.sip_port)}{$row.sip_port}{else}{if isset($row.sip_transport) && $row.sip_transport == 'tls'}5061{else}5060{/if}{/if}
+ {$row.user_id}
+ {$row.password}
+ 0
+ {if isset($row.outbound_proxy_secondary)}{$row.outbound_proxy_secondary}{/if}
+ {if isset($row.sip_port_secondary)}{$row.sip_port_secondary}{else}{if isset($row.sip_transport_secondary) && $row.sip_transport_secondary == 'tls'}5061{else}5060{/if}{/if}
+ 0
+ 1
+ 1800
+ 0
+ 3
+
+ 0
+ 1
+
+ 0
+ 0
+ {if isset($fanvil_realm)}{$fanvil_realm}{/if}
+ 0
+ 0
+ 0
+
+
+
+ 5
+
+ 0
+ 0
+ {if isset($fanvil_pickup_num)}{$fanvil_pickup_num}{/if}
+
+
+ {literal}
+ {assign var="line_id" value=$row.line_number}
+ {if isset(${"fanvil_ringtone_line$line_id"})}{${"fanvil_ringtone_line$line_id"}}{else}default{/if}
+ {/literal}
+ 2
+ 30
+ 3
+ 0
+
+ 0
+ 0
+ 0
+ 1800
+ 0
+ 3
+ 0
+ 0
+ 1
+ 1
+ 3600
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 5060
+ {if isset($row.sip_transport) && $row.sip_transport == 'tcp'}1{elseif isset($row.sip_transport) && $row.sip_transport == 'tls'}3{else}0{/if}
+ 0
+
+ 0
+ 0
+ 1
+ 0
+
+ {$voicemail_number}
+
+
+
+ 0
+
+
+ 0
+ 0
+ 5
+ 1
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ G722,PCMU,PCMA,G729,opus,iLBC
+
+
+ {$row.server_address}
+ 0
+ 0
+ 2
+ 0
+ 0
+
+ 1
+ 0
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 35
+ 0
+ 0
+ 1
+ 2
+
+ 1
+
+
+ 5060
+
+ 0
+
+
+ 1
+ 1
+ 1
+ Record:on
+ Record:off
+ 1
+ 0
+ 1
+ 0
+ 500
+ 4000
+ 5000
+ 0
+ 0
+ $id@$ip
+ 0
+
+ 0
+ 60
+ 1
+
+ {/foreach}
+
+ 0
+ 30
+ 1
+ 0
+ 0
+ 0
+ 1
+ $id@$ip
+ 0
+ 1800
+
+
+ 0
+ 1
+
+
+
+
+ 1
+ 1
+ 0
+ .
+ 1
+ 0
+ 0
+ 1500
+ 1730
+ 0
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 3
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 30
+ 5
+ 0
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 0
+
+ 1
+ 1
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 480
+ 486
+ 603
+ 0
+ 0
+
+
+ 0
+
+
+
+
+ 0
+
+ 0
+ 120
+ 120
+ 1
+ 1
+ 1
+ 1
+ 60
+ 0
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 11
+ 1
+ 10
+ 0
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ -1
+ 1.wav
+
+
+
+ {if isset($fanvil_menu_password)}{$fanvil_menu_password}{/if}
+
+
+ 0
+ 30
+ 0
+ {if isset($fanvil_emergency_number)}{$fanvil_emergency_number}{else}911{/if}
+
+ 0
+ 0
+ 0
+ 5
+ 0
+ 1
+ 1
+ $name@$protocol$instance
+ 0
+ 1
+ 1
+ 30
+
+ 0
+ 0
+ 0
+
+ 0
+ 0
+
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+
+ {if isset($fanvil_greeting)}{$fanvil_greeting}{else}VoIP Phone{/if}
+ 5
+ {if isset($fanvil_hotel_lcd)}{$fanvil_hotel_lcd}{else}4{/if}
+ {if isset($fanvil_display_brightness_active)}{$fanvil_display_brightness_active}{else}12{/if}
+ {if isset($fanvil_display_inactivity_time)}{$fanvil_display_inactivity_time}{else}60{/if}
+ 0
+
+ (none)
+ en
+ 0
+
+
+ 0
+ 3
+ 0
+ 2
+ 0
+ 0
+ 3
+ 1
+ 3
+ 3
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+ 0
+ 1
+
+
+ 0
+ 1
+ terminated
+ 1
+ 2
+ early
+ 1
+ 0
+
+ 1
+ 1
+ confirmed
+ 1
+ 0
+
+ 2
+ 0
+ failed
+ 0
+ 3
+ parked
+
+
+ 5
+ 3
+ 3
+ 5
+ 3
+ 5
+ 3
+ 5
+ 3
+ 5
+ 3
+ {if isset($fanvil_default_ringtone)}{$fanvil_default_ringtone}{else}default.wav{/if}
+
+
+ {if isset($fanvil_enable_sntp)}{$fanvil_enable_sntp}{else}1{/if}
+ {if isset($ntp_server_primary)}{$ntp_server_primary}{else}0.pool.ntp.org{/if}
+ {if isset($ntp_server_secondary)}{$ntp_server_secondary}{else}time.nist.gov{/if}
+ {if isset($fanvil_location)}{$fanvil_location}{else}32{/if}
+ {if isset($fanvil_time_zone_name)}{$fanvil_time_zone_name}{else}UTC+8{/if}
+ 9600
+ {if isset($fanvil_enable_dst)}{$fanvil_enable_dst}{else}0{/if}
+ 0
+ {if isset($fanvil_dst_fixed_type)}{$fanvil_dst_fixed_type}{else}0{/if}
+ {if isset($fanvil_dst_minute_offset)}{$fanvil_dst_minute_offset}{else}60{/if}
+ 3
+ 5
+ 0
+ 2
+ 10
+ 5
+ 0
+ 2
+
+
+ 0
+ {if isset($fanvil_time_display)}{$fanvil_time_display}{else}0{/if}
+ {if isset($fanvil_date_display)}{$fanvil_date_display}{else}0{/if}
+ {if isset($fanvil_date_separator)}{$fanvil_date_separator}{else}0{/if}
+
+
+ 1
+ {if isset($fanvil_softkey_exit)}{$fanvil_softkey_exit}{else}2{/if}
+ {if isset($fanvil_softkey_desktopsoftkey)}{$fanvil_softkey_desktopsoftkey}{else}DssPage1;menu;{/if}
+ {if isset($fanvil_softkey_talkingsoftkey)}{$fanvil_softkey_talkingsoftkey}{else}DssPage1;end;new;hold;xfer;conf;mute;{/if}
+ {if isset($fanvil_softkey_ringingsoftkey)}{$fanvil_softkey_ringingsoftkey}{else}forward;accept;reject;mute;{/if}
+ end;none;
+ end;xfer;
+ end;hold;split;mute;
+ accept;xfer;reject;end;
+ end;redial;
+ delete;send;
+ exit;send;
+ exit;none;send;xfer;
+ exit;send;
+ {if isset($fanvil_softkey_desktopclick)}{$fanvil_softkey_desktopclick}{else}history;status;DssPage1;DssPage2;menu;{/if}
+ pline;nline;pline;nline;none;
+ none;none;none;none;none;
+ end;end;end;end;end;
+ none;none;voldown;volup;none;
+ status;none;none;none;none;
+ contact;clogs;redial;video;cancel;
+
+
+
+
+
+ 0
+ 0
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+ 0
+
+
+
+
+ 389
+
+ 0
+ 3
+ -1
+ -1
+ 0
+ 0
+ 3
+
+
+ telephoneNumber
+ mobile
+ other
+ cn sn ou
+ cn
+ thumbnailPhoto
+ cn
+ (|(telephoneNumber=%)(mobile=%)(other=%))
+ (|(cn=%)(sn=%))
+ 50
+ 0
+ 0
+
+ 0
+
+
+
+
+ 389
+
+ 0
+ 3
+ -1
+ -1
+ 0
+ 0
+ 3
+
+
+ telephoneNumber
+ mobile
+ other
+ cn sn ou
+ cn
+ thumbnailPhoto
+ cn
+ (|(telephoneNumber=%)(mobile=%)(other=%))
+ (|(cn=%)(sn=%))
+ 50
+ 0
+ 0
+
+ 0
+
+
+
+
+ 389
+
+ 0
+ 3
+ -1
+ -1
+ 0
+ 0
+ 3
+
+
+ telephoneNumber
+ mobile
+ other
+ cn sn ou
+ cn
+ thumbnailPhoto
+ cn
+ (|(telephoneNumber=%)(mobile=%)(other=%))
+ (|(cn=%)(sn=%))
+ 50
+ 0
+ 0
+
+ 0
+
+
+
+
+ 389
+
+ 0
+ 3
+ -1
+ -1
+ 0
+ 0
+ 3
+
+
+ telephoneNumber
+ mobile
+ other
+ cn sn ou
+ cn
+ thumbnailPhoto
+ cn
+ (|(telephoneNumber=%)(mobile=%)(other=%))
+ (|(cn=%)(sn=%))
+ 50
+ 0
+ 0
+
+ 0
+
+
+
+
+ 389
+
+ 0
+ 3
+ -1
+ -1
+ 0
+ 0
+ 3
+
+
+ telephoneNumber
+ mobile
+ other
+ cn sn ou
+ cn
+ thumbnailPhoto
+ cn
+ (|(telephoneNumber=%)(mobile=%)(other=%))
+ (|(cn=%)(sn=%))
+ 50
+ 0
+ 0
+
+ 0
+
+
+ {if isset($fanvil_remote_phonebook_2_name)}{$fanvil_remote_phonebook_2_name}{else}Users{/if}
+ https://{$domain_name}/app/provision/?address={$mac}&file=directory.xml&contacts=users
+ {if isset($http_auth_username)}{$http_auth_username}{/if}
+ {if isset($http_auth_password)}{$http_auth_password}{/if}
+ -1
+ -1
+ 0
+
+
+ {if isset($fanvil_remote_phonebook_2_name)}{$fanvil_remote_phonebook_2_name}{else}Groups{/if}
+ https://{$domain_name}/app/provision/?address={$mac}&file=directory.xml&contacts=groups
+ {if isset($http_auth_username)}{$http_auth_username}{/if}
+ {if isset($http_auth_password)}{$http_auth_password}{/if}
+ -1
+ -1
+ 0
+
+
+ {if isset($fanvil_remote_phonebook_3_name)}{$fanvil_remote_phonebook_3_name}{else}Extensions{/if}
+ https://{$domain_name}/app/provision/?address={$mac}&file=directory.xml&contacts=extensions
+ {if isset($http_auth_username)}{$http_auth_username}{/if}
+ {if isset($http_auth_password)}{$http_auth_password}{/if}
+ -1
+ -1
+ 0
+
+
+
+ 120
+ 0
+ 2
+ 6
+ 2
+ 0
+ 200
+
+
+ 1
+ 1
+ 60
+ 40
+ 25
+ 150
+ 200
+ 1
+ 1
+
+
+ 1
+ 1
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+ https://fdmcs.fanvil.com.cn/api/f/mc/event/dnd?state=1
+ https://fdmcs.fanvil.com.cn/api/f/mc/event/dnd?state=0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ https://fdmcs.fanvil.com.cn/api/f/mc/event/abilityEvent
+
+ 0
+
+
+
+
+ 0000000000000000
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+ 60
+
+
+ {* Standard FusionPBX types and additional Fanvil types *}
+ {assign var=key_types value=[
+ "1"=>"1",
+ "ba"=>"1",
+ "bb"=>"1",
+ "bf"=>"1",
+ "bc"=>"1",
+ "bcV"=>"1",
+ "a"=>"1",
+ "c"=>"1",
+ "i"=>"1",
+ "f"=>"2",
+ "2"=>"2",
+ "m"=>"2",
+ "3"=>"0",
+ "14"=>"29",
+ "blf_list"=>"28",
+ "dtmf"=>"5",
+ "presence"=>"2",
+ "event"=>"3",
+ "record"=>"3",
+ "dnd"=>"3",
+ "hold"=>"3",
+ "transfer"=>"3",
+ "phonebook"=>"3",
+ "pickup"=>"3",
+ "join"=>"3",
+ "headset"=>"3",
+ "redial"=>"3",
+ "prefix"=>"3",
+ "ldap"=>"11",
+ "action_url"=>"25",
+ "xml_browser"=>"22",
+ "multicast_listen"=>"25"
+ ]}
+
+ {assign var=blf_suffixes value=[
+ "ba"=>"/ba",
+ "bb"=>"/bb",
+ "bf"=>"/bf",
+ "bc"=>"/bc",
+ "bcV"=>"/bcV",
+ "a"=>"/a",
+ "c"=>"/c",
+ "i"=>"/i"
+ ]}
+
+ {assign var=event_types value=[
+ "dnd"=>"F_DND",
+ "mwi"=>"F_MWI",
+ "hold"=>"F_HOLD",
+ "transfer"=>"F_TRANSFER",
+ "phonebook"=>"F_PHONEBOOK",
+ "redial"=>"F_REDIAL",
+ "pickup"=>"F_PICKUP",
+ "join"=>"F_JOIN",
+ "call_forward"=>"F_CALLFORWARD",
+ "record"=>"F_RECORD"
+ ]}
+
+ 2
+ 3
+ 2
+ 1
+ 0
+ 90
+ 0
+ 0
+ 16
+ 360
+ 1080
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+ 24
+ *724@-1/i
+
+ Green
+
+
+ 1
+ @1/f
+
+ Green
+
+
+
+ {* Filter line keys first *}
+ {assign var="line_keys" value=[]}
+
+ {* Output original keys array for debugging *}
+ {* Original keys array: {$keys|@print_r:true} *}
+
+ {foreach $keys["line"] as $row}
+ {* Output each row being processed *}
+ {* Processing row: {$row|@print_r:true} *}
+
+ {if $row.device_key_category == "line"}
+ {* Adding line key: {$row|@print_r:true} *}
+ {append var="line_keys" value=$row index=$row.device_key_id}
+ {/if}
+ {/foreach}
+
+ {* Debug: Print final line_keys array *}
+ {* Final line_keys array: {$line_keys|@print_r:true} *}
+
+ {* Create a mapping of key positions by their exact device_key_id *}
+ {assign var="key_map" value=[]}
+ {foreach $line_keys as $row}
+ {if isset($row.device_key_id) && $row.device_key_id > 0}
+ {assign var="key_map[$row.device_key_id]" value=$row}
+ {/if}
+ {/foreach}
+
+ {* Always generate exactly 2 pages *}
+ {for $page_num=1 to 2}
+
+ {* Calculate starting key_id for this page *}
+ {assign var="start_key_id" value=(($page_num-1)*8)+1}
+
+ {* Output all 8 positions on each page *}
+ {for $position=1 to 8}
+ {assign var="key_id" value=$start_key_id+$position-1}
+
+ {if isset($line_keys[$key_id]) && isset($key_types[$line_keys[$key_id].device_key_type])}
+ {$key_types[$line_keys[$key_id].device_key_type]}
+ {$line_keys[$key_id].device_key_value}@1{if isset($blf_suffixes[$line_keys[$key_id].device_key_type])}{$blf_suffixes[$line_keys[$key_id].device_key_type]}{/if}
+ {$line_keys[$key_id].device_key_label}
+ Green
+ {else}
+ 0
+
+
+
+ {/if}
+
+ {/for}
+
+ {/for}
+ {* Memory (soft) keys *}
+ {for $i=1 to 10}
+ {assign var="found" value=false}
+ {foreach $keys["memory"] as $row}
+ {if $row.device_key_category == "memory" && $row.device_key_id == $i}
+ {assign var="found" value=true}
+
+ {if isset($key_types[$row.device_key_type])}{$key_types[$row.device_key_type]}{else}2{/if}
+ {$row.device_key_value}{if isset($blf_suffixes[$row.device_key_type])}{$blf_suffixes[$row.device_key_type]}{/if}
+ {$row.device_key_label}
+ Green
+
+ {/if}
+ {/foreach}
+ {/for}
+
+
+ 0
+ 80
+ 443
+ 2
+ 1
+ 0
+ 0
+ 0
+ 23
+
+ 15
+
+ admin
+ {if isset($admin_password)}{$admin_password}{elseif isset($fanvil_admin_password)}{$fanvil_admin_password}{/if}
+ 10
+
+
+ guest
+
+ 0
+
+
+
+ ERROR
+
+ stdout
+ platform.log
+ 512KB
+ platform
+ {if isset($fanvil_syslog_server)}{$fanvil_syslog_server}{else}0.0.0.0{/if}
+ {if isset($fanvil_syslog_server_port)}{$fanvil_syslog_server_port}{else}514{/if}
+
+
+ -1
+ 0
+ 0
+ 0
+ 60
+ 0
+
+
+ 0.0.0.0
+
+
+ 1
+ 0.0.0.0
+
+
+ 0.0.0.0
+
+
+
+
+ 0
+ 0
+
+
+ {$http_auth_username}
+ {$http_auth_password}
+
+
+
+ 1
+ 1
+ 1
+ {$fanvil_config_server_path}
+
+ 5
+ 1
+ 1
+ 720
+ 0
+
+ 1
+ 224.0.1.75
+ 5060
+ 0
+ 1
+
+
+ 66
+ 0
+ 0
+ 0
+ 1
+ 0
+
+
+
+ {$fanvil_enable_auto_upgrade}
+ {$fanvil_firmware_upgrade_server_1}
+ {$fanvil_firmware_upgrade_server_2}
+ {$fanvil_firmware_upgrade_interval}
+
+
+ 0
+ {if isset($fanvil_lan_port_vlan)}{$fanvil_lan_port_vlan}{else}256{/if}
+ 1
+ {if isset($fanvil_lan_port_vlan)}{$fanvil_lan_port_vlan}{else}254{/if}
+ {if isset($fanvil_qos_sip)}{$fanvil_qos_sip}{else}0{/if}
+ {if isset($fanvil_qos_rtp_voice)}{$fanvil_qos_rtp_voice}{else}0{/if}
+ {if isset($fanvil_qos_rtp_video)}{$fanvil_qos_rtp_video}{else}0{/if}
+ 0
+ {if isset($fanvil_enable_diffserv)}{$fanvil_enable_diffserv}{else}0{/if}
+ {if isset($fanvil_dscp_sip)}{$fanvil_dscp_sip}{else}46{/if}
+ {if isset($fanvil_dscp_rtp_voice)}{$fanvil_dscp_rtp_voice}{else}46{/if}
+ {if isset($fanvil_dscp_rtp_video)}{$fanvil_dscp_rtp_video}{else}46{/if}
+ {if isset($fanvil_lldp_tx_enable)}{$fanvil_lldp_tx_enable}{else}0{/if}
+ {if isset($fanvil_lldp_refresh)}{$fanvil_lldp_refresh}{else}60{/if}
+ {if isset($fanvil_lldp_learn)}{$fanvil_lldp_learn}{else}0{/if}
+ 0
+ 0
+ 60
+ 132
+ 0
+
+
+ 0
+ admin
+
+
+
+ admin
+
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+
+
+ 1
+ 0
+ 0
+
+
+ 1
+
+ sidekey2
+ none;accept;exit;none;exit;
+
+
+
+ 0
+ G729
+ 1
+ 8
+ 0.0.0.0
+ 10000
+ 0
+
+
+ 0
+
+
+ 0
+ Fanvil W611W
+ 1
+ en;cn;tc;ru;it;fr;de;he;es;cat;eus;gal;tr;hr;slo;cz;nl;ko;ua;pt;pl;ar;jp;
+ 0x02000002
+
+
+ 15
+ 1
+ 1
+
+
+
+ 15
+ 30
+ 0
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0xffffff
+ 0xffffff
+ 0xffffff
+ 0xFAFAFA
+ 0x808080
+ 0xc4012f
+ 0x007bb0
+ 0xffffff
+ 0x262626
+ 1
+ 1
+ 1
+ 1
+ 2
+ 0
+ 14400
+
+
+
+ 0
+ 1
+ w611-0C-38-3E-5F-41-6F
+
+ 16
+
+