in asterisk, software, voip

Auto-provisioning with Asterisk and ST2030 Technicolor/Thomson phones

An introduction to the ST2030

The ST2030 is one of the few SIP phones distributed by Thomson (now changed name to Technicolor). In fact there are only 2 models: the ST2020, and the ST2030, and also a new one, the TB30, which is the successor to the ST2030. The ST2030 is supposed to have an End-of-Life set to the end of this year (2010), but I read that its EOL has been extended to the end of 2012.
In my personal experience, I think the ST2030 has the best price/functionalities/quality ratio. It has features like:

  • PoE (Power over Ethernet).
  • Headphone plug with a button on the phone to pickup with the headphone (or if you have a compatible headphone, pickup directly with a button on the headphone).
  • XML based Directory support, that you can interface with a remote HTTP server.
  • 4 differents lines/profiles (but not at the same time).
  • BLF (Busy Lamp Fields) to monitor other’s phone status (if they are using their phone, and even possibility to intercept a call).
  • Full compatibilty with Asterisk (tested on Asterisk 1.6+ and 1.8+).
  • Auto-provisioning with support for TFTP but also for HTTP/HTTPS, which simplifies quite a lot the provisioning configuration.

In this document, we’ll see the auto-provisioning process through DHCP+HTTP.

The main web pages related on the ST2030 are the Voip-info.org pages and the official Technicolor/Thomson web page.

Requirements

  • Linux
  • Asterisk (1.8+)
  • Technicolor ST2030 phones
  • DHCP server
  • HTTP server (Apache, nginx)

Manual upgrade of the Boot, DSP and APP firmware

  • Boot your phone (yes it’s very long, 5+ minutes)
  • Long press the ‘menu’ button, which will display the phone’s ip address

  • Connect to http://your_ip/admin.html and enter ‘administrator‘ as login and 784518 as password (the default)
  • Finally go to ‘Utility’ tab, and upload the v2030_boot_v111.zz, v2030_dsp_R11.1_SED_v320.zz and v2030SG.R11.1.SED.100804.2.72.2.zz files (each one needs to reboot your phone, it will take a loooooong time :-)

To verify that you’ve correctly upgraded your phone, go to the admin Home page, you should get something like:

H/W Version: 	V5
 Boot Version: 	V1.11
 DSP Version: 	V3.20
 APP Version: 	V2.72

Deploying ST2030 IP phones using DHCP and HTTP

This is called auto-provisioning. Normally, one use DHCP/PXE/BOOTP + TFTP to deploy servers, but it is so slow, unreliable, and the tftp protocol is so primitive, that it gets really hard when you need to deploy different phones.

