Skip to content

Auto-provision Linksys devices

Auto-provisioning lets an IP phone or an analog adapter fetch its SIP settings from the switch instead of being configured by hand. You enter the device’s MAC address on an account; the switch writes a configuration profile for that device, and the device downloads it over HTTP or TFTP when it boots. This tutorial sets up one Linksys device. Allow about 20 minutes plus up to an hour for the first profile.

Linksys is the only device type the switch generates profiles for. The profile uses the XML flat-profile format of the Linksys and Cisco SPA series: phones and adapters such as SPA2102, SPA3102, PAP2T, SPA8000, SPA9000, SPA901, SPA921, SPA922, SPA941, SPA942, SPA962, SPA525G, WRP400 and WIP310.

  • You have Administrator access to the panel.
  • The account the device will use exists and has a VoIP Password. See Accounts.
  • You have the MAC address of the device, printed on its label.
  • You can open the device’s web interface to set the provisioning options once.

Once an hour, at minute 27, the switch goes through every account that has a CPE Number, a Provisioning ID and a VoIP password, and writes a profile for each new device:

  1. It takes the template linksys.cfg from /home/ssp/etc/provisioning/. An environment other than the first one uses its own copy in /home/ssp/etc/provisioning/env<N>/ when it exists.
  2. It replaces the macros in the template with the data of the environment and the account.
  3. It saves the result as linksys-<MAC>.cfg, where <MAC> is the CPE Number in upper case without separators, for example linksys-000E08AABBCC.cfg.

The profiles are served at http://<switch IP>/provisioning/ and by TFTP from the same directory. The switch deletes the profile when the account is deleted.

Macro Replaced with
%%SIP_PROXY%% The first IP address of the environment
%%SIP_PORT%% The SIP UDP port of the environment
%%SIP_USERNAME%% Account Name
%%SIP_AUTHNAME%% VoIP Login
%%SIP_PASSWORD%% VoIP Password
%%SIP_CALLER_NAME%% The caller name of the account

The default template registers line 1 of the device with the account and checks for a new profile every hour:

<flat-profile>
<Provision_Enable>Yes</Provision_Enable>
<Resync_On_Reset>Yes</Resync_On_Reset>
<Resync_Periodic>3600</Resync_Periodic>
<Resync_From_SIP>No</Resync_From_SIP>
<Profile_Rule>http://%%SIP_PROXY%%/provisioning/linksys-$(MAU).cfg</Profile_Rule>
<Line_Enable_1_>Yes</Line_Enable_1_>
<SIP_Port_1_>%%SIP_PORT%%</SIP_Port_1_>
<Proxy_1_>%%SIP_PROXY%%</Proxy_1_>
<Register_1_>Yes</Register_1_>
<Register_Expires_1_>3600</Register_Expires_1_>
<User_ID_1_>%%SIP_USERNAME%%</User_ID_1_>
<Password_1_>%%SIP_PASSWORD%%</Password_1_>
<Auth_ID_1_>%%SIP_AUTHNAME%%</Auth_ID_1_>
<Use_Auth_ID_1_>Yes</Use_Auth_ID_1_>
<Preferred_Codec_1_>G729a</Preferred_Codec_1_>
<Use_Pref_Codec_Only_1_>No</Use_Pref_Codec_Only_1_>
</flat-profile>
  1. Decide whether the defaults suit you. A common change is Preferred_Codec_1_, for example G711u when your vendors do not offer G.729.
  2. Ask FlySIP support to apply your version of the template, or edit linksys.cfg yourself if you have shell access to the switch. Any parameter of the Linksys flat profile can be added.

Result: the template matches the settings your devices need.

  1. Open My Customers → Accounts and open the account.
  2. Select the Advanced tab.
  3. Under SIP / Services enter CPE Number: the MAC address of the device, for example 00:0E:08:AA:BB:CC. Colons, dashes and lower case are fine.
  4. Under Service / Payment enter Provisioning ID: 1 (Linksys).
  5. Click Save.
Screenshot "tutorials/auto-provisioning-account" has not been generated yet — see scripts/screenshots/screens.yml.

Result: the next hourly run writes linksys-000E08AABBCC.cfg for the device.

  1. Open the web interface of the device and go to the Provisioning tab (in admin, advanced view).
  2. Set Provision Enable: Yes and Resync On Reset: Yes.
  3. Enter Profile Rule: http://203.0.113.10/provisioning/linksys-$(MAU).cfg, with the IP address of your switch instead of 203.0.113.10. The device replaces $(MAU) with its own MAC address in upper case.
  4. Save the settings and reboot the device.

For TFTP use tftp://203.0.113.10/linksys-$(MAU).cfg and allow the device’s network on the TFTP tab of the IP Firewall. For HTTP the device’s network must be allowed on the Web tab, which is open to any address by default. See Set up the firewall.

Result: the device downloads the profile, registers line 1 with the account and repeats the download every hour.

  1. Open http://<switch IP>/provisioning/linksys-<MAC>.cfg in a browser and check that the macros are replaced with the account’s data.
  2. Open My Customers → Accounts. The status icon of the account turns into a green check; hover over it to see the device’s user agent and contact address.
  3. Make a test call from the device and find it in Call Records (CDRs).