Content

Page tree



In this article we want to give you an example of how you can provision your phones via DHCP.

Required servers

For this example we will need:

  • an HTTP(s) or TFTP server that the server can reach
  • a DHCP server on which you can configure options 66 and 67 



Setting file

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)

test1
<?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>

Wildcard

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.

test1
<?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".

    test1
    <?xml version="1.0" encoding="utf-8" ?>
    <settings>
    	<functionKeys>
    		<fkey idx="*" context="active" label="">line</fkey>
    	</functionKeys>
    </settings>
  •  All fkey (index 1 to 104) are assigned as context="active", label="" and line as the feature type.



Steps

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.



How this works

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:

  1. Snom Redirection and Provisioning Service (SRAPS);
  2. SIP PnP;
  3. DHCP;
  4. TR69.

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 .


  1. Then, the phone starts the provisioning process with the Snom Redirection and Provisioning Service (SRAPS) default link (provisioning prio 1 according to parameter provisioning_order ). You see in the phone logs:
    Apr 10 14:24:58.335 [NOTICE] PHN: Setting server prio 1, type redirection, url: >http://provisioning.snom.com/snomD345/snomD345.htm<
  2. 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: ><

  3. 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<
    ...
    Apr 10 14:24:58.524 [NOTICE] PHN: Fetching URL: http://192.168.137.1:80/test1
    ...
    Apr 10 14:24:58.531 [INFO ] PHN: Config setup: code: 200, uri: http://192.168.137.1:80/test1
    Apr 10 14:24:58.531 [NOTICE] PHN: read_xml_settings: found settings (container) XML header
    Apr 10 14:24:58.531 [NOTICE] PHN: read_xml_settings: found phone-settings XML header

    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

  4. Because DHCP provisioning was successful, the phone does not continue to prio 4.