Today, I’ll show you how to deploy ST2030 phones with only DHCP and HTTP servers, nothing more. The most useful documentation you’ll need is the “official” doc named “Auto provisioning and customization for IP Phone ST2030 and ST2022, November 16, 2009”. You can find it in the latest zip file (currently “ST2030 SIP firmware and documents v2.72“.
The latest versions of these phones support provisioning not only by TFTP, but also by HTTP. I don’t know since which version of the firmware it works that way, but I advise you to upgrade to the latest version (you can also try the upgrade by provisioning, as it does the firmware upgrade too).

My version shows:

Boot Version: 	V1.11
 DSP Version: 	V3.20
 APP Version: 	V2.7

Boot workflow

As detailed in the official documentation, here is its workflow:

Configuring the DHCP server

Personnaly I use the default ISC DHCPv3 server (on Ubuntu), but it should work the same way on any implementation (not sure about MS Windows).
As you can see on the workflow, we need to get in the ‘Option 43’ state. But to get there, you need to be sure your phone is in a default/factory reset state (otherwise your phone may be setup to boot without DHCP, or not use the HTTP/TFTP data, and get it directly).

In your DHCP server configuration you must be sure you haven’t defined or played with the 150, 66 or 67 option codes, otherwise you’ll get into the TFTP boot workflow! If you want to be sure, or to debug your workflow, I recommend you use tcpdump, or even better, tshark. You’ll get something like that:

root@home:/etc/dhcp3# tshark host 10.0.8.123
 Capturing on eth0
 0.564814     10.0.8.1 -> 10.0.8.123   DHCP DHCP Offer    - Transaction ID 0xf101e5e6
 1.694101     10.0.8.1 -> 10.0.8.123   DHCP DHCP ACK      - Transaction ID 0xf101e5e6
 2.194885     10.0.8.1 -> 10.0.8.123   ICMP Echo (ping) request
 2.195531     10.0.8.123 -> 10.0.8.1   ICMP Echo (ping) reply
 8.877535     10.0.8.123 -> 10.0.8.1   TFTP Read Request, File: provisioning/ST2030/config/\000, Transfer type: octet\000
 8.882145     10.0.8.1 -> 10.0.8.123   TFTP Error Code, Code: File not found, Message: File not found\000

Which is BAD!

So edit your /etc/dhcp3/dhcpd.conf configuration file, and *REMOVE* lines like:

option option-66 code 66 = text;
 option option-67 code 67 = text;

A correct example would be:

option option-43 code 43 = text;
 option domain-name "intra.myhome.fr";
 option domain-name-servers 10.0.8.3;

default-lease-time 12000;
 max-lease-time 72000;

authoritative;
 log-facility local7;

subnet 10.0.8.0 netmask 255.255.255.0 {
 range 10.0.8.100 10.0.8.150;
 option routers 10.0.8.254;
 option ntp-servers 192.168.100.254;
 }
 group {
  option option-43 "http://10.0.8.165/ST2030.inf";
  host test1 { hardware ethernet 00:1f:9f:86:a8:29;}
}

Configuration of the HTTP server and the served files

I used NGINX as web server, but it will work equaly well with Apache2 or anything that can serve files throught HTTP.
Just define a root where you will put your firmware and configuration files:

server {
 listen   80; ## listen for ipv4
 listen   [::]:80 default ipv6only=on; ## listen for ipv6
 server_name  localhost;
 access_log  /var/log/nginx/provisioning.access.log;

location / {
 root   /var/www;
 index  index.html index.htm;
 autoindex on;
 allow 10.0.0.0/16;
 }

After uncompressing the firmware files (from the ZIP), the directory structure in your web root should be the following:

root@monserveur:/var/www# tree
 .
 .-- nginx-default
 .   .-- 50x.html
 .   .-- index.html
 .-- provisioning
 .   .-- ST2030
 .       .-- config
 .       .   .-- ComConf2030SG.R11.1.SED.100804.2.72.2.txt
 .       .   .-- ST2030S_001F9F16A849.txt
 .       .-- data
 .           .-- LangTbl.zz
 .           .-- TelConf2030SG.R11.1.SED.100804.2.72.2.txt
 .           .-- Tone-CW.txt
 .           .-- Tone-Melodies.txt
 .           .-- Tone-RG.txt
 .           .-- ToneTbl.zz
 .           .-- v2030_boot_v111.zz
 .           .-- v2030_dsp_R11.1_SED_v320.zz
 .           .-- v2030SG.R11.1.SED.100804.2.72.2.zz
 .-- ST2030.inf

The most important file is the ST2030.inf file (you can find a default file named ‘ST2030S-ip.inf‘ in the ZIP. The goal of this file is to define where to get all the following files (firmware and configuration files). Mine looks like this:

[application]
 fwurl=http://10.0.8.165/provisioning/ST2030/data/v2030SG.R11.1.SED.100804.2.72.2.zz
 dspurl=http://10.0.8.165/provisioning/ST2030/data/v2030_dsp_R11.1_SED_v320.zz
 booturl=http://10.0.8.165/provisioning/ST2030/data/v2030_boot_v111.zz

[config]
 telcfg=http://10.0.8.165/provisioning/ST2030/data/TelConf2030SG.R11.1.SED.100804.2.72.2.txt
 common_config=http://10.0.8.165/provisioning/ST2030/config/ComConf2030SG.R11.1.SED.100804.2.72.2.txt

melodies=http://10.0.8.165/provisioning/ST2030/data/Tone-Melodies.txt
 system_melodies=http://10.0.8.165/provisioning/ST2030/data/Tone-RG.txt
 call_waiting_tone=http://10.0.8.165/provisioning/ST2030/data/Tone-CW.txt

tone_table=http://10.0.8.165/provisioning/ST2030/data/ToneTbl.zz
 language_table=http://10.0.8.165/provisioning/ST2030/data/LangTbl.zz

config=http://10.0.8.165/provisioning/ST2030/config/

All your phone specific files will be looked according to the ‘config’ variable. Here, it’s ‘/provisioning/ST2030/config/‘, where it will look for ST2030S_ .txt (the ‘S’ is for SIP).

Before you boot you phone(s), you should at least configure your common file (ComConf2030SG.R11.1.SED.100804.2.72.2.txt) to most used values. Then add a file named ST2030S_ .txt where you put only the differences with that common file. One of mine’s looks like:

[ipp]
 TimeFlag=1
 LanguageType=1

[sip]
 RegisterServerMP1=10.0.8.165
 ProxyServerMP1=10.0.8.165
 ServiceDomainMP1=10.0.8.165

RegisterServerBK1=10.0.3.1
 ProxyServerBK1=10.0.3.1
 ServiceDomainBK1=10.0.3.1

TEL1Number=1001
 DisplayName1=Telephone 1001
 regid1=1001
 regpwd1=1234

CallPkupSC=*8X
 AuthMessageServer=10.0.8.165

[net]
 TelnetTime=240
 TelnetSrv=1
 VLAN=0

[sys]
 CodecJitterBufMult=g711a(2/3/7)g711mu(1/3/5)g729(2/3/4)g723(1/2/3)
 CodecPktime=g711a(20)g711mu(20)g729(30)g723(30)
 CodecPriority=g711a(1)g711mu(2)g729(3)g723(4)
 CodecAdaptivePlayout=g711a(1)g711mu(1)g729(1)g723(1)
 Current_Max_Multiline=5
 TelnetID=administrator
 TelnetPWD=789234
 CountryCode=FR
 config_sn=201007300008
 FeatureKeyExt01=L/
 FeatureKeyExt02=L/
 FeatureKeyExt03=L/
 FeatureKeyExt04=L/
 FeatureKeyExt05=L/
 FeatureKeyExt06=L/
 FeatureKeyExt07=L/
 FeatureKeyExt08=S/
 FeatureKeyExt09=S/
 FeatureKeyExt10=S/
 Phonebook1_url=http://myhomeserver.mydomain.fr:8000/search?q=#SEARCH
 Phonebook1_name=My phone book

[autoprovision]
 AutoprovisionFlag=1
 AutoprovisionHTTPServer=
 AutoprovisionTFTPServer=
 AutoprovisionTimeDays=0
 Autoprovisionstarttime=00:00
 AutoprovisionTimeSpan=0
 AutoprovisionRetryPeriod=30
 Decryption_Key=Th0mson2$8s8@9z!

[ntp]
 NtpDaylight=1
 NTPFlag=1
 NtpIP=10.0.1.44
 NtpZoneNum=22

This file has NTP and several other parameters adjusted for french infos/timezone. Another note, please take great details when editing this file, as any mistake, will make it be skipped by the phone boot process. Also, don’t forget to increase/modify the ‘config_sn’ attribute (attention, that attribute *MUST* be 12 digits long, i.e. 201007300008).

Boot workflow

To force a firmware update/workflow from scratch, you can click the ‘restore default’ button in the phone web interface, or, when the phone starts (unplug/plug the power supply/network cable for PoE), press and hold down the headset and mute buttons.

GET /ST2030.inf HTTP/1.1" 200
 GET /provisioning/ST2030/data/v2030SG.R11.1.SED.100804.2.72.2.zz HTTP/1.1 200
 GET /provisioning/ST2030/data/v2030_dsp_R11.1_SED_v320.zz HTTP/1.1 200
 GET /provisioning/ST2030/data/v2030_boot_v111.zz HTTP/1.1 200

Here, it gets the main configuration file, ST2030.inf, and, from it, the APP, DSP and BOOT firmwares.

The phone reboots…

GET /ST2030.inf HTTP/1.1" 200
 GET /provisioning/ST2030/data/Tone-Melodies.txt HTTP/1.1" 200
 GET /provisioning/ST2030/data/Tone-RG.txt HTTP/1.1" 200
 GET /provisioning/ST2030/data/Tone-CW.txt HTTP/1.1" 200
 GET /provisioning/ST2030/data/ToneTbl.zz HTTP/1.1" 200
 GET /provisioning/ST2030/data/LangTbl.zz HTTP/1.1" 200
 GET /provisioning/ST2030/data/TelConf2030SG.R11.1.SED.100804.2.72.2.txt HTTP/1.1" 200
 GET /provisioning/ST2030/config/ComConf2030SG.R11.1.SED.100804.2.72.2.txt HTTP/1.1" 200
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.ser HTTP/1.1" 404
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.txt HTTP/1.1" 200

Here, it gets the common configuration files for the phone, and looks for a file the the phone’s MAC address name (ST2030S_001F9F16E849.txt).
The phone reboots…

GET /ST2030.inf HTTP/1.1" 200
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.ser HTTP/1.1" 404
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.txt HTTP/1.1" 200

When there is no modification, you’ll get the following HTTP request on your server (if you want to force a firmware update/workflow from scratch, you can click the ‘restore default’ button in the web interface, or, when the phone boots, press and hold down the headset and mute buttons)

GET /ST2030.inf HTTP/1.1 200
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.ser HTTP/1.1 404
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.txt HTTP/1.1 200

Here, as you can see with the 404 error code, the ST2030S_001F9F16E849.ser is missing, but that’s normal. This file only exists if you encrypt your configuration file (tools available in the zip file). So it’s the same as the .txt file, but encrypted.

So , to summarize the workflow, the phone gets an IP address from the DHCP, and also the url to get the main configuration, throught the option-43 DHCP attribute.

Another way to find out what went wrong, is to look at the APS logs, which are available on the web phone’s GUI, in the ‘setup’ menu, option ‘APS Log’:

Autoprovision Process start
 Begin General file download...
 General file: ST2030.inf download successfully!
 Begin Firmware download...
 Firmware filename is the same!
 Begin DSP download...
 DSP filename is the same!
 Begin Boot Code download...
 BOOT code filename is the same!
 Begin Melody download...
 Begin Common Config download...
 Common Config filename is the same!
 Begin Mac config download...
 Error: provisioning/ST2030/config/ST2030S_001F9F16E849.ser file not found!
 Now will try to search txt file!
 MacConfig: provisioning/ST2030/config/ST2030S_001F9F16E849.txt download successfully!
 Serial number is not the same!
 Begin upgrading config file...
 Check config file syntax
 Check config file syntax successfully!
 Upgrading config file successfully!
 Reboot.....
 [...]
 Begin General file download...
 General file: ST2030.inf download successfully!
 Begin Firmware download...
 Firmware filename is the same!
 Begin DSP download...
 Begin Telephone Config download...
 Telephone config filename is the same!
 Begin Common Config download...
 Common Config filename is the same!
 Begin Mac config download...
 Error: provisioning/ST2030/config/ST2030S_001F9F16E849.ser file not found!
 Now will try to search txt file!
 MacConfig: provisioning/ST2030/config/ST2030S_001F9F16E849.txt download successfully!
 Serial number is the same!
 Begin upgrading config file...
 No upgrading config file required...
 Autoprovision Process End

Update: One last note, when you edit/update your MAC named file, do not forget to update/increment the config_sn file, otherwise the phone will think the data hasn’t changed!

Now, to finish, you just have to create a new file (named with a MAC address) for each of your phones. In the next article, I’ll show you how to make Asterisk do it for you, all automatically, from sip.conf’s files!

Facebooktwitterredditpinterestlinkedinmail