<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
	<channel>
		<title>The Corelatus Blog - Entries from January 2010</title>
		<description>Entries from January 2010</description>
                <link>../../../</link>

	
	<item>
		<title>New blog software</title>
		<link>../../../New_blog_software.html</link>        
		<guid isPermaLink="true">../../../New_blog_software.html</guid>
                <pubDate>Tue, 19 Jan 2010 16:16:21 GMT</pubDate>
		<description>&lt;p&gt; This blog now uses
&lt;a href=&#39;http://steve.org.uk/Software/chronicle&#39;&gt;chronicle&lt;/a&gt; to
compile the blog.
&lt;/p&gt;

&lt;p&gt;Before, I used Wordpress. Wordpress is OK and mostly &#39;just works&#39;.
But, after a year, I wanted something which followed my normal
workflow, i.e. edit-compile-test-checkin-publish. It&#39;s easier for me
to write posts in emacs, build the blog with a Makefile,
version-control with git and publish via scp.
&lt;/p&gt;

&lt;p&gt;I&#39;ve made all comments go
via &lt;a href=&#39;mailto:matthias@corelatus.com?subject=blog%20comment&#39;&gt;mail&lt;/a&gt;,
comment spam was getting overwhelming.
&lt;/p&gt;
</description>
	</item>
	
	<item>
		<title>GTH &#39;C&#39; API</title>
		<link>../../../GTH__C__API.html</link>        
		<guid isPermaLink="true">../../../GTH__C__API.html</guid>
                <pubDate>Wed, 20 Jan 2010 10:47:37 GMT</pubDate>
		<description>&lt;p&gt; 
This post is for people who want to use C to control a GTH. Other
languages (e.g. Erlang, Java, Python and Perl) are easier to work
with, but in some applications you want the complete control that C
gives you. 
&lt;/p&gt;

&lt;p&gt;
Corelatus provides a &lt;a href=&quot;http://www.corelatus.com/gth/api/gth_c_examples.zip&quot;&gt;
C API for GTH&lt;/a&gt;. The C API lets you control a GTH using plain C function
calls---all of the XML wire format is taken care of.
&lt;/p&gt;

&lt;p&gt;Here&#39;s an example of how to use it to record speech
on an E1/T1 timeslot, something you&#39;d typically do in a voicemail system:
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
&lt;span class=&quot;synPreProc&quot;&gt;#include &lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;gth_apilib.h&amp;quot;&lt;/span&gt;
...

  GTH_api api;                     &lt;span class=&quot;synComment&quot;&gt;// GTH_api represents one GTH API connection&lt;/span&gt;
  &lt;span class=&quot;synType&quot;&gt;int&lt;/span&gt; result;
  &lt;span class=&quot;synType&quot;&gt;int&lt;/span&gt; data_socket;
  &lt;span class=&quot;synType&quot;&gt;char&lt;/span&gt; buffer[&lt;span class=&quot;synConstant&quot;&gt;2000&lt;/span&gt;];
  &lt;span class=&quot;synType&quot;&gt;char&lt;/span&gt; job_id[MAX_JOB_ID];
  &lt;span class=&quot;synType&quot;&gt;int&lt;/span&gt; octet_count;

  result = gth_connect(&amp;amp;api, &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;172.16.1.10&amp;quot;&lt;/span&gt;);    &lt;span class=&quot;synComment&quot;&gt;// Assuming the default GTH IP &lt;/span&gt;
  assert(result == &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;);

  &lt;span class=&quot;synComment&quot;&gt;// We want to record audio on the E1/T1 called &amp;quot;1A&amp;quot;, on timeslot 3.&lt;/span&gt;
  data_socket = gth_new_recorder(api, &lt;span class=&quot;synConstant&quot;&gt;&amp;quot;1A&amp;quot;&lt;/span&gt;, &lt;span class=&quot;synConstant&quot;&gt;3&lt;/span&gt;, job_id);

  &lt;span class=&quot;synStatement&quot;&gt;while&lt;/span&gt; ( (octet_count = recv(data_socket, buffer, &lt;span class=&quot;synStatement&quot;&gt;sizeof&lt;/span&gt; buffer, &lt;span class=&quot;synConstant&quot;&gt;0&lt;/span&gt;)) ) {
    &lt;span class=&quot;synComment&quot;&gt;// do whatever you want with the received data&lt;/span&gt;
  }

...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
The recording above happens in the &#39;while&#39; loop. It continues forever
(i.e. until you abort it). The audio data is bit-for-bit identical to
what was on the E1/T1 timeslot, so this can be used for recording both
voice and signalling.
&lt;/p&gt;

&lt;h3&gt;Further examples&lt;/h3&gt;

&lt;p&gt;The C API code includes further examples to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Record audio or signalling from a timeslot to a .wav file&lt;/li&gt;
  &lt;li&gt;Play back previously recorded files&lt;/li&gt;
  &lt;li&gt;Install (upgrade) the firmware on a GTH&lt;/li&gt;
  &lt;li&gt;Monitor (sniff) SS7 MTP-2 and save the signalling to a wireshark
    (PCAP) compatible file.&lt;/li&gt;
  &lt;li&gt;Monitor CAS R2 signalling.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Standalone Parser&lt;/h3&gt;

&lt;p&gt;Aside: the C API code includes a standalone parser for the XML
responses the GTH emits. You can use the parser without using the
rest of the API library, if you want to.
&lt;/p&gt;
</description>
	</item>
	
        </channel>
</rss>

