<?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>Runtux Blog &#187; asterisk</title>
	<atom:link href="http://blog.runtux.com/category/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.runtux.com</link>
	<description>Neues, Interessantes, Skurriles</description>
	<lastBuildDate>Wed, 25 Aug 2010 16:55:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configuring Asterisk to log CDR records via ODBC to a remote MS-SQL</title>
		<link>http://blog.runtux.com/2009/08/18/112/</link>
		<comments>http://blog.runtux.com/2009/08/18/112/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 12:23:58 +0000</pubDate>
		<dc:creator>Ralf Schlatterbeck</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://blog.runtux.com/?p=112</guid>
		<description><![CDATA[In the following I&#8217;ll describe how to setup asterisk to log via ODBC to a remote Microsoft SQL server &#8212; I needed this for a client. I&#8217;m using a Debian server, file location may differ for your brand of linux distribution.
The following packages exist for debian, the ones needed are marked with &#8220;NEEDED&#8221;
A good introduction [...]]]></description>
			<content:encoded><![CDATA[<p>In the following I&#8217;ll describe how to setup asterisk to log via ODBC to a remote Microsoft SQL server &#8212; I needed this for a client. I&#8217;m using a Debian server, file location may differ for your brand of linux distribution.<br />
The following packages exist for debian, the ones needed are marked with &#8220;NEEDED&#8221;<br />
A good introduction to the Free TDS implementation of ODBC is the <a href="http://www.freetds.org/userguide/">userguide of FreeTDS</a></p>
<p><b>Debian FreeTDS packages</b></p>
<ul class="simple">
<li>freetds-common &#8211; configuration files for FreeTDS SQL client libraries: NEEDED</li>
<li>freetds-dev &#8211; MS SQL and Sybase client library (static libs and headers)</li>
<li>gda2-sybase &#8211; FreeTDS backend plugin for GNOME Data Access library for GNOME2</li>
<li>libct4 &#8211; libraries for connecting to MS SQL and Sybase SQL servers, needed only for sqsh for testing, gets automatically installed with sqsh.</li>
<li>libdbd-freetds &#8211; Freetds database server driver for libdbi</li>
<li>libsybdb5 &#8211; libraries for connecting to MS SQL and Sybase SQL servers</li>
<li>sqlrelay-freetds &#8211; SQL Relay FreeTDS (Sybase and MS SQL Server) connection daemon</li>
<li>sqsh &#8211; commandline SQL client for MS SQL and Sybase servers depends on libct4: Good for testing</li>
<li>tdsodbc &#8211; ODBC driver for connecting to MS SQL and Sybase SQL servers &#8220;This package includes the ODBC driver for FreeTDS, for use with UnixODBC or iODBC.&#8221;: NEEDED</li>
</ul>
<p>FreeTDS Needs either unixodbc or iodbc, both are ODBC implementations for Linux/Unix. Asterisk is built against unixodbc.<br />
iodbc packages:
<ul class="simple">
<li>iodbc &#8211; GTK+ config frontend for the iODBC Driver Manager</li>
<li>libiodbc2 &#8211; iODBC Driver Manager</li>
<li>libiodbc2-dev &#8211; iODBC Driver Manager (development files)</li>
</ul>
<p>unixodbc packages:
<ul class="simple">
<li>unixodbc &#8211; ODBC tools libraries depends on odbcinst1debian1: NEEDED</li>
<li>unixodbc-bin &#8211; Graphical tools for ODBC management and browsing</li>
<li>unixodbc-dev &#8211; ODBC libraries for UNIX (development files)</li>
</ul>
<p>common packages for debian:
<ul class="simple">
<li>odbcinst1debian1 &#8211; Support library and helper program for accessing odbc ini files: NEEDED</li>
</ul>
<p>Asterisk depends on unixodbc which should be already installed, so we install the following packages (ignoring any warnings about already-installed packages):
<pre>

apt-get install unixodbc sqsh tdsodbc
</pre>
<p><b>Other Software using ODBC</b></p>
<ul>
<li>
<p>Python seems to have its own access module for MS-SQL:<br />
python-pymssql &#8211; Python database access for MS SQL server and Sybase</li>
</ul>
<p><b>Configuraton for Asterisk Logging</b></p>
<ul>
<li>
/etc/freetds/freetds.conf
<pre>

[global]
        # TDS protocol version
;       tds version = 4.2

        # Whether to write a TDSDUMP file for diagnostic purposes
        # (setting this to /tmp is insecure on a multi-user system)
;       dump file = /tmp/freetds.log
;       debug flags = 0xffff

        # Command and connection timeouts
;       timeout = 10
;       connect timeout = 10

        # If you get out-of-memory errors, it may mean that your client
        # is trying to allocate a huge buffer for a TEXT field.
        # Try setting 'text size' to a more reasonable limit
        text size = 64512

[logserver]
        host = 172.23.23.4
        port = 1433
        tds version = 8.0
</pre>
</li>
<li>
/etc/odbcinst.ini
<pre>

[FreeTDS]
Description = FreeTDS ODBC driver for MSSQL
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
</pre>
</li>
<li>
/etc/odbc.ini
<pre>

[ODBC Data Sources]
logserver = MSSQL Log-Server for Asterisk

[logserver]
description = MSSQL Log-Server for Asterisk
driver      = /usr/lib/odbc/libtdsodbc.so
servername  = logserver
language = us_english
trace = no
tracefile = /root/mssql.trace
</pre>
</li>
<li>
/etc/asterisk/cdr_odbc.conf
<pre>

[global]
dsn=logserver
username=asterisk
password=VERYSECRET
loguniqueid=yes
dispositionstring=yes
table=cdr              ;"cdr" is default table name
usegmtime=no             ; set to "yes" to log in GMT
</pre>
</li>
<li>
Test using <code>isql</code></p>
<pre>
# isql logserver asterisk "VERYSECRET" -v
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL&gt; select * from cdr;
[output of current cdr table]
</pre>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.runtux.com/2009/08/18/112/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Warum ich nicht mit Skype telefoniere</title>
		<link>http://blog.runtux.com/2009/05/28/98/</link>
		<comments>http://blog.runtux.com/2009/05/28/98/#comments</comments>
		<pubDate>Thu, 28 May 2009 08:24:46 +0000</pubDate>
		<dc:creator>Ralf Schlatterbeck</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[deutsch]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[skurril]]></category>

		<guid isPermaLink="false">http://blog.runtux.com/?p=98</guid>
		<description><![CDATA[Nachdem ich immer mal wieder gefragt werde, was meine Skype-ID sei, hier meine Gründe, warum ich Skype nicht verwende:
Die Firma Skype hat fr&#252;her Peer-to-Peer Filesharing-Software hergestellt (mit dem Namen &#34;KaZaA&#34;), Filesharing-Programme dienen zum Tauschen von Musik und anderen elektronischen Inhalten. Diese Software hat nachgewiesenermassen sogenannte &#8220;Spyware&#8221; enthalten (vgl. auch diverse Tips, wie man diese ausschalten [...]]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich immer mal wieder gefragt werde, was meine Skype-ID sei, hier meine Gründe, warum ich Skype nicht verwende:</p>
<p>Die Firma Skype hat fr&#252;her Peer-to-Peer Filesharing-Software hergestellt (mit dem Namen <a href="http://www.voip-info.org/tiki-index.php?page=Skype">&quot;KaZaA&quot;</a>), Filesharing-Programme dienen zum Tauschen von Musik und anderen elektronischen Inhalten. Diese Software hat nachgewiesenermassen sogenannte <a href="http://www.zdnet.de/news/security/0,39023046,39128156,00.htm">&#8220;Spyware&#8221; enthalten</a> (vgl. auch diverse Tips, wie man diese <a href="http://www.mpex.net/news/archiv/00392.html">ausschalten k&#246;nnen soll</a>). Unter <a href="http://de.wikipedia.org/wiki/Spyware">Spyware</a> verstehen wir Programme, die unbemerkt vom Eigent&#252;mer eines Rechners diesen Rechner ausspioniert und die ausspionierten Daten via Internet an den Programmierer der Spyware schickt. Zu den ausspionierten Daten z&#228;hlen Statistiken &#252;ber das Besuchen von Websites bis zu Passw&#246;rtern. Was genau die von der KaZaA Spyware ausspionierten Daten sind entzieht sich meiner Kenntnis. Ich vertraue solchen Leuten meine Telefongespr&#228;che nicht an.</p>
<p>Es gibt eine unabh&#228;ngige Analysen von Skype <a href="http://www.simson.net/ref/2005/OSI_Skype6.pdf">2005</a> und <a href="http://www.blackhat.com/presentations/bh-europe-06/bh-eu-06-biondi/bh-eu-06-biondi-up.pdf">2006</a>, nach der in der analysierten Skype-Version keine Hinweise auf Spyware gefunden wurden. Das kannn sich inzwischen ge&#228;ndert haben und diese Analyse sagt nichts &#252;ber die Sicherheit von Skype aus:</p>
<p>Skype (und vorher schon KaZaA) enthalten Mechanismen, um automatisch neue Software-Versionen (teilweise ohne Wissen oder sogar Zustimmung des Benutzers) zu installieren. In einer solchen neuen Version k&#246;nnte Spyware enthalten sein &#8212; oder auch nur eine Software-Fehler der vorher nicht enthalten war. Damit ist man den Herstellern der Software ausgeliefert, da es unter der Kontrolle von Skype ist, was in neuen Versionen enthalten sein wird. Man k&#246;nnte auch sagen: Nach Installation von Skype geh&#246;rt Dir Dein Computer nicht mehr.</p>
<p>Dann wird immer wieder behauptet, die Kommunikation mit Skype sei verschl&#252;sselt. Das mag ja stimmen. Der Grund ist aber wohl nicht die Privatsph&#228;re des Nutzers, sondern die Absicht, zu verhindern, dass andere Software schreiben, die das Skype-Protokoll spricht. Denn was n&#252;tzt mir die Verschl&#252;sselung wenn ich nicht weiss, wer den Schl&#252;ssel besitzt? Der Benutzer von Skype besitzt den Schl&#252;ssel jedenfalls nicht.</p>
<p>Zum Abh&#246;ren hat Kurt Sauer, Leiter der Sicherheitsabteilung von Skype, auf die durch ZDNet gestellte Frage, ob Skype die Gespr&#228;che abh&#246;ren k&#246;nne, ausweichend geantwortet: &quot;Wir stellen eine sichere Kommunikationsm&#246;glichkeit zur Verf&#252;gung. Ich werde Ihnen nicht sagen, ob wir dabei zuh&#246;ren k&#246;nnen oder nicht.&quot; (vgl. den Artikel in der <a href="http://de.wikipedia.org/wiki/Skype#Kritik">deutschen Wikipedia</a> dazu bzw. direkt das <a href="http://www.zdnet.de/mobiles_internet_drahtloses_arbeiten_telefonieren_uebers_internet_wie_sicher_ist_skype_wirklich_story-39001620-39151472-1.htm">ZDNET-Interview</a>.</p>
<p>Hinzu kommt, dass sich Skype an keinerlei etablierte Standards im Bereich der Sprachkommunikation &#252;ber Internet-Protokolle h&#228;lt, ja wie Skype genau funktioniert ist nicht offengelegt, es kann also keine andere Firma derzeit Programme bauen, die mit Skype-Software zusammen funktioniert. Solche &quot;Closed Source&quot; Programme f&#246;rdern Monopolstellungen und sind &#8212; &#228;hnlich wie z.B. Monopolstellungen im Bereich von Nahrungsmitteln wie Genmais von Monsanto &#8212; mit erh&#246;hter Wachsamkeit zur Kenntnis zu nehmen. Die etablierten Standards im Bereich der Sprachkommunikation stehen Punkto Sprachqualit&#228;t u.a. Skype in nichts nach.</p>
<p>Skype hat &#8212; aus seiner Peer-to-Peer Vergangenheit &#8212; Mechanismen um durch <a href="http://de.wikipedia.org/wiki/Firewall">Firewalls</a> zu &quot;tunneln&quot;. Diese Techniken, auch als &quot;Firewall Piercing&quot; bekannt, sind f&#252;r die Sicherheit einer Firma gef&#228;hrlich, oder wie humorvoll von einem Kollegen formuliert: <a href="http://www.luga.at/mailing-lists/luga/2005/11/msg00107.html">&quot;Firewall Piercings k&#246;nnen sich entz&#252;nden und eitern&quot;</a>.</p>
<p>Es gibt etablierte Standards zur Sprachkommunikation wie z.B. SIP (Session Initiation Protocol) f&#252;r den Verbindungsaufbau. Es gibt <a href="http://www.runtux.com/oss.html">Open Source</a> Implementierungen f&#252;r &quot;Softphones&quot;, das sind &#8212; &#228;hnlich wie Skype &#8212; Programme mit welchen &#252;ber einen Computer telefoniert werden kann. Ein Beispiel ist <a href="http://www.qutecom.org/">Qutecom</a> (fr&#252;her &quot;Wengo Phone&quot;), eine Suche nach &quot;Softphone&quot; in Google sollte noch einige andere zutage f&#246;rdern. Es gibt nat&#252;rlich auch kommerzielle Anbieter solcher Programme (teilweise als Closed Source), der Knackpunkt liegt in einem gemeinsamen Protokoll bei dem alle mitmachen k&#246;nnen. Es gibt inzwischen auch &quot;Hard&quot; phones, also ein Ding was wie ein Telefon aussieht, aber hinten einen Ethernet-Anschluss hat und SIP spricht. Sehr preiswert ist das <a href="http://www.grandstream.com/faqsbudgetone.html">Budgetone von Grandstream</a>, ein weiterer Anbieter ist z.B. <a href="http://snom.com/">Snom</a> und Cisco hat einige kleinere Anbieter wie Sipura gekauft.</p>
<p>Ich habe selbst keine grosse Erfahrungen mit solchen Softphones auf Windows oder MAC Plattformen. F&#252;r Erfahrungsberichte bin ich dankbar.</p>
<p>Dann gibt es Anbieter, die Vermittlungst&#228;tigkeiten f&#252;r solche Softphones anbieten. Ein Beispiel ist  <a href="http://www.sipgate.de/user/index.php">sipgate</a>, andere finden sich auf  <a href="http://www.voip-info.org/wiki-VOIP+Service+Providers">voip-info.org</a>. Man meldet sich dort an, kann gratis mit anderen Softphones &#252;ber das Internet telefonieren, bekommt bei einigen Anbietern sogar kostenlos eine Telefonnummer &#252;ber die man vom Festnetz aus angerufen werden kann. Das &quot;Businessmodell&quot; dieser Anbieter sind Anrufe vom Internet ins Festnetz. Die kosten dann etwas, sind aber immer noch deutlich g&#252;nstiger als z.B. die Telekom in Deutschland oder Österreich.</p>
<p>Ein weiterer SIP-Dienst ist <a href="http://ekiga.net">ekiga.net</a> vom Team des gleichnamigen Open Source Soft-Phones <a href="http://ekiga.org">Ekiga</a>, ich bin dort z.B. als <a href="rsc@ekiga.net">rsc@ekiga.net</a> erreichbar.</p>
<p>Ausserdem ist ein &#246;ffentlicher Verzeichnisdienst <a href="http://de.wikipedia.org/wiki/Enum">ENUM</a> im Aufbau, wo man seine eigene Telefonnummer weiterverwenden kann. Damit wird es in Zukunft m&#246;glich sein, einfach eine Telefonnummer einzugeben und &#252;ber das Internet den gew&#252;nschten Teilnehmer zu erreichen.</p>
<p>Inzwischen gibt es auch eine Open Source Telefonanlage, <a href="http://www.asterisk.org/">Asterisk</a>. Asterisk kann sowohl ans Festnetz (ISDN aber auch eine analoge Leitung) angeschlossen werden, als auch an Internet-Telefonie mit verschiedenen Standards (SIP, IAX, H323) teilnehmen. Die Telefon-Software l&#228;uft auf einem ganz normalen handels&#252;blichen PC &#8212; Modelle mit niedrigem Stromverbrauch sind zu empfehlen, da ja eine Telefonanlage Tag und Nacht in Betrieb sein soll. Asterisk &quot;spricht&quot; bereits heute ENUM. Ausserdem kann man &#252;ber Einsteckkarten ganz normale &quot;analoge&quot; Telefonapparate anschliessen. Dann kann man verschiedene SIP-Anbieter gleichzeitig und einen Festnetzanschluss an der selben Telefonanlage betreiben und mit einem ganz normalen Analogtelefon, oder auch mit einem Komfort-ISDN-Telefon, einem Hard-Phone (z.B. Snom), oder einfach mit einem Softphone &#8212; telefonieren. Man kann die Telefonanlage suchen lassen, ob ein bestimmter Teilnehmer &#252;ber das Internet erreichbar ist oder nur &#252;ber das Festnetz. Der Anrufende muss nicht mal merken ob &#252;ber Festnetz oder Internet telefoniert wird.</p>
<p>Das geniale an Asterisk (und das Erfolgsrezept von vielen anderen Open Source Projekten) ist sein modularer Aufbau: F&#252;r verschiedene anzuschliessende Ger&#228;te oder Protokolle kann man einen &quot;Channel Treiber&quot; schreiben und Asterisk kann danach mit einem neuen Ger&#228;t kommunizieren. So kann ein Spezialist f&#252;r ein bestimmtes Ger&#228;t oder Protokoll einen neuen Ger&#228;tetreiber beitragen.</p>
<p>Man kann Asterisk-Telefonanlagen miteinander vernetzen &#8212; auch &#252;ber eine verschl&#252;sselte Verbindung &#252;ber das Internet, ein sogenanntes <a href="http://de.wikipedia.org/wiki/Virtual_Private_Network">&quot;Virtual Private Network&quot;</a> (VPN). Dann kann man telefonieren ohne dass Dritte die Verbindung abh&#246;ren k&#246;nnen &#8212; eine solche Installation setzt allerdings Absprachen zwischen den Betreibern der zu vernetzenden Telefonanlagen voraus.</p>
<p>Neuere Techniken erlauben, vorhandene SIP-Infrastruktur zu benutzen und trotzdem ohne vorherige Absprache verschlüsselt zu telefonieren. Der Schlüssel wird dabei direkt zwischen den beiden Teilnehmern ausgehandelt. <a href="http://zfoneproject.com/">Philip Zimmermann</a>, der Autor von PGP, hat dafür den Standard <a href="http://tools.ietf.org/html/draft-zimmermann-avt-zrtp-15">ZRTP</a> vorgeschlagen, der inzwischen bei der Internet Engineering Task-Force (dem Gremium das Internet-Standards macht) zur Standardisierung eingereicht ist.</p>
<p>Ich selbst verwende Asterisk seit einigen Jahren statt meiner alten ISDN-Telefonanlage.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.runtux.com/2009/05/28/98/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Good support from Beronet</title>
		<link>http://blog.runtux.com/2009/04/27/92/</link>
		<comments>http://blog.runtux.com/2009/04/27/92/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 08:35:30 +0000</pubDate>
		<dc:creator>Ralf Schlatterbeck</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[neu]]></category>

		<guid isPermaLink="false">http://blog.runtux.com/?p=92</guid>
		<description><![CDATA[On April 9 I blogged here some firmware bugs of the Beronet bero*fos failover switch. They now have a new firmware 1.3.5 &#8212; a little over two weeks after reporting the bug with easter holidays in between. I&#8217;ve not had time yet to test this but wanted to blog this as an example of good [...]]]></description>
			<content:encoded><![CDATA[<p>On April 9 I <a href="http://blog.runtux.com/2009/04/09/81/">blogged here</a> some firmware bugs of the <a href="http://beronet.com/">Beronet</a> <a href="https://shop.beronet.com/product_info.php/cPath/56/products_id/159">bero*fos</a> failover switch. They now have a new <a href="http://www.beronet.com/component/option,com_remository/Itemid,38/func,selectcat/cat,5">firmware 1.3.5</a> &#8212; a little over two weeks after reporting the bug with easter holidays in between. I&#8217;ve not had time yet to test this but wanted to blog this as an example of good support. I&#8217;ll blog the test results when I&#8217;ve had time to test the device with the new firmware.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.runtux.com/2009/04/27/92/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vorträge mISDN und Open Money</title>
		<link>http://blog.runtux.com/2009/04/21/88/</link>
		<comments>http://blog.runtux.com/2009/04/21/88/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 09:57:05 +0000</pubDate>
		<dc:creator>Ralf Schlatterbeck</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[deutsch]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[neu]]></category>

		<guid isPermaLink="false">http://blog.runtux.com/?p=88</guid>
		<description><![CDATA[Auf den Linuxwochen hatte ich einen Vortrag zu mISDN, Abstract und Folien auf meiner Homepage. Auf dem Linuxtag in Graz werde ich nächsten Samstag den Vortrag zu Open Money (natürlich in aktualisierter Form, es tut sich ja einiges) halten.
]]></description>
			<content:encoded><![CDATA[<p>Auf den Linuxwochen hatte ich einen Vortrag zu mISDN, Abstract und Folien auf meiner <a href="http://runtux.com/index.html">Homepage</a>. Auf dem Linuxtag in Graz werde ich nächsten Samstag den <a href="http://www.linuxtage.at/?id=21">Vortrag zu Open Money</a> (natürlich in aktualisierter Form, es tut sich ja einiges) halten.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.runtux.com/2009/04/21/88/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beronet bero*fos failover switch</title>
		<link>http://blog.runtux.com/2009/04/09/81/</link>
		<comments>http://blog.runtux.com/2009/04/09/81/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 15:36:26 +0000</pubDate>
		<dc:creator>Ralf Schlatterbeck</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[skurril]]></category>

		<guid isPermaLink="false">http://blog.runtux.com/?p=81</guid>
		<description><![CDATA[Update 2009-04-27: There is a new firmware: good support from beronet
Update 2009-04-10: I&#8217;ve written a config-utility for the device, available in my rsclib on sourceforge (in python)
I&#8217;m now experimenting with the Beronet bero*fos failover switch. I need this for a project where two redundant asterisks should be switched by the bero*fos.
To get the following into [...]]]></description>
			<content:encoded><![CDATA[<p>Update 2009-04-27: There is a new firmware: <a href="http://blog.runtux.com/2009/04/27/92/">good support from beronet</a><br />
Update 2009-04-10: I&#8217;ve written a config-utility for the device, available in my <a href="http://rsclib.sourceforge.net">rsclib</a> on sourceforge (in python)</p>
<p>I&#8217;m now experimenting with the <a href="http://beronet.com/">Beronet</a> <a href="https://shop.beronet.com/product_info.php/cPath/56/products_id/159">bero*fos</a> failover switch. I need this for a project where two redundant asterisks should be switched by the <a href="https://shop.beronet.com/product_info.php/cPath/56/products_id/159">bero*fos</a>.<br />
To get the following into proportion: I&#8217;m a customer of Beronet and usually like their products. But selling a device for around 700.- Euro we should expect working firmware and working configuration software. Especially since the device sits at a crucial point from a safety point of view: it&#8217;s used in scenarios where we want failover capabilities for telephone equipment.<br />
The config-software is open source, so we can work around it&#8217;s shortcomings. But there is a firmware bug, setting some configuration variables via web interface has side-effects on other configuration variables. (we can work around that by writing our own config program). So I&#8217;d really like a more open design here: I&#8217;m voting for open firmware and a hardware documentation. But that might lead to others building the device for less money&#8230;<br />
I would also prefer a documentation of the parameter interface in addition to (or instead of) a configuration program. Integrating the device into other infrastructures where we don&#8217;t want a binary configuration program requires reverse-engineering. I&#8217;ve done that in the following.<br />
In the following I&#8217;m referring to berofos Firmware 1.3.3 which is the latest on Beronets webpage and in my device. The berofos tools for Linux on the webpage were apparently last updated in December 2007 and don&#8217;t have a version number.<br />
The device has four groups of 4 ports each, A, B, C, D. These can be switched in two scenarios, a <em>fallback</em> scenario, which can connect A-B or A-D and a <em>bypass</em> scenario which can connect A-B and C-D or A-D. The first scenario is useful if there are redundant devices where one device can replace another (e.g. as in our scenario with two asterisk boxes), the second scenario is useful when you have an asterisk connected in between the telephone network and an old PBX. In case the asterisk fails, the PBX can be directly connected to the telephone network.<br />
I won&#8217;t rehash the features and documentation of the device here, the <a href="http://www.beronet.com/component/option,com_remository/Itemid,38/func,selectcat/cat,5/">berofos docs and tools</a> page has a link to the manual (and to the command-line tool for both, Linux and Windows).<br />
The device has a web-interface and a command-line interface written in C under the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GPL version 2</a> license without a version-upgrade clause. The individual source files refer to a LICENSE file which isn&#8217;t included in the distribution.<br />
The web interface has several bugs, some changes of config variables will change variables in other configuration pages. A notable example is the <em>defaults</em> page. In this page the default state of the relais can be set. When changing anything on that page, the device will also change the scenario to <em>bypass</em>.<br />
Worse, when changing the mailserver page (the device is able to notify you via email if something bad happens) the dhcp setting is reset. This means on next powerup the device probably won&#8217;t try to get it&#8217;s ip via dhcp but use whatever happens to be the currently configured IP address. I didn&#8217;t try to reboot the device in this state because I noticed (and was looking for) this side-effect because I was already searching for a pattern in the failures.<br />
Getting the config is easy, it&#8217;s under the url <code>http://fos/config.txt</code> where fos is the device. The following text file is retrieved:</p>
<pre>
bnfos_confmap_magic=0.1
1_sz=0
4_mode=0
1_rm=checked
5_p0=0
1_p0=
5_p1=0
1_p1=
3_dn=
3_ip=10.23.5.100
3_nm=255.255.255.0
3_gw=10.23.5.254
3_dns=10.23.5.254
3_dhcp=checked
3_port=80
3_pwd=
2_mhost=0.0.0.0
2_mfrom=
2_mto=
3_log=
3_loghost=0.0.0.0
6_wen=0
2_wen=
6_wstate=0
2_wintv=60
2_as=checked
2_men=
0_wretv=0
</pre>
<p>Apparently all configuration variables that influence other variables are in the same group: They have the same number in front.<br />
The bugs of the web interface are not browser-specific. In fact the command-line tools also use the http-interface of the device to set and get options:
<pre>
% bnfos/bnfos --get scenario -h 10.23.5.100
scenario = 0
zsh: exit 167   bnfos/bnfos --get scenario -h 10.23.5.100
% bnfos/bnfos --set modedef=0 -h 10.23.5.100
Setting modedef succeeded!
% bnfos/bnfos --get scenario -h 10.23.5.100
scenario = 1
zsh: exit 167   bnfos/bnfos --get scenario -h 10.23.5.100
</pre>
<p>Exit-code of the bnfos tool when querying a variable is always 167. It also doesn&#8217;t follow the UNIX mantra for command-line tools: Be silent on success, noisy on error. But we also see here that the bug appears with the command-line tool too: changing the default relais mode also changed the scenario.<br />
When looking with wireshark we see that for setting the variable with the command-line tool it just retrieved the URL <code>/?cmd=1&amp;rm=0</code> with a HTTP Get-request.<br />
When using the <code>--show</code> switch, output is on <code>stderr</code> so piping the result needs special shell commands ( <code>|&amp;</code> is a zsh shortcut for piping both, <code>stdout</code> and <code>stderr</code>):</p>
<pre>
% bnfos/bnfos --show -h 10.23.5.100 |&amp; grep dhcp
 dhcp      = 1
zsh: exit 167   bnfos/bnfos --show -h 10.23.5.100 2&gt;&amp;1 |
</pre>
<p>Setting the mail parameters <code>smtpserv</code>, <code>smtpfrom</code> and <code>smtpto</code> is impossible via the command-line interface. We always the the cryptic error message:</p>
<pre>
% bnfos/bnfos --set smtpto='10.23.5.5' -h 10.23.5.100
Setting smtpto failed: Could not parse!
zsh: exit 1     bnfos/bnfos --set smtpto='10.23.5.5' -h 10.23.5.100
</pre>
<p>Studying the code of the config-tool reveals that there are two configuration tables, one in <code>src/beronet/confmap_fos.h</code> named <code>bnfos_confmap</code> which includes all info about the low-level device parameters:</p>
<pre>
static const struct {
  char *key;
  char type;
  int cmd;
  char *parm;
  char *macro;
} bnfos_confmap[BNFOS_MAX_KEYS] = {
  { "sz"     , 'b', 1, "sz=%s"    , "szenario(0)"},
  { "mode"   , 'b', 4, "mode=%s"  , "mode(0)"},
  { "rm"     , 'b', 1, "rm=%s"    , "config(1,1)"},

  { "p0"     , 'b', 5, "p=0&amp;s=%s" , "pwrport(0,0)"},
  { "p0"     , 'b', 1, "p0=%s"    , "config(2,1)"},
  { "p1"     , 'b', 5, "p=1&amp;s=%s" , "pwrport(0,1)"},
  { "p1"     , 'b', 1, "p1=%s"    , "config(3,1)"},

  { "dn"     , 'h', 3, "dn=%s"    , "hostname(1)"},
  { "ip"     , 'a', 3, "ip=%s"    , "netconf(0)"},
  { "nm"     , 'a', 3, "nm=%s"    , "netconf(1)"},
  { "gw"     , 'a', 3, "gw=%s"    , "netconf(2)"},
  { "dns"    , 'a', 3, "dns=%s"   , "netconf(3)"},
  { "dhcp"   , 'b', 3, "dhcp=%s"  , "config(4,1)"},
  { "port"   , 'p', 3, "port=%s"  , "netconf(6)"},
  { "pwd"    , 'b', 3, "pwd=%s"   , "config(5,1)"},
  { "apwd"   , 'd', 3, "apwd=%s"  , NULL},

  { "mhost"  , 's', 2, "mhost=%s" , "netconf(5)"},
  { "mfrom"  , 's', 2, "mfrom=%s" , "netconf(7)"},
  { "mto"    , 's', 2, "mto=%s"   , "netconf(8)"},
  { "XXXXX"  , 'n', 7, ""         , NULL},

  { "log"    , 'b', 3, "syslog=%s", "config(10,1)"},
  { "loghost", 'a', 3, "slgip=%s" , "netconf(9)"},
  { "logport", 'p', 3, "slgpt=%s" , "netconf(10)"},

  { "wen"    , 'b', 6, "wen=%s"   , "wdog(0)"},
  { "wen"    , 'b', 2, "wen=%s"   , "config(6,1)"},
  { "wstate" ,   0, 6, "wstate=%s", "wdog(0)"},
  { "wintv"  , 'p', 2, "wintv=%s" , "config(8,?)"},
  { "as"     , 'b', 2, "as=%s"    , "config(9,1)"},
  { "men"    , 'b', 2, "men=%s"   , "config(7,1)"},
  { "wretv"  ,   0, 0, NULL       , "wdog(2)"},
};
</pre>
<p>and one in <code>bnfos/main.c</code> that maps the high-level command-line paramters to the low-level http requests:</p>
<pre>
/* keyword description for --set / --get */
static struct {
  char *keyword;
  char *descr;
} keys[BNFOS_MAX_KEYS] = {
  {"scenario", "scenario (0=fallback; 1=bypass)"},

  {"mode", "relais mode (0=A--D; 1=A--B or A--B,C--D)"},
  {"modedef", "default relais mode (0=A--D; 1=A--B or A--B,C--D)"},

  {"power1", "state of powerport 1 (0=off; 1=on)"},
  {"power1def", "default state of powerport 1 (0=off; 1=on)"},
  {"power2", "state of powerport 2 (0=off; 1=on)"},
  {"power2def", "default state of powerport 2 (0=off; 1=on)"},

  {"hostname", "device hostname"},

  {"address", "ip address"},
  {"netmask", "netmask address"},
  {"gateway", "gateway address"},
  {"dns", "dns server address"},
  {"dhcp", "query dhcp server (0=off; 1=on)"},
  {"port", "http listen port"},
  {"pwd", "http password protection (0=off; 1=on)"},
  {"apwd", "admin password"},

  {"smtpserv", "smtp server"},
  {"smtpfrom", "smtp sender address"},
  {"smtpto", "smtp destination address"},
  {"smtptest", "trigger testmail"},

  {"syslog", "syslog logging (0=off; 1=on)"},
  {"slgip", "syslog server ip"},
  {"slgpt", "syslog server port"},
  {"wdog", "watchdog enable (0=off; 1=on)"},
  {"wdogdef", "default watchdog enable (0=off; 1=on)"},
  {"wdogstate", "watchdog state (0=off; 1=on; 2=failure)"},
  {"wdogitime", "watchdog intervall time"},
  {"wdogaudio", "watchdog audio alarm (0=off; 1=on)"},
  {"wdogmail", "watchdog alarm mails (0=off; 1=on)"},
  {"wdogrtime", "watchdog remaining time to failure"},
};
</pre>
<p>I haven&#8217;t found a mechanism that keeps these two tables in different source files in sync (they currently seem to be), looks like both tables need to have the matching options in the same place in both tables. The code for matching options to low-level commands just uses the same index to navigate in both tables.<br />
The <code>bnfos_confmap</code> table has a <code>s</code> for the type of the smtp parameters. This type isn&#8217;t handled in the config-tool and leads to the cryptic error message above. Patching the table to specify the type <code>h</code> (there is a comment <code>XXX check hostname for validy</code> for that type this checking apparently isn&#8217;t done yet, so we can use the code there to parse normal strings) would work. After applying a patch to <code>src/beronet/confmap_fos.h</code>, the sources aren&#8217;t recompiled, seems that the Makefile is broken, too. So after a <code>make clean ; make</code> I&#8217;m finally able to set the smtp parameters via the command-line interface:</p>
<pre>
% bnfos/bnfos --set smtpserv='10.23.5.5' -h 10.23.5.100
Setting smtpserv succeeded!
</pre>
<p>Looking over this again, I prefer to do the following patch that adds support for the &#8217;s&#8217; type:</p>
<pre>
--- bntools/src/bnfos.c 2007-08-28 09:27:46.000000000 +0200
+++ bntools.hacked/src/bnfos.c  2009-04-09 12:10:46.000000000 +0200
@@ -379,6 +379,14 @@
     set-&gt;val = strdup(val);
     return BNFOS_RET_OK;

+  case 's':
+    /* Allow empty strings */
+    if (!val) {
+        val = "";
+    }
+    set-&gt;val = strdup(val);
+    return BNFOS_RET_OK;
+
   case 'p':
     {
       int v;
</pre>
<p>This is a cleaner way to make configuring the smtp parameters work. Turns out that setting the mail gw does <em>not</em> influence the dhcp setting. But in the web-interface, the mail gateway and the syslog server are combined in one page. so trying that:</p>
<pre>
% bnfos/bnfos --show -h 10.23.5.100 |&amp; grep dhcp
 dhcp      = 1
zsh: exit 167   bnfos/bnfos --show -h 10.23.5.100 2&gt;&amp;1 |
zsh: done       grep dhcp
% bnfos/bnfos --set slgip='10.23.5.5' -h 10.23.5.100
Setting slgip succeeded!
% bnfos/bnfos --show -h 10.23.5.100 |&amp; grep dhcp
 dhcp      = 0
zsh: exit 167   bnfos/bnfos --show -h 10.23.5.100 2&gt;&amp;1 |
zsh: done       grep dhcp
</pre>
<p>we see that changing the syslog server also changes the dhcp setting like in the web-interface. When looking more closely, we see that the dhcp and the syslog IP are in the same <code>cmd</code> group. Thats the number in column 3 of the <code>bnfos_confmap</code> and the number in from of each line in <code>config.txt</code> retrieved via the web interface.<br />
So the workaround for the bug in the firmware is to write a config program that retrieves all variables in the same <code>cmd</code> group and, when setting one of the variables in that group, also send all the other current settings in the same get-request.<br />
Fortunately the <code>bnfos_confmap</code> table has the command pattern for generating the get-request for each of the variables in column 4 (<code>parm</code>). So it shouldn&#8217;t be too hard to write a new config utility (and of course I won&#8217;t do that i C either) that works around the firmware bugs.<br />
I already said that I would have preferred an open firmware to fix the bugs at the source, did I?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.runtux.com/2009/04/09/81/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto get Asterisk with mISDN V2 and Linux Call Router running on debian lenny</title>
		<link>http://blog.runtux.com/2009/03/09/61/</link>
		<comments>http://blog.runtux.com/2009/03/09/61/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 15:13:29 +0000</pubDate>
		<dc:creator>Ralf Schlatterbeck</dc:creator>
				<category><![CDATA[asterisk]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://blog.runtux.com/?p=61</guid>
		<description><![CDATA[Update 2009-03-31: provide signed archive with archive key, add udev rules, add /etc/modules entries, add amd64.
Update 2009-04-05: typos fixed
This is a short howto how I built the debian patches and how you can &#8212; as a user &#8212; install everything needed for mISDN version 2 and Linux Call Router (LCR) with asterisk chan_lcr running on [...]]]></description>
			<content:encoded><![CDATA[<p>Update 2009-03-31: provide signed archive with archive key, add udev rules, add <code>/etc/modules</code> entries, add amd64.<br />
Update 2009-04-05: typos fixed</p>
<p>This is a short howto how I built the debian patches and how you can &#8212; as a user &#8212; install everything needed for mISDN version 2 and Linux Call Router (LCR) with asterisk chan_lcr running on debian lenny.</p>
<p>I&#8217;m providing debian packages for Kernel (v 2.6.28.5), an updated zaptel (debian lenny zaptel doesn&#8217;t compile with newer kernels and zaptel wctdm uses some settings for analogue phones that don&#8217;t work with german and austrian phone like the &#8220;R&#8221;-key or optional pulse dialling), finally I&#8217;m providing a slightly patched asterisk for larger buffer sizes when playing long tones, LCR and misdnv2user packages originally built by Joerg Dorchain. My misdnv2user is the same as Joergs. The lcr package contains my bug-fix for DTMF digits A-F (also in Joergs packages now) which don&#8217;t work in upstream LCR version 1.3 and an updated <code>/etc/init.d/lcr</code> for querying the status of lcr.</p>
<p>I&#8217;m also providing source packages, except for the kernel &#8212; the kernel is stock kernel.org 2.6.28.5 configured for use of mISDN. The kernel was built using debians make-kpkg from the <code>kernel-package</code> debian package. And the config used for building the kernel is in the binary package.</p>
<p>I hope I can contribute something in order to get mISDN V2 and LCR into debian&#8230; in the meantime others may want to uses these on debian stable.</p>
<p><b>Installation</b></p>
<pre>
apt-get install vim less ssh ntp
apt-get install python-dev openbsd-inetd postfix madplay
</pre>
<p>Add following lines to /etc/apt/sources.list:</p>
<pre>
deb http://project.runtux.com/asterisk/debian/ lenny main
deb-src http://project.runtux.com/asterisk/debian/ lenny main
</pre>
<p>If you want to avoid warnings about an untrusted archive key from <code>apt</code>, you should import the following archive key. Save the key to a file and then issue the command<br />
<code>apt-key add file</code></p>
<pre>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (GNU/Linux)

mQENBEnREAIBCADM8+KpoC/HJUCEsx8KZhGgsX/G3ouR4/xkgIuIPgz+t6JoTisj
9QmymDZKUXSy04WmbLjU/088xD5A9ukOEYxoFCGqwWf1tPOKqN1oKpVCkjJb8Dht
vvebqOCzJSV0nfqmIfkpbX+6dUssx+9u0BiFK3aj/GilkEloZl2g+vIT6fveJtKE
qmxz19vL516TDhsbsv3/AKfNKc7QRpsgvPmnNE2IL0CTgQYs26WtnJASlu1MQpwo
Qfb1PrO7ufq9eO58HjEBdfbSNjalQjVj7vLvE4GQglHULO500H9UlfOm2zpO0Vzs
5lGGbwLJdTpAS3HIRhQAW0pueRsQ8zagMn5lABEBAAG0OFJhbGYgU2NobGF0dGVy
YmVjayAoRGViaWFuLVBhY2thZ2UtS2V5KSA8cnNjQHJ1bnR1eC5jb20+iQE2BBMB
AgAgBQJJ0RACAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ5CizCR9G97ah
pAf/eLRYtPVs1apI3+AVi//8y1/r6uL+IxI/Tlt53jCtX/dy3Q3FeAEJt/7fbvcW
TBDnP5K8vWaYUlHHaz+6lbcQyV/KAH4LKJEKkyoINc9ytG1qEG6z8NPfDmKiEluy
HksgLpAqUBrdZy46iWQhcg7f3fpcUIsHHcXrOd2Ip5G9DL2q4/UoRrhBhHC3GNX7
ERaeAKZTF1JRaVN6KSWPC2+yaNmuGn1yoSChG0Q/bBTgzv2fm9Jzvok546f9LE0q
k2q5PvjlUSMGHHojTzzR6tGhnbw5mOfyMUDDs5LuAN1aWbDatepJgiC+dYasprQ5
pZygpoCASqIhWjjCZd3XI5mAEIhGBBARAgAGBQJJ0nZlAAoJEIO0FkDz/lcw0xYA
njBSGef/4KhZpuspIh6WnLM7ORKNAKCw28et9bUoaGu4ESRpIwtwj4asQoicBBAB
AgAGBQJJ0ncuAAoJEJWCQpSoBzk1hpcD/2KXiuvE2Nm0oOi0jBVEjT/Tu/GGkG5m
lf97/I6TMcJxlMpeBlv9SiJD+/BBQo0MGMxmkCwU4t+eBCBsCVcr/bJnrlrKa4Ab
9SR9WQ8PGrSQ+AwMePCDKngqFd5EERz8bxz4sZKGCxn9JVRQOGp03eKSGDG/Yh0v
FY3v7nV0BUaE
=mPtt
-----END PGP PUBLIC KEY BLOCK-----
</pre>
<p>Then install:</p>
<pre>
apt-get update
apt-get install linux-headers-2.6.28.5-i686 linux-image-2.6.28.5-i686 \
    asterisk zaptel lcr zaptel-modules-2.6.28.5-i686
</pre>
<p>If you&#8217;re on the amd64 architecture, you should replace i686 in the packages above with amd64.</p>
<p>and optionally (for <code>misdn_info</code>):</p>
<pre>
apt-get install misdnv2user
</pre>
<p>Edit <tt><span class="pre">/etc/default/asterisk</span></tt> and set <tt><span class="pre">RUNASTERISK=yes</span></tt>. Then make several directories (should be done by a future version of the lcr package):</p>
<pre>
mkdir /var/run/lcr
chown asterisk.asterisk /var/run/lcr
mkdir /var/log/lcr
chown asterisk.asterisk /var/log/lcr
</pre>
<p>I&#8217;ve also made a start-script for lcr (for use as <tt><span class="pre">/etc/init.d/lcr</span></tt>) ,<br />
downloadable at <a class="reference external" href="http://project.runtux.com/asterisk/init.d:lcr">http://project.runtux.com/asterisk/init.d:lcr</a><br />
this probably should also be part of the lcr package.</p>
<p>Config file examples used for lcr &#8212; these pass<br />
everything to asterisk. File <tt><span class="pre">/etc/lcr/interface.conf</span></tt>:</p>
<pre>
[Ext1]
portnum 0
ptp
nodtmf

[Ext2]
portnum 1
ptp
nodtmf

[Int1]
portnum 2
nt
ptp
nodtmf

[Int2]
portnum 3
nt
ptp
nodtmf
</pre>
<p>I&#8217;m using a Beronet 4 port ISDN card, your config will probably differ: This system only expects <em>incoming</em> calls and needs to check on which line a call comes in. So I distinguish all external interfaces as separate interfaces of LCR. I also need to check an interface by calling out via that interface, you probably would want to make all external ports a trunk by grouping them into one LCR interface.</p>
<p>And the routing config needs to match your interface definition. This config will pass all calls &#8212; if asterisk is running &#8212; to asterisk. If asterisk isn&#8217;t running, I&#8217;m calling a test application (untested). The context in asterisk will be the interface name. Again, if you&#8217;re using a trunk here, be sure to match the routing config with your interface config. <tt><span class="pre">/etc/lcr/routing.conf</span></tt>:</p>
<pre>
[main]
remote=asterisk interface=Ext1 : remote application=asterisk
remote=asterisk interface=Ext2 : remote application=asterisk
remote=asterisk interface=Int1 : remote application=asterisk
remote=asterisk interface=Int2 : remote application=asterisk
default                        : efi
</pre>
<p>Update <code>/etc/modules</code> to include the following lines (the command appends the lines between <code>cat</code> and <code>EOF</code>):</p>
<pre>
cat &gt;&gt; /etc/modules &lt;&lt; EOF
mISDN_core debug=0x0
mISDN_dsp debug=0x0 options=0x0
hfcmulti debug=0x0
EOF
</pre>
<p>Linux udev must be configured to correctly set the user for the isdn device(s):</p>
<pre>
cat &gt; /etc/udev/rules.d/91-isdn.rules &lt;&lt; EOF
ACTION!="add|change", GOTO="permissions_end"

KERNEL=="mISDN*",       GROUP="dialout"

LABEL="permissions_end"
EOF
</pre>
<p>After a reboot asterisk and lcr should be running.</p>
<p><b>Building</b></p>
<p>Getting kernel:</p>
<pre>
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.28.tar.bz2.sign
wget http://kernel.org/pub/linux/kernel/v2.6/patch-2.6.28.5.gz
wget http://kernel.org/pub/linux/kernel/v2.6/patch-2.6.28.5.gz.sign
</pre>
<p>For compilation (zlib isn&#8217;t checked by make-kpkg!):</p>
<pre>
apt-get install kernel-package bzip2 libncurses5-dev zaptel-source \
    zlib1g-dev fakeroot
</pre>
<p>Compile Kernel:</p>
<pre>
tar xvf linux-2.6.28.tar.bz2
cd linux-2.6.28
zcat ../patch-2.6.28.5.gz | patch -N -p1 | less 2&gt;&amp;1
cp /boot/config-2.6.28.5-i686 .config
make oldconfig
make menuconfig # just to be sure
</pre>
<p>For amd64:</p>
<pre>
make-kpkg --append-to-version -amd64 --revision 2.6.28.5.1.rsc --us \
    --uc --initrd --rootcmd fakeroot binary &gt; m.out 2&gt; m.err
</pre>
<p>For i686:</p>
<pre>
make-kpkg --append-to-version -i686 --revision 2.6.28.5.1.rsc --us \
    --uc --initrd --rootcmd fakeroot binary &gt; m.out 2&gt; m.err
</pre>
<p>The following doesn&#8217;t seem to work although zaptel is installed:<br />
probably need to unpack <tt><span class="pre">/usr/src/zaptel.tar.bz2</span></tt> into<br />
<tt><span class="pre">/usr/src/modules/zaptel</span></tt> (tar file contains modules directory!)<br />
this would save us from the <tt><span class="pre">m-a</span> <span class="pre">a-i</span></tt> step below. amd64:</p>
<pre>
make-kpkg --append-to-version -amd64 --revision 2.6.28.5.1.rsc --us \
    --uc --initrd --rootcmd fakeroot modules &gt; mo.out 2&gt; mo.err
cd ..
</pre>
<p>For i686:</p>
<pre>
make-kpkg --append-to-version -i686 --revision 2.6.28.5.1.rsc --us \
    --uc --initrd --rootcmd fakeroot modules &gt; mo.out 2&gt; mo.err
cd ..
</pre>
<p>Make a debianized zaptel for new kernel:</p>
<pre>
apt-get install devscripts libnewt-dev quilt libusb-dev asciidoc
svn checkout http://svn.digium.com/svn/zaptel/branches/1.4 zaptel
apt-get source zaptel-source
cp zaptel/kernel/ztdummy.* zaptel-1.4.11~dfsg/kernel
cd zaptel-1.4.11~dfsg
# Add &quot;Fix compilation for newer kernels&quot;
dch -i
dpkg-buildpackage
cd ..
dpkg -i zaptel-source_1.4.11~dfsg-3.1_all.deb
m-a a-i zaptel
</pre>
<p>The following installs my patched asterisk, I&#8217;m modifying some buffer sizes because I want to play long tones (I&#8217;m generating a faked modem guard-tone that is needed in a project). You probably won&#8217;t need the patches asterisk, but it won&#8217;t hurt to install it. The <tt><span class="pre">create-patches</span></tt> script is available from<br />
<a class="reference external" href="http://project.runtux.com/asterisk/create-patches">http://project.runtux.com/asterisk/create-patches</a></p>
<pre>
apt-get install libreadline5-dev libgsm1-dev libssl-dev libtonezone-dev \
    libvpb-dev autotools-dev libsqlite-dev libspeex-dev libspeexdsp-dev \
    graphviz libcurl4-openssl-dev doxygen libpopt-dev libopenh323-dev   \
    libiksemel-dev libradiusclient-ng-dev freetds-dev libvorbis-dev     \
    libsnmp-dev libc-client2007b-dev libcap2-dev libpq-dev unixodbc-dev \
    libpri-dev
apt-get source asterisk
scp ralf&#64;bee:checkout/own/config/asterisk/create-patches .
cd asterisk-1.4.21.2~dfsg/
sh ../create-patches
# Hunk #1 succeeded at 25 (offset 3 lines).
# Add &quot;runtux.com local buffer-size patches&quot;
# and new version-number 1:1.4.21.2.1~dfsg-3
dch -i # add comment
dpkg-buildpackage -rfakeroot
cd ..
</pre>
<p>For mISDNuser and chan_lcr I&#8217;m using <a class="reference external" href="http://listserv.isdn4linux.de/pipermail/isdn4linux/2009-February/003846.html">Joerg Dorchains packages</a> with my added patches for DTMF codes A-F.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.runtux.com/2009/03/09/61/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
