1. Overview

This document briefly outlines the details of self‑provisioning for Flying Voice products, which support three methods: HTTP, HTTPS with client certificates, and TFTP with option 66. All Flying Voice products support provisioning, and this document is based on examples from the IP542N and G502N models.
With option 66, the new product will automatically resynchronize (abbreviation for resynchronize) to a special configuration file using a TFTP server. The product will request the resynchronization configuration file after obtaining an IP address from the DHCP server; the Flying Voice product that accesses the LAN will first resynchronize with the local TFTP server and configure settings as defined.
Additionally, Flying Voice products support remote deployment, the user only needs to set the configuration file rule value and resynchronization settings, the products will resynchronize automatically remotely. HTTP/HTTPS/TFTP server.

2. Configure profile settings

2.1. Configure settings

The following image is the provisioning configuration page, it describes all provisioning-related parameters.
20130228084918677.jpg
Parameter name Description Default value
Enable provisioning Enable or disable provisioning functions. Activate
Resynchronize
On
Reset
Triggers a resynchronization after each reboot, except when the reboot is caused by a parameter
update
and firmware update.
Enable


Resynchronize
Random
Delay
Maximum value of a random time interval that the device waits before
creation
its first contact with the provisioning server. This delay is effective only on
the initial
configuration attempt after the device is powered on or rebooted. The delay is a
pseudo-random number between zero and this value.
This parameter is expressed in units of 1 second; the default value of 40 represents 40
seconds. This function is disabled when this parameter is set to zero.
This function can be used to avoid overloading the provisioning server
when a
large number of devices are powered on simultaneously.
40 seconds
Resynchronize
Periodic
L’intervalle de temps entre les resynchronisations périodiques avec le serveur de provisionnement.
Définissez ce paramètre à zéro pour désactiver la resynchronisation périodique.
3600 seconds
Resynchronization error
Retry delay
If the last resynchronization failed, the IP542N will retry resynchronization after the “Resync Error Retry”
Delay time
3600 seconds
Forced
Resynchronize
Delay
Maximum delay (in seconds) that the VoIP ATA or IP phone waits before executing a
resynchronization.
The device does not resynchronize as long as one of its telephone lines is active. Because a resynchronization
can take several seconds, it is desirable to wait until the device is inactive for a
prolonged period before resynchronization. This allows a user to make successive calls
without interruption.
The device has a timer that starts counting down when all its lines become inactive.
This parameter is the initial value of the counter. Resynchronization events are delayed until
this counter decrements to zero.
14 400 seconds
Resynchronize after
Update
Trigger a resynchronization after each firmware update attempt. Enable
Option 66 Enable or disable the DHCP 66 option to replace the server. If enabled, the "Profile
" setting has no effect.
Yes
Configuration
File
Name
The configuration file name is used only in internal provisioning mode. When using TFTP
with option 66 for provisioning, the user must enter the correct configuration file name
on the IP542N web page. When option 66 is disabled, this setting has no effect.
Different
products have
different
default values,
for example : I
P542N.conf


Profil
Règle
This setting is a profile script that evaluates during provisioning resynchronization command.
The command is a TCP/IP operation and an associated URL. The TCP/IP operation
can be TFTP, HTTP or HTTPS, if the user wishes to use this method for provisioning,
the user must disable Option 66.
The file name can contain macros, such as $MA, which expands to the device’s MAC address
address.
For example: 192.168.20.17
Empty
Update
Enable
Allows firmware update operations independently of resynchronization actions Enable

Update error
Retry delay
The interval for a new firmware update retry (in seconds) applied in case of a firmware update failure. The
device has a firmware update error timer that activates after a failed firmware update attempt
. The timer is initialized with the value of this parameter. The following
Firmware update attempt occurs when this timer reaches zero.
3600 seconds.

Update Rule
This setting is a firmware update script with the same syntax as the profile rule.
Sets update conditions and associated Firmware URLs.
For example: 192.168.20.17
Empty

2.2. Profile rule and update file

