The Status Interface is the external interface for monitoring and controlling the gatekeeper. The gatekeeper will send out messages about ongoing calls to all connected clients and it can receive commands via this interface.
The interface is a simple TCP port (default: 7000), you can connect to with telnet or another client. One example of a different client is the Java GUI, aka GkGUI.
What you do with the powers of the Status Interface is up to you, but here are a few ideas:
See GkGUI.
Analyse the CDR messages and forward them to a billing application.
If you don't want to publish the source code to additinal features, just publish the core functionality and interface to it through the status interface and keep the external part private.
Suppose you are just interested in the CDRs (call details records) and want to process them as a batch at regular intervals.
Here is a simple Perl script (gnugk_cdr.pl
) that starts the gatekeeper and also forks a very simple client for the Status Interface and writes just the CDRs into a logfile.
#!/usr/bin/perl # sample program that demonstrates how to write the CDRs to a log file use strict; use IO::Socket; use IO::Handle; my $logfile = "/home/jan/cdr.log"; my $gk_host = "localhost"; my $gk_port = 7000; my $gk_pid; if ($gk_pid = fork()) { # parent will listen to gatekeeper status sleep(1); # wait for gk to start my $sock = IO::Socket::INET->new(PeerAddr => $gk_host, PeerPort => $gk_port, Proto => 'tcp'); if (!defined $sock) { die "Can't connect to gatekeeper at $gk_host:$gk_port"; } $SIG{HUP} = sub { kill 1, $gk_pid; }; # pass HUP to gatekeeper $SIG{INT} = sub { close (CDRFILE); kill 2, $gk_pid; }; # close file when terminated open (CDRFILE, ">>$logfile"); CDRFILE->autoflush(1); # don't buffer output while (!$sock->eof()) { my $msg = $sock->getline(); $msg = (split(/;/, $msg))[0]; # remove junk at end of line my $msgtype = (split(/\|/, $msg))[0]; if ($msgtype eq "CDR") { print CDRFILE "$msg\n"; } } close (CDRFILE); } else { # child starts gatekeeper exec("gnugk"); }
There are several Graphical User Interface (GUI) frontend for the gatekeeper.
Developed by Jan Willamowius. You can monitor the registrations and calls that go through the gatekeeper. A right-click on a button gives you a popup menu for that endpoint.
This GUI works with Java 1.0 built into most web browsers. For security reasons the GUI must be run as a standalone application or served by a web server on the same IP number as the gatekeeper (you cannot run it as an applet via a local file).
The program is available at http://www.gnugk.org/h323gui.html¡C
A new standalone Java program developed by Citron Network Inc. It requires Java 1.4. New features include:
The GkGUI is released under GNU General Public License, available at http://www.gnugk.org/h323develop.html#java¡C
The command help
or h
will show you a list of all available commands.
Reload
Reload the configuration.
Version
, v
Show the version and OS information of the gatekeeper.
Statistics
, s
Show the statistics information of the gatekeeper.
Statistics
-- Endpoint Statistics --
Total Endpoints: 21 Terminals: 17 Gateways: 4 NATed: 2
Cached Endpoints: 1 Terminals: 1 Gateways: 0
-- Call Statistics --
Current Calls: 1 Active: 1 From Neighbor: 0 From Parent: 0
Total Calls: 1539 Successful: 1076 From Neighbor: 60 From Parent: 5
Startup: Fri, 21 Jun 2002 10:50:22 +0800 Running: 11 days 04:22:59
;
PrintAllRegistrations
, r
, ?
Show all registered endpoints.
AllRegistrations
RCF|IP:Port|Aliases|Terminal_Type|EndpointID
...
Number of Endpoints: n
;
AllRegistrations
RCF|10.1.1.10:1720|800:dialedDigits=Wei:h323_ID|terminal|1289_endp
RCF|10.0.1.43:1720|613:dialedDigits=Jacky Tsai:h323_ID|terminal|1328_endp
RCF|10.0.1.55:1720|705:dialedDigits=Sherry Liu:h323_ID|terminal|1333_endp
Number of Endpoints: 3
;
PrintAllRegistrationsVerbose
, rv
, ??
Show details of all registered endpoints.
AllRegistrations
RCF|IP:Port|Aliases|Terminal_Type|EndpointID
Registration_Time C(Active_Call/Connected_Call/Total_Call) <r>
[Prefixes: ##] (gateway only)
...
Number of Endpoints: n
;
AllRegistrations
RCF|10.0.1.8:1720|Accel-GW2:h323_ID|gateway|1322_endp
Wed, 26 Jun 2002 16:40:03 +0800 C(1/5/33) <1>
Prefixes: 09,002
RCF|10.1.1.10:1720|800:dialedDigits=Wei:h323_ID|terminal|1289_endp
Wed, 26 Jun 2002 16:40:55 +0800 C(0/32/39) <1>
RCF|10.0.1.66:1720|716:dialedDigits=Vicky:h323_ID|terminal|1425_endp
Wed, 26 Jun 2002 16:40:58 +0800 C(1/47/53) <1>
Number of Endpoints: 2
;
PrintCurrentCalls
, c
, !
Show all current calls.
CurrentCalls
Call No. # | CallID | Call_Duration | Left_Time
Dialed_Number
ACF|Caller_IP:Port|Caller_EPID|CRV
ACF|Callee_IP:Port|Callee_EPID|CRV
...
Number of Calls: Current_Call Active: Active_Call From Neighbor: Call_From_Neighbor \
From Parent: Call_From_Parent
;
CurrentCalls
Call No. 29 | CallID bd c6 17 ff aa ea 18 10 85 95 44 45 53 54 77 77 | 109 | 491
Dial 0953378875:dialedDigits
ACF|10.0.1.49:1720|4048_CGK1|25263
ACF|10.1.1.1:1720|4037_CGK1|25263
Call No. 30 | CallID 70 0e dd c0 9a cf 11 5e 00 01 00 05 5d f9 28 4d | 37 | 563
Dial 0938736860:dialedDigits
ACF|10.0.1.48:1032|4041_CGK1|11896
ACF|10.1.1.1:1720|4037_CGK1|11896
Number of Calls: 2 Active: 2 From Neighbor: 0 From Parent: 0
;
PrintCurrentCallsVerbose
, cv
, !!
Show details of all current calls.
CurrentCalls
Call No. # | CallID | Call_Duration | Left_Time
Dialed_Number
ACF|Caller_IP:Port|Caller_EPID|CRV
ACF|Callee_IP:Port|Callee_EPID|CRV
# Caller_Aliases|Callee_Aliases|Bandwidth|Connected_Time <r>
...
Number of Calls: Current_Call Active: Active_Call From NB: Call_From_Neighbor
;
CurrentCalls
Call No. 48 | CallID 7d 5a f1 0a ad ea 18 10 89 16 00 50 fc 3f 0c f5 | 30 | 570
Dial 0225067272:dialedDigits
ACF|10.0.1.200:1720|1448_endp|19618
ACF|10.0.1.7:1720|1325_endp|19618
# Sherry:h323_ID|Accel-GW1:h323_ID|200000|Wed, 26 Jun 2002 17:29:55 +0800 <2>
Number of Calls: 1 Active: 1 From NB: 0
;
Find
, f
Find a registered endpoint by an alias or a prefix.
Find Alias
RCF|IP:Port|Aliases|Terminal_Type|EndpointID
;
f 800
RCF|10.1.1.10:1720|800:dialedDigits=Wei:h323_ID|terminal|1289_endp
;
f 801
SoftPBX: alias 801 not found!
FindVerbose
, fv
Find details of a registered endpoint by an alias or a prefix.
FindVerbose Alias
RCF|IP:Port|Aliases|Terminal_Type|EndpointID
Registration_Time C(Active_Call/Connected_Call/Total_Call) <r>
[Prefixes: ##] (gateway only)
;
fv 02
RCF|10.0.1.100:1720|TFN:h323_ID|gateway|4037_CGK1
Wed, 26 Jun 2002 17:47:29 +0800 C(0/84/120) <1>
Prefixes: 02,09
;
UnregisterIP
Forcedly unregister an endpoint by IP and call signalling port.
UnregisterIP IP[:Port]
UnregisterIP 10.0.1.31:1720
URQ|10.0.1.31:1032|1326_endp|maintenance;
SoftPBX: Endpoint 10.0.1.31:1720 unregistered!
UnregisterAlias
Forcedly unregister an endpoint by one of its aliases.
UnregisterAlias Alias
UnregisterAlias 601
URQ|10.0.1.31:1032|1326_endp|maintenance;
SoftPBX: Endpoint 601 unregistered!
UnregisterAllEndpoints
Forcedly unregister all registered endpoints.
UnregisterAllEndpoints
URQ|10.0.1.7:1024|1325_endp|maintenance;
URQ|10.0.1.8:1024|1322_endp|maintenance;
URQ|10.0.1.32:1032|1324_endp|maintenance;
URQ|10.0.1.36:1032|1323_endp|maintenance;
URQ|10.0.1.42:1032|1318_endp|maintenance;
Done
;
DisconnectCall
Disconnect a call with given number.
DisconnectCall Number
DisconnectCall 1533
DisconnectIP
Disconnect all calls of an endpoint by IP and call signalling port.
DisconnectIP IP[:Port]
DisconnectIP 10.0.1.31:1720
DisconnectAlias
Disconnect all calls of an endpoint by one of its aliases.
DisconnectAlias Alias
DisconnectAlias 601
ClearCalls
Disconnect all calls on the gatekeeper.
GK
Show the information of the parent gatekeeper.
Debug
Only used for debug purpose. Options:
trc [+|-|n]
Show/modify trace level.
cfg SEC PAR
Read and print a config parameter in a section.
set SEC PAR VAL
Write a config value parameter in a section.
remove SEC PAR
Remove a config value parameter in a section.
remove SEC
Remove a section.
printrm VERBOSE
Print all removed endpoint records.
debug trc 3
debug set RoutedMode H245Routed 1
Who
Show all people on the status port.
RouteReject
Terminate this call on a virtual queue.
RouteReject CallingEndpointID CallRef
RouteReject endp_4711 1234
RouteToAlias
, rta
Route this call on a virtual queue to the specified alias.
RouteToAlias Alias CallingEndpointID CallRef
RouteToAlias Suzi endp_4711 1234
Exit
, q
Quit the status port.
The section describes the messages output to the status interface.
GCF|IP|Aliases|Endpoint_Type;
The gatekeeper receives a GatekeeperRequest (GRQ) and responds with a GatekeeperConfirm (GCF).
GRJ|IP|Aliases|Endpoint_Type|RejectReason;
The gatekeeper receives a GatekeeperRequest (GRQ) and responds with a GatekeeperReject (GRJ).
RCF|IP:Port|Aliases|Endpoint_Type|EndpointID;
The gatekeeper receives a RegistrationRequest (RRQ) and responds with a RegistrationConfirm (RCF).
RRJ|IP|Aliases|Endpoint_Type|RejectReason;
The gatekeeper receives a RegistrationRequest (RRQ) and responds with a RegistrationReject (RRJ).
ACF|Caller_IP:Port|Caller_EndpointID|CRV|DestinationInfo|SrcInfo|IsAnswered;
The gatekeeper receives an AdmissionRequest (ARQ) and responds with an AdmissionConfirm (ACF).
ARJ|Caller_IP:Port|DestinationInfo|SrcInfo|IsAnswered|RejectReason;
The gatekeeper receives an AdmissionRequest (ARQ) and responds with an AdmissionReject (ARJ).
DCF|IP|EndpointID|CRV|DisengageReason;
The gatekeeper receives a DisengageRequest (DRQ) and responds with a DisengageConfirm (DCF).
DRJ|IP|EndpointID|CRV|RejectReason;
The gatekeeper receives a DisengageRequest (DRQ) and responds with a DisengageReject (DRJ).
LCF|IP|EndpointID|DestinationInfo|SrcInfo;
The gatekeeper receives a LocationRequest (LRQ) and responds with a LocationConfirm (LCF).
LRJ|IP|DestinationInfo|SrcInfo|RejectReason;
The gatekeeper receives a LocationRequest (LRQ) and responds with a LocationReject (LRJ).
BCF|IP|EndpointID|Bandwidth;
The gatekeeper receives a BandwidthRequest (BRQ) and responds with a BandwidthConfirm (BCF).
BRJ|IP|EndpointID|Bandwidth|RejectReason;
The gatekeeper receives a BandwidthRequest (BRQ) and responds with a BandwidthReject (BRJ).
UCF|IP|EndpointID;
The gatekeeper receives an UnregistrationRequest (URQ) and responds with an UnregistrationConfirm (UCF).
URJ|IP|EndpointID|RejectReason;
The gatekeeper receives an UnregistrationRequest (URQ) and responds with an UnregistrationReject (URJ).
IRQ|IP:Port|EndpointID;
The gatekeeper sends an InfoRequest (IRQ) to an endpoint to query if it is still alive. The endpoint shall respond with an InfoRequestResponse (IRR) immediately.
URQ|IP:Port|EndpointID|Reason;
The gatekeeper sends an UnregistrationRequest (URQ) to an endpoint to cancel its registration. The endpoint shall respond with an UnregistrationConfirm (UCF).
CDR|CallNo|CallId|Duration|Starttime|Endtime|CallerIP|CallerEndId|
\CalledIP|CalledEndId|DestinationInfo|SrcInfo|GatekeeperID;
After a call disconnected, the call detail record is shown (in one line).
RouteRequest|VirtualQueue|CallerEndId|CallRef|CallerAlias|SrcInfo;
Request for an external application to route an incomming call on a virtual queue.