//##############################################################################
//
//	Gatekeeper configuration file example.
//	Reserved words case insensitive.
//	All strings to match with others can contain Regular Expressions.
//	Boolean parameter can be written in forms:
//	  'true', 'yes', 'rulez', 'allow' and 'allowed' has meaning of true
//	  'false', 'no', 'suxx', 'deny' and 'prohibited' has meaning of false
//
//##############################################################################

/* Yet another type of comment */

//##############################################################################
// System options
//##############################################################################

system
{
  identifier 'Aqua_GK0';	// Gatekeeper identifier. Used for gatekeeper identification.
  address 10.0.0.1;		// Interface gatekeeper must work thru. If not specified first random will be taken.
  call signal port 1720;	// Call signal port. Will be standard (1720) if not specified.
}

//##############################################################################
// Debug logging options
//##############################################################################

log
{
  file "AquaGatekeeper.log";	// Creates log file with console output copy.
  RAS messages	suxx;		// RAS messages.
  Q931 messages	suxx;		// Q.931 messages.
  H245 messages	suxx;		// H.245 messages.
  RADIUS messages suxx;		// RADIUS messages.
  messages dump suxx;		// Dump all enabled incoming messages.

  // Other diagnostics with not so extensive output.
  registrations		rulez;	// Endpoint registration/unregistration.
  connection status	rulez;	// Connection progress.
  chosen route		rulez;	// On alias resolve.
  available bandwidth	rulez;	// Available bandwidth at AdmissionRequest.
  bandwidth changes	rulez;	// Bandwidth occupation.
}

//##############################################################################
// AAA options
//##############################################################################

aaa
{
  file "AquaGatekeeper.bill";	// You know... bill file, charge em !
  address 10.0.0.2;		// RADIUS server address.
  authentication port 1645;	// Will be stadard (1812) if not specified.
  accounting port 1646;		// Will be stadard (1813) if not specified.
  password 'xxx';		// Shared secret.
}

//##############################################################################
// Zones definition
//##############################################################################

// Both networks 10Mbit wide, but we'd like to give out
// only half for phone traffic.
zone LocalNet1 bandwidth 5M;		// Parad CT's local network.
zone AquaLocalNet bandwidth 5M;		// Aqua Project Group local network.
// Link between these nets also 10Mbit wide, but JAM light flashes frequently.
// So to resolve this problem we cutting internet phone traffic down to 1Mbit.
link between LocalNet1 and AquaLocalNet bandwidth 1M;

// Gateway TestGateway0 located at AquaLoacalNet but it's outer interface
// limited to 500 kbit. So, we use this scheme to define it. AquaLocalNet
// will be involved in call cause it's only way to TestGateway0.
zone TestGateway0 bandwidth 500K;
link between AquaLocalNet and TestGateway0 bandwidth unlimited; // Virtual link.
// Same with other gateway.
zone TestGateway1 bandwidth 0.5M;
link between LocalNet1 and TestGateway1; // It's ok too, to indicate unlimited.

//##############################################################################
// Group definition
//##############################################################################

group Lamers
{
  proxy level signalling;
  cost 10 at 12:00-13:00;
  cost 20 at Mon-Tue;
  radius authentication caller;		// Authenticate caller leg only.
  radius accounting call;		// Accounting records for both legs.
}

group Aqua
{
  location AquaLocalNet;
  proxy level none;
}

//##############################################################################
// User definition
//##############################################################################

user AquaGroupUser
{
  proxy level signalling;
  group member Aqua;
  login "aqua(.+)letmein" set UserName to "\1";
  alias UserName;
}

user copah
{
  location LocalNet1;			// Redefine location.
  proxy level none;
  group member Aqua;
  login "copah";
  login "123";
  alias "copah";
  alias "copper.*" at 16:00-03:00;
  alias "the 'trick'";
  alias 'the "trick"';
  translate in callee alias ".*" to "copah";
}

user Andrew
{
  group member Aqua;
  proxy level none;			// Has no effect, because Aqua's proxylevel has higher priority.
  login "Andrew";
  login 'light';
  alias "Andrew";
  alias "andrew";
  alias "333";
  translate in callee alias ".*" to "Andrew";
  translate out caller alias ".*" to "Andrew";
  cost 10;
}

user RainbowTestUser
{
  location LocalNet1;
  login "john";
  login "666";
  alias "jonny" translate to "john";

  dial TestGateway0 prohibited at Sat-Sun;
  dial copah rulez;
  dial Andrew prohibited at 12:00-15:06;
  dial prohibited;
}

user TestGateway0
{
  location TestGateway0;
  static "igor.ru";
  alias "9([0-9]+)" translate to "\1";
  cost 10 at 00:00-16:40;
  cost 11;
  connections 10 at 08:00-18:00;
  connections 5;
}

user TestGateway1
{
  location TestGateway1;
  static "igor.ru:12345";
  alias "9([0-9]+)" translate to "\1";
  cost 10 at 16:41-19:00;
  cost 11;
}

user Cisco
{
  login "cisco";
  location AquaLocalNet;
  alias "8[0-9]+";
  cost 10 at 1/./. 00:00-10/./. 23:59;
  cost 11;
}

gatekeeper light
{
  location AquaLocalNet;
  ras address "light.ru";
  static "light.ru";
  alias ".*";
}
