Probes

Duplex

API

Company Information

Site Map

Contact

News

The GTH API

The GTH is controlled via a TCP socket using an XML language. Here is an example of how to enable MTP-2 monitoring on a timeslot:

    <new>
       <mtp2_monitor ip_addr='128.250.22.3' ip_port='2453'>
          <pcm_source span='2' timeslot='16'/>
       </mtp2_monitor>
    </new>

The API is just a text protocol over a TCP socket, so it is programming language and OS neutral. If a system can open a socket, it can control the GTH. We have used Java, C, C++, Python, Perl, BASH scripts and Erlang to control the GTH, on machines running Linux, Solaris, *BSD, MacOSX and Windows NT-2K-XP-Vista.

Specification

API Specification (PDF)
DTD for commands
DTD for responses

Example code: audio loopback

A bare bones example which shows how to set up audio loopback on one timeslot of a PCM, written in three different languages:

Java
Perl
Erlang

Example code: java XML parser interface

A Java package which includes an interface to the Xerces XML parser. Xerces is included in JDK 1.4, which is available from Sun. The sample code includes a tool to upgrade the software on the GTH.

XML Tool (source)
XML Tool (precompiled)

Example code: C

Examples in plain C to

gth_c_examples.zip

Example code: erlang

This example includes a feature-complete wrapper, gth.erl, for the GTH API, i.e. all of the GTH's features are available through an erlang interface. Here's how you start MTP-2 monitoring with it:

     41> {ok, A} = gth:start_link("172.16.2.7").
         {ok,<0.188.0>}
     42> {ok, ID, Socket} = gth:new_mtp2_monitor(A, "1A", 16).
         {ok,"m2mo21",#Port<0.2261>}
  

Apart from the wrapper, there's an Erlang implementation of

gth_erlang_api.zip

Example code: python

The python example code package contains

The examples are built on top of a small-ish GTH API wrapper in python, so it's a useful base to build other scripts on.

gth_python_examples.zip

Example code: Perl

The Perl example code package contains the same examples as the Python package (but written in Perl!), along with a partial GTH API wrapper written as a Perl module.

gth_perl_examples.zip