<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Luc Stepniewski&#039;s Blog &#187; asterisk</title>
	<atom:link href="http://www.gradstein.info/category/software/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gradstein.info</link>
	<description></description>
	<lastBuildDate>Thu, 29 Dec 2011 22:59:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.gradstein.info/?pushpress=hub'/>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Auto-provisioning with Asterisk and ST2030 Technicolor/Thomson phones</title>
		<link>http://www.gradstein.info/software/asterisk/auto-provisioning-asterisk-st2030-technicolorthomson-phones/</link>
		<comments>http://www.gradstein.info/software/asterisk/auto-provisioning-asterisk-st2030-technicolorthomson-phones/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 13:45:03 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[voip]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[autoprovisioning]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[http server]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[provisioning]]></category>
		<category><![CDATA[sip]]></category>
		<category><![CDATA[sip phones]]></category>
		<category><![CDATA[Technicolor]]></category>
		<category><![CDATA[tftp]]></category>
		<category><![CDATA[Thomson]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=411</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<h2 class="title">An introduction to the ST2030</h2>
<p>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.<br />
In my personal experience, I think the ST2030 has the best price/functionalities/quality ratio. It has features like:</p>
<ul>
<li> PoE (Power over Ethernet).</li>
<li>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).</li>
<li>XML based Directory support, that you can interface with a remote HTTP server.</li>
<li>4 differents lines/profiles (but not at the same time).</li>
<li>BLF (Busy Lamp Fields) to monitor other&#8217;s phone status (if they are using their phone, and even possibility to intercept a call).</li>
<li>Full compatibilty with Asterisk (tested on Asterisk 1.6+ and 1.8+).</li>
<li>Auto-provisioning with support for TFTP but also for HTTP/HTTPS, which simplifies quite a lot the provisioning configuration.</li>
</ul>
<p>In this document, we&#8217;ll see the auto-provisioning process through DHCP+HTTP.</p>
<p><span id="more-411"></span></p>
<p>The main web pages related on the ST2030 are the <a href="http://www.voip-info.org/wiki/view/Thomson+ST2030" class="liexternal">Voip-info.org</a> pages and the <a href="http://technicolorbroadbandpartner.com/telephony-solutions/products/product-detail.php?id=87" class="liexternal">official Technicolor/Thomson web page</a>.</p>
<h2>Requirements</h2>
<ul>
<li>Linux</li>
<li>Asterisk (1.8+)</li>
<li>Technicolor ST2030 phones</li>
<li>DHCP server</li>
<li>HTTP server (Apache, nginx)</li>
</ul>
<p><span style="font-size: 26px; line-height: 28px;">Manual upgrade of the Boot, DSP and APP firmware</span></p>
<ul>
<li>Boot your phone (yes it&#8217;s very long, 5+ minutes)</li>
<li>Long press the &#8216;menu&#8217; button, which will display the phone&#8217;s ip address</li>
</ul>
<p><a href="http://www.gradstein.info/wp-content/uploads/2010/12/300px-St2030_1.jpg" class="liimagelink"><img class="aligncenter size-full wp-image-412" title="Main console of ST2030 phones" src="http://www.gradstein.info/wp-content/uploads/2010/12/300px-St2030_1.jpg" alt="" width="300" height="271" /></a></p>
<ul>
<li>Connect to http://your_ip/admin.html and enter &#8216;<strong>administrator</strong>&#8216; as login and <strong>784518</strong> as password (the default)</li>
<li>Finally go to &#8216;Utility&#8217; tab, and upload the <strong>v2030_boot_v111.zz</strong>, <strong>v2030_dsp_R11.1_SED_v320.zz</strong> and <strong>v2030SG.R11.1.SED.100804.2.72.2.zz</strong> files (each one needs to reboot your phone, it will take a loooooong time :-)</li>
</ul>
<p>To verify that you&#8217;ve correctly upgraded your phone, go to the admin Home page, you should get something like:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">H/W Version: 	V5
 Boot Version: 	V1.11
 DSP Version: 	V3.20
 APP Version: 	V2.72</pre></div></div>

<p><span style="font-size: 26px; line-height: 28px;">Deploying ST2030 IP phones using DHCP and HTTP</span></p>
<p>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.</p>
<p>Today, I&#8217;ll show you how to deploy ST2030 phones with only DHCP and HTTP servers, nothing more. The most useful documentation you&#8217;ll need is the &#8220;official&#8221; doc named &#8220;Auto provisioning and customization for IP Phone ST2030 and ST2022, November 16, 2009&#8243;. You can find it in the latest zip file (currently &#8220;<a href="http://technicolorbroadbandpartner.com/telephony-solutions/products/product-detail.php?id=87" class="liexternal">ST2030 SIP firmware and documents v2.72</a>&#8220;.<br />
The latest versions of these phones support provisioning not only by TFTP, but also by HTTP. I don&#8217;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).</p>
<p>My version shows:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">Boot Version: 	V1.11
 DSP Version: 	V3.20
 APP Version: 	V2.7</pre></div></div>

<h2 class="title">Boot workflow</h2>
<p>As detailed in the official documentation, here is its workflow:</p>
<p style="text-align: center;"><a href="http://www.gradstein.info/wp-content/uploads/2010/12/800px-St2030-workflow.png" class="liimagelink"><img class="aligncenter size-full wp-image-413" title="ST2030 boot workflow" src="http://www.gradstein.info/wp-content/uploads/2010/12/800px-St2030-workflow.png" alt="" width="600" height="314" /></a></p>
<h2 class="title">Configuring the DHCP server</h2>
<p>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).<br />
As you can see on the workflow, we need to get in the &#8216;Option 43&#8242; 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).</p>
<p>In your DHCP server configuration you must be sure you haven&#8217;t defined or played with the 150, 66 or 67 option codes, otherwise you&#8217;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&#8217;ll get something like that:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>home:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dhcp3<span style="color: #666666; font-style: italic;"># tshark host 10.0.8.123</span>
 Capturing on eth0
 <span style="color: #000000;">0.564814</span>     10.0.8.1 -<span style="color: #000000; font-weight: bold;">&gt;</span> 10.0.8.123   DHCP DHCP Offer    - Transaction ID 0xf101e5e6
 <span style="color: #000000;">1.694101</span>     10.0.8.1 -<span style="color: #000000; font-weight: bold;">&gt;</span> 10.0.8.123   DHCP DHCP ACK      - Transaction ID 0xf101e5e6
 <span style="color: #000000;">2.194885</span>     10.0.8.1 -<span style="color: #000000; font-weight: bold;">&gt;</span> 10.0.8.123   ICMP Echo <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ping</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> request
 <span style="color: #000000;">2.195531</span>     10.0.8.123 -<span style="color: #000000; font-weight: bold;">&gt;</span> 10.0.8.1   ICMP Echo <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ping</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> reply
 <span style="color: #000000;">8.877535</span>     10.0.8.123 -<span style="color: #000000; font-weight: bold;">&gt;</span> 10.0.8.1   TFTP Read Request, File: provisioning<span style="color: #000000; font-weight: bold;">/</span>ST2030<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>\000, Transfer <span style="color: #7a0874; font-weight: bold;">type</span>: octet\000
 <span style="color: #000000;">8.882145</span>     10.0.8.1 -<span style="color: #000000; font-weight: bold;">&gt;</span> 10.0.8.123   TFTP Error Code, Code: File not found, Message: File not found\000</pre></div></div>

