<?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>Armbruster IT Blog &#187; telephone</title>
	<atom:link href="http://blog.armbruster-it.de/tag/telephone/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.armbruster-it.de</link>
	<description>Real world fun with Java, Grails, Groovy, Zope, Plone, Linux and much others.</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:09:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gnome and CTI (computer-telephone-integration)</title>
		<link>http://blog.armbruster-it.de/2009/09/gnome-and-cti-computer-telephone-integration/</link>
		<comments>http://blog.armbruster-it.de/2009/09/gnome-and-cti-computer-telephone-integration/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 11:50:26 +0000</pubDate>
		<dc:creator>Stefan Armbruster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cti]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[telephone]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.armbruster-it.de/?p=8</guid>
		<description><![CDATA[On my desk, there&#8217;s a Siemens Gigaset SX353 connected to the desktop PC via USB. There&#8217;s a nice command line tool for managing the telephone, esp. dialing numbers is possible using
gigacontr --dev /dev/ttyGB0 --dial 1 &#60;number&#62; 10
Unfortunately when passing in a international number with the &#8220;+&#8221; notation, e.g. +49163123456 the phone will not use the [...]]]></description>
			<content:encoded><![CDATA[<p>On my desk, there&#8217;s a Siemens Gigaset SX353 connected to the desktop PC via USB. There&#8217;s a <a href="http://gigaset307x.sourceforge.net/">nice command line tool</a> for managing the telephone, esp. dialing numbers is possible using</p>
<pre>gigacontr --dev /dev/ttyGB0 --dial 1 &lt;number&gt; 10</pre>
<p>Unfortunately when passing in a international number with the &#8220;+&#8221; notation, e.g. <a title="Rufnummernauswahl öffnen" href="callto:+49163123456">+49163123456</a> the phone will not use the &#8220;+&#8221;. This could be easily solved with a small python wrapper script <strong>gigadial.py</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/python</span>
import sys, os
assert len<span style="color: #7a0874; font-weight: bold;">&#40;</span>sys.argv<span style="color: #7a0874; font-weight: bold;">&#41;</span>==<span style="color: #000000;">2</span>
device = <span style="color: #ff0000;">&quot;/dev/ttyGB0&quot;</span>
internal_number = <span style="color: #ff0000;">&quot;10&quot;</span>
<span style="color: #7a0874; font-weight: bold;">command</span> = <span style="color: #ff0000;">&quot;/usr/local/sbin/gigacontr --dev %s --dial 1 %s %s&quot;</span>
number = sys.argv<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
number = number.replace<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;+&quot;</span>, <span style="color: #ff0000;">&quot;00&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">if</span> len<span style="color: #7a0874; font-weight: bold;">&#40;</span>number<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000;">8</span> and number<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>:<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>==<span style="color: #ff0000;">'49'</span>:
	number = <span style="color: #ff0000;">&quot;00%s&quot;</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>number<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">command</span> = <span style="color: #7a0874; font-weight: bold;">command</span> <span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>device, number, internal_number<span style="color: #7a0874; font-weight: bold;">&#41;</span>
os.system<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">command</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Gnome supports configuring a handler for <strong>callto:</strong> URLs. Using gconf-editor modify the setting /desktop/gnome/url-handlers/callto/command must be set to</p>
<pre>&lt;path-to&gt;/gigadial.py %s</pre>
<p>To use Thunderbird&#8217;s addressbook with this, enable in Tool | Additional Settings | Misc the option &#8220;insert callto: link for phonenumbers&#8221;. When viewing contact data, the phone numbers show up as links. When clicking the phone number, the phone dials that number. Cool!</p>
<p>Even cooler: For Firefox, there the wonderful <a href="https://addons.mozilla.org/de/firefox/addon/10654">Telify</a> addon that finds phone number in webpages and converts them to links. Telify must be configured to use <strong>callto:</strong> URLs instead of the default <strong>tel:</strong> URLS.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.armbruster-it.de/2009/09/gnome-and-cti-computer-telephone-integration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
