In this article we want to give you an example of how you can provision your phones via DHCP.
For this example we will need:
In thie example we will provision only a few settings for a basic setup of the phone. The provisioning file is created according to the configuration file format .
We will create file test1 with the following content: (replace settings user_name, user_host and user_pass with your account information)
<?xml version="1.0" encoding="utf-8" ?> <settings> <phone-settings> <language perm="">English</language> <timezone perm="">USA-10</timezone> <tone_scheme perm="">USA</tone_scheme> <user_active idx="1" perm="">true</user_active> <user_name idx="1" perm="">101</user_name> <user_host idx="1" perm="">192.168.137.1:5070</user_host> <user_pass idx="1" perm="">test</user_pass> </phone-settings> </settings> |
For index based settings, "*" can be used as a wildcard character in the idx attribute. When the "*" is used, the same value and attributes will apply to that setting for all indexes.
<?xml version="1.0" encoding="utf-8" ?> <settings> <phone-settings> <referred_by_brackets idx="*">on</referred_by_brackets> </phone-settings> </settings> |
the referred_by_brackets settings for 1 to 12 indexes are all set to "on".
<?xml version="1.0" encoding="utf-8" ?> <settings> <functionKeys> <fkey idx="*" context="active" label="">line</fkey> </functionKeys> </settings> |
1. Configure option 66 to point to your HTTP/TFTP server, for example " http://192.168.137.1 "
2. Configure option 67 to point to your file, for example "test1.xml"
3. On the HTTP/TFTP server, copy file test1.xml created above to the http root directory
4. After removing phone out of the box or after a factory reset, the phone will fetch the configuration file http://192.168.137.1 /test1.xml.
At boot time, the Snom phone automatically tries to find out where to retrieve its settings from. It tries the supported provisioning types one after the other as defined by the parameter provisioning_order .
The default order is:
After booting and sending the DHCP request, the phone receives the values " http://192.168.137.1 " and "test1.xml" in the DHCP offer from server. It stores these in settings update_server and update_filename .
Apr 10 14:24:58.335 [NOTICE] PHN: Setting server prio 1, type redirection, url: >http://provisioning.snom.com/snomD345/snomD345.htm< |
Next, as the Snom redirection does not succeed (since we did not use the service), the phone tries the next provisioning order, prio 2 (SIP PnP) but since this was also not used it skips it. You see in the phone logs:
Apr 10 14:24:58.523 [NOTICE] PHN: Skipping prio 2 setting server, type pnp, url: >< |
Further, it continues with prio 3, DHCP. You see in the phone logs:
Apr 10 14:24:58.523 [NOTICE] PHN: Setting server prio 3, type dhcp, url: >http://192.168.137.1/test1< |
If debug is enabled, you see the settings that got changed as well:
Apr 10 14:24:58.532 [DEBUG0] CFG: ReadOneSetting: language = 'English', need_apply: 0, provisioning (progress:1/finished:0), need reboot: 0 Apr 10 14:24:58.532 [DEBUG0] CFG: ReadOneSetting: timezone = 'USA-10', need_apply: 0, provisioning (progress:1/finished:0), need reboot: 0 Apr 10 14:24:58.532 [DEBUG0] CFG: ReadOneSetting: tone_scheme = 'USA', need_apply: 0, provisioning (progress:1/finished:0), need reboot: 0 Apr 10 14:24:58.532 [DEBUG0] CFG: ReadOneSetting: user_active = 'true', need_apply: 0, provisioning (progress:1/finished:0), need reboot: 0 Apr 10 14:24:58.532 [DEBUG0] CFG: ReadOneSetting: user_name = '101', need_apply: 0, provisioning (progress:1/finished:0), need reboot: 0 Apr 10 14:24:58.533 [DEBUG0] CFG: ReadOneSetting: user_host = '192.168.137.1:5070', need_apply: 0, provisioning (progress:1/finished:0), need reboot: 0 Apr 10 14:24:58.533 [DEBUG0] CFG: ReadOneSetting: user_pass = '******', need_apply: 0, provisioning (progress:1/finished:0), need reboot: 0 |
Because DHCP provisioning was successful, the phone does not continue to prio 4.