<p>Which is BAD!</p>
<p>So edit your /<strong>etc/dhcp3/dhcpd.conf</strong> configuration file, and *REMOVE* lines like:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">option option-66 code 66 = text;
 option option-67 code 67 = text;</pre></div></div>

<p>A correct example would be:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">option option-43 code 43 = text;
 option domain-name &quot;intra.myhome.fr&quot;;
 option domain-name-servers 10.0.8.3;
&nbsp;
default-lease-time 12000;
 max-lease-time 72000;
&nbsp;
authoritative;
 log-facility local7;
&nbsp;
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 &quot;&lt;a rel=&quot;nofollow&quot; href=&quot;http://10.0.8.165/ST2030.inf&quot;&gt;http://10.0.8.165/ST2030.inf&lt;/a&gt;&quot;;
  host test1 { hardware ethernet 00:1f:9f:86:a8:29;}
}</pre></div></div>

<p><span style="font-size: 26px; line-height: 28px;">Configuration of the HTTP server and the served files</span></p>
<p>I used NGINX as web server, but it will work equaly well with Apache2 or anything that can serve files throught HTTP.<br />
Just define a root where you will put your firmware and configuration files:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">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;
&nbsp;
location / {
 root   /var/www;
 index  index.html index.htm;
 autoindex on;
 allow 10.0.0.0/16;
 }</pre></div></div>

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

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">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</pre></div></div>