The syntax of the profile rule and the update rule is as follows: [schéma://][IP or server domain[:port]]/file path ♦ While the schema is one of the following values: http https tftp File path: it is a virtual directory to the server. ♦ Macro expansion applies with URLs. ♦ The two examples of valid URLs are: tftp://prov.call.com/cpe/CW$MA.conf neptune.speak.net

3. Macro expansion

IP542N supports macro expansion; the available variables for macro substitution are MA, MAU, MAC, PN, SN, IP, SWVER, and HWVER. Macro variables are invoked by prefixing the name with the character “$” (e.g. $MAC). Substitution works even within a quoted string, without requiring additional escaping. If the variable name is immediately followed by an alphanumeric character, enclose the variable name with parentheses (e.g. ‘$(MAC).conf’). The table below describes macro expansion"
Macro name Macro expansion
$ The form $$ extends to a single character $.
The form $$MAU extends to $0021F2011B19.
The form $MAU extends to 0021F2011B19.
MA MAC address in lowercase hexadecimal, e.g., 0021f2011b19.
MAU MAC address in uppercase hexadecimal, e.g., 0021F2011B19.
MAC MAC address uses lowercase hexadecimal digits, and colons separate pairs of hexadecimal digits, for
example 00:21:f2:01:1b:19.
PN Product name, e.g., G502 or VOIP ATA.
SN Serial number, e.g., E3C08109000051
IP WAN IP address, e.g., 201.45.12.89
SWVER Software version, e.g., v3.3.8
HWVER Hardware version, e.g., v1.0.1
Flying Voice products can support 4 methods to perform macro expansion:
♦ During macro expansion, expressions of the form $NAME and $(NAME) are replaced with the content of named variables. For example, an IP542N with MAC address 0021F2011B19,$(MAU)config.cfg macro‑expands to 0021F2011B19config.cfg ; ♦ If a macro name is not recognized, it remains undeveloped. For example, the name STRANGE is not recognized as a valid macro name, while MAU is recognized as a valid macro name; Thus $STRANGE$MAU.cfg macro‑expands to $STRANGE0021F2011B19.cfg ;
♦ Macro expansion is not applied recursively. For example, $$MAU expands to $MAU (the $$ is expanded), and not 0021F2011B19, for a device with the indicated MAC address.
♦ De plus, l’expression macro peut qualifier l’expansion afin que seule une sous‑chaîne de la variable macro soit utilisé à la place de sa valeur complète, comme une partie de l’adresse MAC. La syntaxe pour l’expansion de macro sous‑chaîne est $(NAME:p) et $(NAME:p:q), où p et q sont entiers non négatifs. L’expansion résultante donne la sous‑chaîne de la variable macro commençant au caractère décalage p, et de longueur q (ou jusqu’à la fin de la chaîne si q n’est pas spécifié).
For example, for a device with a recursive MAC address, the expression $(MAU:4) macro‑expands the string F2011B19, while the expression $(MAU:8:2) macro‑expands to the string 1B. The following image is an example of macro expansion deployment:
20130228084757382.jpg

4. Provisioning with HTTP/HTTPS/TFTP

4.1. Provisioning via HTTP

① Install the HTTP server, we use Apache, install httpd-2.2.15-win32.msi by default, then you can see the apache icon in the login item as below:
20130228085512834.jpg ② Open C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf, then make the following changes: ♦DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" to DocumentRoot "D:/conf/" ♦ <Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”> to <Directory "D:/conf/">
③ Create the conf folder on drive D. Place the configuration file in D:/conf/. (When using macro expansion, we can set the file name based on each product’s MAC address, e.g., fv0021f2011b19.conf.)
④ Restart Apache. ⑤ Verify server installation Open the browser and enter the URL: ip address of the HTTP server or domain. If you have successfully created the http server, the URL can be correctly linked and the user can see all files in the directory D:/conf/
⑥ Connect to the product page, then go to the "provision" column, fill in the URL in the file rule, like flyingvoice.com and disable the 66 option because the default value is "enable", click Save to submit your changes and restart the product. With the new settings, the equipment will resynchronize with the configuration file specified by the URL. For example :
20130228090612973.jpg
⑦ If you want to perform a firmware update using provisioning, place the update file in D:/conf/ and fill in the URL in the update rule is empty, then save the changes and restart the IP542N.
20130228090719788.jpg IP542N will automatically complete the firmware update. Review : ♦ The user must change the value of DBID_DBASE_VERSION after each modification, or the product does not resynchronize. The simplest way is to add one to the setting. ♦ The user must note the status of option 66.

4.2. Provisioning via HTTPS

① Install the HTTP server, we use Apache, install httpd-2.2.15-win32.msi by default, then you will see the Apache icon in the connection items as below:
② Copiez les trois fichiers cacert.pem、sslservercert.pem et sslserverkey.pem vers C:/Program Files/Apache Software Foundation/Apache2.2/conf/ ;
③ Open C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf and then make the following changes:
u DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" to DocumentRoot "D:/conf/" u <Directory “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”> to <Directory "D:/conf/">
④ Open C:/Program Files/Apache Software Foundation/Apache2.2/conf/extra/httpd-ssl.conf, then make the following changes:
◆DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs" to DocumentRoot "D:/conf/" ◆Find #SSLCACertificateFile and set it as follows: SSLCACertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2 /conf/cacert.pem" (don’t forget to remove the '#' character) ◆ Find SSLCertificateFile and set it as follows: SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/ sslservercert.pem"
◆ Find SSLCertificateKeyFile and set it as follows : SSLCertificateKeyFile "C:/Program Files/Apache Software Foundation/Apache2.2/ conf/sslserverkey.pem"
⑤ Create the folder “conf” on drive D. Place the configuration file in D:/conf/. (When using the expansion macro, we can set the file name based on each product's MAC address, e.g., fv0021f2011b19.conf.)
⑥ Restart Apache.
⑦ Verify the server installation Open the browser and enter the URL: server IP address HTTPS or domain. If you have successfully built an http server, the URL can be correctly linked and the user can see all files in the D:/conf/ directory ⑧ Download the certificate files
Open the Administration/Security page of your product, and choose Provision CA Certification from Update the Type column, then press the 20130228093437151.jpgkey to choose the cacert.pem directory, click 20130228093457769.jpg to start the download. Use the same methods to update the provision client certificate (sslclientcert.pem) and the provision private key (sslclientkey.pem). Once the download is complete, the web page appears as follows:
20130228093611609.jpg Note: if there is 20130228093628631.jpg request, please fill in « whatever ».
⑨ Connect to the product Web page, then go to the “provision” column, fill in the URL in the file rule, for example flyingvoice.com, disable option 66 and click Save to submit your changes and restart the product. With the new settings, the equipment will resynchronize with the configuration file specified by the URL. Notice : ♦ The user must change the value of DBID_DBASE_VERSION after each modification, or the product will not resynchronize. The simplest way is to add one to the parameter. ♦ The user must note the status of option 66. ♦ The user cannot perform the update with HTTPS, please refer to HTTP or TFTP to do so.

4.3. Provision with DHCP and TFTP

4.3.1. Install the TFTP server and the DHCP server

(1) Install the TFTP server ① Place the configuration file (e.g. : Configfile.cfg) and tftpd32.exe in the same directory ; ② Open tftpd32.exe, then press to check if Configfile.cfg exists and see the TFTP server IP address (the address is 192.168.20.151 in the following image)
20130228094005826.jpg
③ Open the command prompt, type "tftp Server IP get Configfile.cfg", the result "Transfer Successful" indicates The TFTP server has been installed correctly.
20130228094020129.jpg (2) Install the DHCP server

Image 4.3.1
♦ Adresse de début du pool IP : il s’agit de l’adresse IP qui sera distribuée à
Client DHCP.
♦ Taille du pool : nombre d’adresses IP que vous souhaitez distribuer.
♦ Serveur WINS/DNS : est l’adresse IP du serveur DHCP, nous utilisons généralement l’IP du PC
adresse.
♦ Routeur par défaut : est le routeur par défaut du serveur DHCP, nous utilisons généralement l'IP du PC
adresse.
♦ Masque : généralement 255.255.255.0
♦ Option supplémentaire : option 66 et adresse IP du serveur.
Each time you finish configuring the DHCP server, press the Save button to submit the changes.
4.3.2. Internal provisioning with DHCP and TFTP
When deploying a large number of SIP phones on the network, it is preferable to use the DHCP "option 66" to automatically indicate the provisioning URL and other parameters to the phone.
In a LAN environment, connect a PC and the IP542N to a hub, a switch, or a small router. ② On the PC, install and activate a TFTP server as described in section 4.3.1. ③ On the TFTP server, install the DHCP server as indicated in section 4.3.1, fill in the two blank spaces in 20130228094222248.jpg with 66 and the server IP. The IP address is the one from which the TFTP server will request the configuration file.
④ Make sure the configuration file has been placed in the directory. For example, in image 4.3.1, the directory is D:\tftp.
⑤ Ensure that the configuration file name matches the default file name on the WEB. In the case of IP542N device, the default configuration file name for Option 66 is IP542N.conf, and the configuration file in the directory must also be IP542N.conf. ⑥ Restart the device, then log in to the WEB to verify that the settings have been correctly modified.After restarting IP542N, it retrieves the configuration file from the TFTP server and automatically restarts again to configure new settings.Note: the user must enter the correct configuration file name on the IP542N Web page, otherwise the IP542N will not be able to complete the configuration.
4.3.3. Remote provisioning with TFTP
If you need a solution that does not require the DHCP "Option 66" option, you can also manually insert the provisioning URL into each phone via its web page.
In a LAN environment, connect a PC and the IP542N to a hub, a switch, or a small router. ② Open the IP542N web page, disable option 66 and fill in Profile Rule and Config File Name. For example : 20130228095822439.png
③ Appuyez sur le bouton Enregistrer et redémarrez l’IP542N, après que l’IP542N ait reçu le fichier de configuration, il se configurera automatiquement. Si vous souhaitez utiliser le TFTP avec Internet, c’est identique. Désactivez l’option 66 et remplissez le nom de fichier de configuration et la règle de profil corrects, par exemple tftp://www.flyingvoice.com/fv$(MAU).conf.
Review :
♦ The user must ensure that your TFTP server is accessible via the Internet when using TFTP with Internet. ♦ Option 66 and the profile rule essentially serve the same function, namely configuring the device by downloading a configuration file. However, Option 66 cannot operate simultaneously with the profile rule. In In other words, only one of them works at a time. Additionally, the priority of Option 66 is higher than that of the profile rule. Therefore, if the profile rule is preferred, Option 66 must be set to "disable" or the parameter DBID_PRV_OPTION66_ENABLED=0 must be specified in the configuration file.
According to the update, it is identical. When you have finished configuring the TFTP server, you place the update file in the same catalog where TFTP32.exe is stored, e.g., tftp://192.168.1.1/IP542N.bin. Save your changes and restart the product. It will automatically start the update. 20130228100048939.png Review : ♦ Users must change the value of DBID_DBASE_VERSION after each modification, or the product does not resynchronize. The simplest way is to add one to the setting. ♦ Users must consider the status of option 66, regardless of the provisioning mode, including HTTP, HTTPS and TFTP.

4.4. Encrypt the configuration file

Use the encrypt file to encrypt param.conf on Linux with the command: [./encrypt_file] [key] [source file name] [destination file name] Example: # key = 123456, the source file is config.cfg, the destination file is config-enc.cfg, the command is:
20130228100137315.png Lorsque cette forme de chiffrement est utilisée pour crypter un profil de configuration, le produit doit être informé the value of the secret key to decrypt the file. This value is specified as a qualifier in the URL of the relevant profile with [--key ‘key’]. The syntax is as follows, using an explicit URL: [--key 123456]tftp://IP du serveur ou domaine/chemin/param-enc.conf For example: 20130228100217117.png
If you have an incorrect password, the IP542N will not obtain the configuration file when resynchronizing with the server. Remember your password carefully. And if you have an incorrect IP address, the IP542N will not resynchronize with the HTTP/TFTP/HTTPS server. Any erroneous information can affect the outcome. In other words, pay attention to the profile rule and other information you need to enter.

5. Importing the configuration file

The contents of the param.conf file are as follows

Note : ①Chaque fois après modification de param.conf, vous devez changer la valeur de DBID_DBASE_VERSION,

the simplest way is to add one to the setting after each change. ② "0" means "disable", "1" means "enable". ③ Modify the value after the "=" to change the settings
DBID_DBASE_VERSION=2207 / each time, the user tests the TFTP/HTTP/HTTPS server, must
change the value (add 1 each time)/
DBID_IPMODE=0 20130228100348781.png
DBID_FIXED_IP_ADDR=192.168.10.207 /static IP address/
DBID_SUBNET_MASK=255.255.255.0 /subnet mask/
DBID_DFLT_GW_IP_ADDR=192.168.10.1 /default gateway/
DBID_SIP_ENABLE=1 0 0 0 "1" activates SIP, "0" deactivates. Four digits respectively
represent line1, line2, line3, line4. Use the tab to separate.
DBID_WEB_SIP_SERVER=192.168.10.200 / the SIP server IP address value
DBID_WEB_SIP_SERVER_PORT=5060 / SIP server port value/
DBID_WEB_SIP_OUTBOUND=192.168.10.201 / the value of the backup outgoing proxy IP address/
DBID_WEB_SIP_OUTBOUND_PORT=5060 / the value of the OUTGOING PROXY port BACKUP/
DBID_WEB_SIP_OUTBOUND_BACKUP=192.168.10.202 / the value of the OUTGOING PROXY IP address/
DBID_WEB_SIP_OUTBOUND_BACKUP_PORT=5060 /the value of the OUTBOUND PROXY port /
DBID_SIP_DIS_NAME=23103_name /SIP account name
DBID_SIP_PHONE_NUM=23103 /the value of the phone number.
DBID_SIP_ACCOUNT=23103 /set the account value for each line./
DBID_SIP_PASSWORD=23103 /define the password value for each line./
DBID_PRV_OPTION66_ENABLED=0 = 0, disable DHCP 66 option, the URL in profile_rule will be
used;
=1, enable DHCP 66 option, the URL in profile_rule will be
omis.