This is the manual for GNU Gatekeeper 4.8.
A manual for your version is in your GnuGk download archive.
A PDF version can be found in the download section.

Chapters: Contents · Introduction · Installation · Getting started · Basic Config · Routed Mode & Proxy · Routing · RAS Config · Authentication · Accounting · Neighbors · Per Endpoint Config · Advanced Config · Monitoring · Advanced Topics

Download GnuGk    Join the community    Get support

The GNU Gatekeeper Manual Chapter 14

14. Advanced Topics

This portion of the manual will cover advanced topics, such as compiling and debugging the GNU Gatekeeper.

14.1 Compiling GnuGk from Github

The following instructions are an example of how to compile GnuGk from source on an Ubuntu platform.

First make sure your system is up-to-date and install the tools needed for the compile

sudo apt-get update
sudo apt-get install flex bison build-essential git pkg-config automake linuxdoc-tools
Also make sure the "...-devel" packages for all databases or LDAP servers you want to use are installed.

NOTE: It's recommended that you do not use the latest PTLib from SourceForge; it is undergoing many changes that are incompatible with GnuGk. Use our patched version PTLib 2.10.9.

Get and compile PTLib from Github:

cd ~
git clone https://github.com/willamowius/ptlib.git
cd ptlib
export PTLIBDIR=~/ptlib
./configure --enable-ipv6 --disable-odbc --disable-sdl --disable-lua --disable-expat
make optnoshared

Get and compile H323Plus:

cd ~
git clone https://github.com/willamowius/h323plus.git
cd h323plus
export OPENH323DIR=~/h323plus
./configure --enable-h235 -enable-h46017 --enable-h46026
make optnoshared

Get and compile GnuGk:

cd ~
git clone https://github.com/willamowius/gnugk.git
cd gnugk
./configure --enable-h46018 --with-large_fdset=1024
make optnoshared

Once the compile is finished, the binary can be found as

~/gnugk/obj_linux_x86_64_s/gnugk
(assuming you use a 64bit system).

In order to stay up-to-date, run the following:

cd ~/ptlib
git pull
make clean ; make optnoshared
cd ~/h323plus
git pull
make clean ; make optnoshared
cd ~/gnugk
git pull
make clean ; make optnoshared
If any of the source files are changed, you have to recompile.

14.2 Tracing GnuGk

If GnuGk doesn't handle calls like you expect, you can enable tracing to see what GnuGk does internally. This should not be confused with connection to the status port and looking at the events ("telnet 127.0.0.1 7000"). Creating a trace file will reveal a lot more of the internal workings.

On the command line, start GnuGk with -ttttt and -o to write the trace to a file:

gnugk -c gnugk.ini -ttttt -o trace.log

If you have a lot of calls, trace.log can grow quite large, so make sure you disable it after you are done with testing, or at least reduce the trace level to 2 or 3 for production.

You can also enable tracing in your config file:

[Gatekeeper::Main]
TraceLevel=5

[LogFile]
Filename=trace.log

Or you can enable tracing through the status port:

setlog trace.log
debug trc 5

Doing it through the status port has the advantage that you won't interrupt ongoing calls and you can quickly turn it on or off.

The trace file will contain information detailing everything GnuGk does. To reduce it to a single call, you can search for the callID or write a small Perl script to extract only those messages you are interested in.

14.3 Debugging GnuGk (on Linux)

In order to use gdb with GnuGk, the software and libraries must be compiled with debug support.

You may follow the instructions above in obtaining the software, but the compile in each subdirectory must be:

make debugnoshared

Allow unlimited core dumps:

ulimit -c unlimited

Run GnuGk:

~/openh323/obj_linux_x86_64_d_s/gnugk -c your.ini

Then wait for the crash and run GDB to get a stack backtrace:

gdb obj_linux_x86_64_d_s/gnugk core
bt

Once you've obtained a backtrace, post it to the mailing list.

Note: On some systems, the core dump is named "core.xxx" where xxx is the process number of the GnuGk process that crashed.


Next Previous Contents

Chapters: Contents · Introduction · Installation · Getting started · Basic Config · Routed Mode & Proxy · Routing · RAS Config · Authentication · Accounting · Neighbors · Per Endpoint Config · Advanced Config · Monitoring · Advanced Topics



Last updated: 16. Nov 2017
Page maintained by Jan Willamowius