<p>The most important file is the <strong>ST2030.inf</strong> file (you can find a default file named &#8216;<strong>ST2030S-ip.inf</strong>&#8216; 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:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">[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
&nbsp;
[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
&nbsp;
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
&nbsp;
tone_table=http://10.0.8.165/provisioning/ST2030/data/ToneTbl.zz
 language_table=http://10.0.8.165/provisioning/ST2030/data/LangTbl.zz
&nbsp;
config=http://10.0.8.165/provisioning/ST2030/config/</pre></div></div>

<p>All your phone specific files will be looked according to the &#8216;config&#8217; variable. Here, it&#8217;s &#8216;<strong>/provisioning/ST2030/config/</strong>&#8216;, where it will look for <strong>ST2030S_ .txt</strong> (the &#8216;S&#8217; is for SIP).</p>
<p>Before you boot you phone(s), you should at least configure your common file (<strong>ComConf2030SG.R11.1.SED.100804.2.72.2.txt</strong>) to most used values. Then add a file named <strong>ST2030S_ .txt</strong> where you put only the differences with that common file. One of mine&#8217;s looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">[ipp]
 TimeFlag=1
 LanguageType=1
&nbsp;
[sip]
 RegisterServerMP1=10.0.8.165
 ProxyServerMP1=10.0.8.165
 ServiceDomainMP1=10.0.8.165
&nbsp;
RegisterServerBK1=10.0.3.1
 ProxyServerBK1=10.0.3.1
 ServiceDomainBK1=10.0.3.1
&nbsp;
TEL1Number=1001
 DisplayName1=Telephone 1001
 regid1=1001
 regpwd1=1234
&nbsp;
CallPkupSC=*8X
 AuthMessageServer=10.0.8.165
&nbsp;
[net]
 TelnetTime=240
 TelnetSrv=1
 VLAN=0
&nbsp;
[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
&nbsp;
[autoprovision]
 AutoprovisionFlag=1
 AutoprovisionHTTPServer=
 AutoprovisionTFTPServer=
 AutoprovisionTimeDays=0
 Autoprovisionstarttime=00:00
 AutoprovisionTimeSpan=0
 AutoprovisionRetryPeriod=30
 Decryption_Key=Th0mson2$8s8@9z!
&nbsp;
[ntp]
 NtpDaylight=1
 NTPFlag=1
 NtpIP=10.0.1.44
 NtpZoneNum=22</pre></div></div>

<p>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&#8217;t forget to increase/modify the &#8216;config_sn&#8217; attribute (<em><strong>attention, that attribute *MUST* be 12 digits long, i.e. 201007300008</strong></em>).</p>
<h2 class="title">Boot workflow</h2>
<p>To force a firmware update/workflow from scratch, you can click the &#8216;restore default&#8217; 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.</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">GET /ST2030.inf HTTP/1.1&quot; 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</pre></div></div>

<p>Here, it gets the main configuration file, ST2030.inf, and, from it, the APP, DSP and BOOT firmwares.</p>
<p>The phone reboots&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">GET /ST2030.inf HTTP/1.1&quot; 200
 GET /provisioning/ST2030/data/Tone-Melodies.txt HTTP/1.1&quot; 200
 GET /provisioning/ST2030/data/Tone-RG.txt HTTP/1.1&quot; 200
 GET /provisioning/ST2030/data/Tone-CW.txt HTTP/1.1&quot; 200
 GET /provisioning/ST2030/data/ToneTbl.zz HTTP/1.1&quot; 200
 GET /provisioning/ST2030/data/LangTbl.zz HTTP/1.1&quot; 200
 GET /provisioning/ST2030/data/TelConf2030SG.R11.1.SED.100804.2.72.2.txt HTTP/1.1&quot; 200
 GET /provisioning/ST2030/config/ComConf2030SG.R11.1.SED.100804.2.72.2.txt HTTP/1.1&quot; 200
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.ser HTTP/1.1&quot; 404
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.txt HTTP/1.1&quot; 200</pre></div></div>

<p>Here, it gets the common configuration files for the phone, and looks for a file the the phone&#8217;s MAC address name (ST2030S_001F9F16E849.txt).<br />
The phone reboots&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">GET /ST2030.inf HTTP/1.1&quot; 200
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.ser HTTP/1.1&quot; 404
 GET /provisioning/ST2030/config/ST2030S_001F9F16E849.txt HTTP/1.1&quot; 200</pre></div></div>

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

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">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</pre></div></div>

<p>Here, as you can see with the 404 error code, the ST2030S_001F9F16E849.ser is missing, but that&#8217;s normal. This file only exists if you encrypt your configuration file (tools available in the zip file). So it&#8217;s the same as the .txt file, but encrypted.</p>
<p>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.</p>
<p>Another way to find out what went wrong, is to look at the APS logs, which are available on the web phone&#8217;s GUI, in the &#8216;setup&#8217; menu, option &#8216;APS Log&#8217;:</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">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</pre></div></div>

<p><strong><span style="text-decoration: underline;">Update:</span></strong> 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&#8217;t changed!</p>
<p>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&#8217;ll show you how to make Asterisk do it for you, all automatically, from sip.conf&#8217;s files!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/software/asterisk/auto-provisioning-asterisk-st2030-technicolorthomson-phones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk: DADHI module not working when using Xen</title>
		<link>http://www.gradstein.info/software/asterisk/asterisk-dadhi-module-not-working-when-using-xen/</link>
		<comments>http://www.gradstein.info/software/asterisk/asterisk-dadhi-module-not-working-when-using-xen/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 11:30:54 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[voip]]></category>
		<category><![CDATA[digium]]></category>
		<category><![CDATA[hardware card]]></category>
		<category><![CDATA[rtc]]></category>
		<category><![CDATA[timer]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=224</guid>
		<description><![CDATA[If you want to use any Asterisk module that needs a timer, like MeetMe, you have to use a module named dahdi (previously named zaptel). DAHDI has one module for each Digium supported card (B410P), and a dummy module (named dahdi_dummy) if you don&#8217;t have a hardware card, like me. The problem appears when you [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use any <a href="http://www.asterisk.org/" class="liexternal">Asterisk</a> module that needs a timer, like MeetMe, you have to use a module named dahdi (previously named zaptel). DAHDI has one module for each Digium supported card (B410P), and a dummy module (named dahdi_dummy) if you don&#8217;t have a hardware card, like me.</p>
<p>The problem appears when you have your Asterisk in a Xen environment. Xen does not allow the use of the RTC, so when using Dahdi/meetme, you get the following in you logs:</p>
<blockquote><p>res_timing_dahdi.c: Asterisk has detected a problem with your DAHDI configuration and will shutdown for your protection.</p></blockquote>
<p>So get the sources, and let&#8217;s patch it!</p>
<p><code>svn co  http://svn.digium.com/svn/dahdi/linux-complete/trunk DAHDI</code></p>
<p>In dahdi_dummy.c, you&#8217;ll have to comment the two defines USE_RTC, as in a Xen, you can&#8217;t use it:</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;"># diff -u dahdi_dummy.c.ori dahdi_dummy.c
<span style="color: #888822;">--- dahdi_dummy.c.ori	2009-03-23 09:50:36.000000000 +0000</span>
<span style="color: #888822;">+++ dahdi_dummy.c	2009-03-23 08:55:38.000000000 +0000</span>
<span style="color: #440088;">@@ -59,11 +59,11 @@</span>
 #if defined<span style="">&#40;</span>CONFIG_HIGH_RES_TIMERS<span style="">&#41;</span> &amp;&amp; LINUX_VERSION_CODE &gt;= VERSION_CODE<span style="">&#40;</span><span style="">2</span>,<span style="">6</span>,<span style="">22</span><span style="">&#41;</span>
 #define USE_HIGHRESTIMER
 #else
<span style="color: #991111;">-#define USE_RTC</span>
<span style="color: #00b000;">+//#define USE_RTC</span>
 #endif
 #else
 #if <span style="">0</span>
<span style="color: #991111;">-#define USE_RTC</span>
<span style="color: #00b000;">+//#define USE_RTC</span>
 #endif
 #endif
 #endif</pre></div></div>

<p>Then compile the module, as usual, with :</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">/etc/init.d/dahdi stop
make all
make install
make config</pre></div></div>

<p>Verify that your module has been correctly installed:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">ls -al ./2.6.24-19-xen/dahdi/dahdi_dummy.ko</pre></div></div>

<p>Comment out all the defined modules in the /etc/dahdi/modules file.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">/etc/init.d/dahdi start
# dmesg
1007539.576458] dahdi: Telephony Interface Registered on major 196
[1007539.576468] dahdi: Version: SVN-trunk-r6201M
[1007540.642839] dahdi: Registered tone zone 2 (France)</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/software/asterisk/asterisk-dadhi-module-not-working-when-using-xen/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Asterisk cirpack problem with Free and freephonie.net</title>
		<link>http://www.gradstein.info/software/asterisk/asterisk-cirpack-problem-with-free-and-freephonienet/</link>
		<comments>http://www.gradstein.info/software/asterisk/asterisk-cirpack-problem-with-free-and-freephonienet/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 09:34:51 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[voip]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[cirpack]]></category>
		<category><![CDATA[correction]]></category>
		<category><![CDATA[france]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[free isp provider]]></category>
		<category><![CDATA[freephonie.net]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[provider]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=179</guid>
		<description><![CDATA[If you configured your Asterisk/FreeSWITCH server to talk to your freephonie.net (french Free ISP provider), you&#8217;ll see in the logs the following warning message: [Feb 12 09:29:06] WARNING[9228]: chan_sip.c:6624 determine_firstline_parts: Bad request protocol Packet This is not really a problem, but an annoyance, as it fills up your logs. This is a known problem for [...]]]></description>
			<content:encoded><![CDATA[<p>If you configured your Asterisk/FreeSWITCH server to talk to your freephonie.net (french Free ISP provider), you&#8217;ll see in the logs the following warning message:<br />
<code>[Feb 12 09:29:06] WARNING[9228]: chan_sip.c:6624 determine_firstline_parts: Bad request protocol Packet</code></p>
<p>This is not really a problem, but an annoyance, as it fills up your logs. This is a <a href="http://bugs.digium.com/view.php?id=7261&#038;nbn=6" class="liexternal">known problem</a> for more than years, but has never been corrected (neither by Asterisk nor by Cirpack devs). The usual correction was to add the following line to your startup scripts (/etc/rc.local on Debian for example):<br />
<code>iptables -A INPUT -p udp -m udp --dport 5060 -m string --string "Cirpack KeepAlive Packet" -j DROP</code></p>
<p>But the syntax has changed in iptables, and you&#8217;ll get the error:<br />
<code>iptables v1.3.6: STRING match: You must specify `--algo'</code></p>
<p>so, just add one of the 2 available algorithms (bm and kmp):<br />
<code>iptables -A INPUT -p udp -m udp --dport 5060 -m string --string "Cirpack KeepAlive Packet" --algo bm -j DROP<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/software/asterisk/asterisk-cirpack-problem-with-free-and-freephonienet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to dial a number using Asterisk and Python</title>
		<link>http://www.gradstein.info/python/how-to-dial-a-number-using-asterisk-and-python/</link>
		<comments>http://www.gradstein.info/python/how-to-dial-a-number-using-asterisk-and-python/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 09:39:17 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[voip]]></category>
		<category><![CDATA[click to dial]]></category>
		<category><![CDATA[dial]]></category>
		<category><![CDATA[originate]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/?p=33</guid>
		<description><![CDATA[I didn&#8217;t find any example in Python on how to Dial a number from an Asterisk server and link it to another channel. So here&#8217;s a quick code to do it. You just need to have a manager defined in your /etc/asterisk/manager.conf defined. 1 2 3 4 5 6 7 8 9 10 11 12 [...]]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t find any example in Python on how to Dial a number from an Asterisk server and link it to another channel. So here&#8217;s a quick code to do it. You just need to have a manager defined in your /etc/asterisk/manager.conf defined.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code"><pre class="shell" style="font-family:monospace;">import socket
&nbsp;
HOST=&quot;192.168.1.116&quot;
PORT=5038
&nbsp;
p = &quot;&quot;&quot;Action: login
Events: off
Username: %(username)s
Secret: %(password)s
&nbsp;
Action: originate
Channel: SIP/%(local_user)s
WaitTime: 60
CallerId: 600
Exten: %(phone_to_dial)s
Context: default
Priority: 1
&nbsp;
Action: Logoff
&quot;&quot;&quot;
def click_to_call(phone_to_dial, username, password, local_user):
    pattern = p % {
            'phone_to_dial': phone_to_dial,
            'username': username,
            'password': password,
            'local_user': local_user}
&nbsp;
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((HOST, PORT))
&nbsp;
    data = s.recv(1024)
    for l in pattern.split('\n'):
        print &quot;Sending&gt;&quot;, l
        s.send(l+'\r\n')
        if l == &quot;&quot;:
            data = s.recv(1024)
            print data
    data = s.recv(1024)
    s.close()
&nbsp;
if __name__ == '__main__':
    click_to_call(phone_to_dial='123456789',
                  username='manager_login', password='yourpass',
                  local_user='600')</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/python/how-to-dial-a-number-using-asterisk-and-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Change in syntax and functionality in Asterisk AstDB functions</title>
		<link>http://www.gradstein.info/software/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/</link>
		<comments>http://www.gradstein.info/software/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/#comments</comments>
		<pubDate>Mon, 14 May 2007 10:32:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
				<category><![CDATA[asterisk]]></category>

		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/</guid>
		<description><![CDATA[Since Asterisk 1.2+, the methods to access the AstDB database (a berkeley local database) were changed from DBGet,DBPut,DBDel to the merged &#8220;simpler&#8221; one named Set (except for DbDel which seems to still exist). There was a functionnality that when a key was not found in AstDB, a jump would be done to n+101. So the [...]]]></description>
			<content:encoded><![CDATA[<p>Since Asterisk 1.2+, the methods to access the AstDB database (a berkeley local database) were changed from DBGet,DBPut,DBDel to the merged &#8220;simpler&#8221; one named Set (except for DbDel which seems to still exist). There was a functionnality that when a key was not found in AstDB, a jump would be done to n+101. So the following would be OK:</p>
<p class="code">exten = s,1,Set(forward_number=${DB(FORWARD/1234)})<br />
exten = s,2,Background(one_local/forward/forward_number_is)<br />
exten = s,3,sayalpha(${forward_number})<br />
exten = s,4,Goto(s-report_mode,1)<br />
exten = s,102,NoOp(Pas de valeur ce qui est normal)<br />
exten = s,103,Goto(s-not_set,1)</p>
<p>But with my newly installed Asterisk 1.4.4, it doesn&#8217;t jump anymore. It continues to s,2 :-(.<br />
So I guess I need to add a <a href="http://www.voip-info.org/wiki/view/Asterisk+func+db_exists" class="liexternal">supplementary line</a> to explicitely test the presence of the key:</p>
<p class="code">exten = s,1,GotoIf(${DB_EXISTS(FORWARD/${F_EXT})}?:102)<br />
exten = s,2,Set(forward_number=${DB_RESULT})<br />
exten = s,3,Background(one_local/forward/forward_number_is)<br />
exten = s,4,sayalpha(${forward_number})<br />
&#8230;<br />
exten = s,102,NoOp(Pas de valeur ce qui est normal)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/software/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using memcached

Served from: www.stepniewski.fr @ 2012-02-06 08:02:17 -->
