<?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 May 2009</title>
		<description>Entries from May 2009</description>
                <link>../../../</link>

	
	<item>
		<title>Perl example code for GTH: SS7 ISUP decoding and playback/record</title>
		<link>../../../Perl_example_code_for_GTH__SS7_ISUP_decoding_and_playback_record.html</link>        
		<guid isPermaLink="true">../../../Perl_example_code_for_GTH__SS7_ISUP_decoding_and_playback_record.html</guid>
                <pubDate>Thu, 28 May 2009 23:25:45 +0200</pubDate>
		<description>&lt;p&gt;
To help people get started, www.corelatus.com has some example code
for doing useful things with GTH units.
&lt;/p&gt;

&lt;p&gt;
Now it also has Perl example code. It does the same thing as the
python examples:
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Enable an E1/T1 port
  &lt;/li&gt;&lt;li&gt;Start MTP-2 monitoring on a timeslot and decode SS7 ISUP (to print out when calls start and stop). I wrote a post a while back about &lt;a href=&quot;http://blog.corelatus.com/2009/03/25/decoding-mtp-3-and-isup/&quot;&gt;how to decode ISUP&lt;/a&gt;.
  &lt;/li&gt;&lt;li&gt;Dump the contents of a timeslot to a file (for later analysis)
  &lt;/li&gt;&lt;li&gt;Feed a file into a timeslot (for playback of previously captured files)
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt; It&#39;s built on top of a Perl module which provides a Perl API for a
subset of the &lt;a href=&quot;http://www.corelatus.com/gth/api/&quot;&gt;GTH API&lt;/a&gt;.
&lt;/p&gt;

&lt;h3&gt;A quick example&lt;/h3&gt;

&lt;p&gt; Here&#39;s a quick example of how it&#39;s used. We want to enable (turn
on) the first E1/T1 interface on a GTH module: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
&lt;span class=&quot;synStatement&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;$api&lt;/span&gt; = gth_control-&amp;gt;new(&lt;span class=&quot;synIdentifier&quot;&gt;$host&lt;/span&gt;);
&lt;span class=&quot;synIdentifier&quot;&gt;$api-&amp;gt;send&lt;/span&gt;(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;&amp;lt;set name=&#39;pcm&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;$span&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;&#39;&amp;gt;&amp;lt;attribute name=&#39;mode&#39; value=&#39;E1&#39;/&amp;gt;&amp;lt;/set&amp;gt;&amp;quot;&lt;/span&gt;);
&lt;span class=&quot;synStatement&quot;&gt;defined&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;$api-&amp;gt;next_non_event&lt;/span&gt;()-&amp;gt;{ok} || &lt;span class=&quot;synStatement&quot;&gt;die&lt;/span&gt;(&lt;span class=&quot;synConstant&quot;&gt;&amp;quot;error from GTH (bogus PCM?)&amp;quot;&lt;/span&gt;);
&lt;span class=&quot;synIdentifier&quot;&gt;$api-&amp;gt;bye&lt;/span&gt;();
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;It&#39;s good for experimenting.&lt;/h3&gt;

&lt;p&gt; The Perl module the examples are based on, gth_control.pm, is at
a level which makes it useful for experiments and prototypes. To build
a full-fledged product on top of it, more work is needed.
&lt;/p&gt;

&lt;p&gt; For a start, you&#39;d probably want to move the XML generation (like
the &#39;&amp;lt;set name=...&#39; code above) out of the application code and
into the gth_control.pm module, thus making it a pure Perl interface.
&lt;/p&gt;

&lt;p&gt;
Next, you need to come up with a strategy to deal with concurrency, because being limited to recording one timeslot at a time is fine for lab work, but not fine for (say) a voicemail system.
&lt;/p&gt;

&lt;h3&gt;Download&lt;/h3&gt;

&lt;p&gt;
The zipfile of the code is linked from the bottom of the &lt;a
href=&quot;http://www.corelatus.com/gth/api/&quot;&gt;API page&lt;/a&gt;.
&lt;/p&gt;
</description>
	</item>
	
        </channel>
</rss>

