rus

Versuch project (versuch - an attempt ger.) is a H323 proxy with media flow control. Also the similar software is called a softswitch. Versuch allows both concentrate and commutate VoIP streams and translate them between networks various operators. Also it can operate with separate terminal or transit units or whole H323 networks.
Historically the project came into the world because of necessity in VoIP control at local network approximately in 2003. Initially, the core based on parts of code from OpenH323Proxy by Roman Svirsky. Later the sources in majority were reconstructed for better performance and stability. Most important change is a transfer of the core to "native" system routines instead of PWlib's ones. Now PWlib remains only in H323 stack staff.

Features:
Routing is based on Called and Calling numbers, tech prefixes. External route-server is possible.
Perl regular expressions are using in translation.
Alternate routes are enabling.
Simultaneous calls per gateway restriction.
Authentication & authorization by numbers, local ACLs, IP address, Radius.
Support H323 versions 1 and 2, partial 3.
Translations of called and calling number fulfill by pcre-lib engine or external route-server.
Proxing RTP/RTCP (optional), H225, H245 traffic between VoIP subjects.
Statistic collection in extended CDR files, Radius accounting (Cisco like or transit mode), debug logging with request level.
Basic configure implemented from text files.
Monitoring and control are possible through Telnet console.
Change configuration without service interrupt.

Setup:

Requirements:
FreeBSD 5 and above or Linux 2.6 and above
Libraries:
OpenH323 & PWlib. Recommended latest stable from www.voxgratia.org
pcre++ / pcre. Latest are pcre 6.7 and pcre 0.95

Building (for 1.0.2 release):
For building you have to pass ordinary consecution:
./configure
make (gmake for FreeBSD)
make install (gmake install)

For FreeBSD users is the easiest path to install versuch from ports collection with dependencies.

For building a binary code with debug info you have to type make debug.
./configure --help let see you possible options of configuration.
There are trivial shell scripts for start-up and monitoring of versuch daemon in script/ directory.

Configuring:
The configure files exit in installation catalog (${INSTALLPREFIX}/versuch by default) or in the current one.
Empty strings in conf files bodies are ignored. Strings with leading "#" symbol are considered like comments. If there is error in parameter the value is setting to default without any warnings.

Main conf file versuch.ini:

Section [main]
ID Proxy ID. The parameter exists in requests to Radius-server and CDR files for splitting data from various proxies. Empty string is default value.
LocalAddress Bind address for signal channel for multi-home environment. Default value "*" means binding to every interface of a box.
Port ranges:
Q931PortRange Port range for outgoing signal connections. By default 10000-59000
H245PortRange Port range for outgoing channel control connections. By default 10000-59000
RTPPortRange Port range for outgoing media streams. By default: 10000-59000
 
StatusPort Port number for binding of status port. By default 2016
IncomingTranslateCalled List of rules for translation CalledPartyNumber for every incoming call. It is empty by default.
Syntax of rules is Perl-like with several restrictions due using pcre/pcre++ libraries.
The example of translation call from Moscow's dial plan to E164:
IncomingTranslateCalled=/^810//
IncomingTranslateCalled=/^8(1|2|3|4|5|6|7|8|9)/7$1/
IncomingTranslateCalled=/^(.......)$/7495$1/
DefaultMinDigits Minimal digit restriction for CalledPartyNumber for every call. By default is zerro - without limits.
BlockG711 Blocking G711 codecs in H245 conversations. "No" is default value. The function has no strong debug in FastStart case.
GatewaysConfig File name with voice gateways descriptions. gateways.cfg is by default.
BlockRoutingCauses List of Q931 terminal causes for stopping of route election. It is empty by default.
For example BlockRoutingCauses=17,19 will cause to stop route election with "Busy" or "No answer" answer from called gateway.
DebugSourceHost Address of gateway for low level debug. By default is - 0.0.0.0 (I hope that no one router don't allow one :-) )
Be extremelly carefull with this option. There is memory leak due pwlib bug with detail printing of h323 fields.

Section [Accounting]
type Accounting mode: log, radius, both or none. None by default.
radiushost Address of Radius-server for accounting. By default 127.0.0.1.
port Destination port of Radius-server for accounting. By default 1813.
secret The key for Radius accounting requests. It is empty by default.
vsaprefix Prefix before VSA-attributes for compatibility.
logfile Path to and name of log file. /dev/null is by default.
logrotatetime Minutes between log file rotation event. By default - 60 (every hour).
logumask umask for creation of new log file. By default 0600.
Account leg mode:
radmode Enumerate: 1 or 2. By default 2.
In case "1" only one account leg is generated for a call (transit mode)
In case "2" generating legs for incoming and outgoing info separately.(Cisco like mode)
radstoponly In case "yes" Start leg will not generate. By default - no.

Section [Auth]
type Auth mode. radius and text are possible. By default - text.
In case "text" dial-peers are using for calls routing.
In case "radius" there is request for routing to Radius-server.
radiushost Address of Radius server for authentication. By default - 127.0.0.1.
port Destination port number for requests. By default - 1812.
secret The key for Radius request. It is empty by default.
vsaprefix Prefix before VSA-attributes for compatibility. It is empty by default.
peerfile File name with dialpeer descriptions. By default - peers.cfg.


File of gateways' description gateways.cfg

The file has descriptions of target gateways for versuch using. It is mandatory for both cases of authorization Radius and dialpeer routing.
Description of gateway start from arbitrary symbolic ID in square brackets to end of file or next gwID in square brackets.
Other field of descriptions consist of pairs name=value in every string.
[gateway_name] Arbitrary gateway ID is mandatory for route of call in Radius answer or dialpeer.
Address IP address of gateway
Capacity Simultaneous calls that are possible for gateway.
Defer Threshold in H323 dialogue before Connect for delay in messaging to destination.
The option is important for non-standart behavior of source gateways. For example, several terminals send Alerting immediate after CallProceeding without any accordance with real call condition. And in the case of passing through several destinations for call there is situation with several Alerting messages: Defer=Alerting will solve the problem.

File of description of dialpeerspeers.cfg

The file is mandatory only in text Auth mode. The file format and dialpeer's description are correspond to gateways.cfg. Selection of destination gateways list proceeds from DestinationPattern for CalledNumber and SourcePattern for CallingNumber. Patterns are Perl regular expressions without length coincidence analysis, for order in route list is important Preference option only. If Huntstop is 1 the route list has truncated.
[peer_name] Arbitrary dialpeer ID
DestinationPattern Perl regexp for checking CalledPartyNumber
SourcePattern Perl regexp for checking CallingPartyNumber
Target ID of target gateway from gateways.cfg file
Preference Sorting argument in route list. Integer.
HuntStop Indication of stop to build route list. "0" if continue (by default).
Proxy Indication of media proxing. "1" if media proxy (by default).
dst_translate Perl regular expression for CalledPartyNumber translation.
src_translate Perl regular expression for CallingPartyNumber translation.
dst_bill_translate Expression for create of field DST-NUMBER-BILL in accounting from CalledPartyNumber. Usually for adding some prefix for billling computing, sample is dst_bill_translate=/^(.+)$/00001#$1/
src_bill_translate Expression for create of field SRC-NUMBER-BILL in accounting from CallingPartyNumber.

AAA model

Authentication and authorization:
For call routing and authentication appreciate Radius server. There is no any mean to only authentication without routing by Radius and it looks rightly to talk about "calls control by external route server". Cisco-like format and superfluity of requests allow to route server based on any Radius. In case with getting routes from route-server the file peers.cfg is ignored. Request originating once in the moment of call arriving. For compatibility with popular route servers in auth request AV-pair was added: request-type=route
routing-request=1
route-retries=1

Route-server can make decision about call from info about any usual attribute: CalledNumber, CallingNumber, SourceGWIP and etc. Positive Radius response contains VendorSpecific attributes with routes list. Format of VSA with routes are: gw_name/proxy_ind/calling_number/called_number/calling_bill_number/called_bill_number Explanation:
- gw_name from file gateways.cfg.
- calling_number and called_number new corresponded values for H323 message to target gateways.
- calling_bill_number and called_bill_number have means only for accounting.
- proxy_ind - 0 or 1 - media proxy indication
When route list is more than one there are several VSA in response.

Message ReleaseComplete with Q931::NoRouteToNetwork will send to originate gateway when negative radius response has got. For correct interpretation of VSA it is important to has active Cisco dictionary in Radius environment.

Accounting:
There is a minor mean between Radius and CDR accounting. Information elements are a equal. For existed billing system compatibility info stored in redundant form. In transit mode it is usual to turning-off of generating start leg. Cisco-like mode of accounting appreciate for billing system without wide tuning possibilities. Below you can see example with brief explanation of stop CDR leg in transit mode for successful call:

Mon Oct 30 18:35:57 2006, HOST=testhost, DST-NUMBER-IN=88888888888, SRC-NUMBER-IN=8888888, DST-NUMBER-OUT=88888888888, SRC-NUMBER-OUT=8888888, SRC-NUMBER-BILL=00001#8888888, DST-NUMBER-BILL=00003#88888888888, SRC-IP=77.77.7.77, DST-IP=88.888.888.88, SRC-RTP-IP=77.77.7.77, DST-RTP-IP=88.888.888.88, SRC-USER=77.77.7.77, INITIAL-INCOMING-LOCAL-ADDRESS=99.99.9.9, OUTGOING-LOCAL-ADDRESS=33.33.3.3, SETUP-TIME=18:33:06.000 +0300 Mon Oct 30 2006, CONNECT-TIME=18:33:11.000 +0300 Mon Oct 30 2006, DISCONNECT-TIME=18:35:57.000 +0300 Mon Oct 30 2006, DISCONNECT-CODE-Q931=16, INTERNALCAUSE=CalledNormal, ROUTE-RETRIES=1, SRC-BYTES-IN=230503, DST-BYTES-IN=271033, SRC-BYTES-OUT=271033, DST-BYTES-OUT=230503, SRC-CODEC=g729, DST-CODEC=g729, CALLID=C2F8EDDA676211DB8348C3473A2FCA7B, CONFID=C2F8511A676211DB8346C3473A2FCA7B, PROXY-MODE=1, ELAPSED-TIME=166, SOURCE-FASTSTART=1, DESTINATION-FASTSTART=1, SOURCE-TUNNELLING=0, DESTINATION-TUNNELLING=0
The first field contain timestamp of record. Other ones have format of pair parametr=value. In case of Radius accounting the same attributes exist. Brief description:
HOST ID from versuch.ini
DST-NUMBER-IN and SRC-NUMBER-IN Incoming CalledNumber and CallingNumber
DST-NUMBER-OUT and SRC-NUMBER-OUT Outgoing (after translation) CalledNumber and CallingNumber
SRC-NUMBER-BILL DST-NUMBER-BILL Service info for simplifying of billing.
SRC-IP DST-IP Addresses of source and target gateways. Signal channels are basis.
SRC-RTP-IP DST-RTP-IP Addresses of source and target media streams.
SRC-USER Field only for compatibility, address of source gateway.
INITIAL-INCOMING-LOCAL-ADDRESS
OUTGOING-LOCAL-ADDRESS
Addresses of both source and destination local interfaces.
SETUP-TIME
CONNECT-TIME
DISCONNECT-TIME
Timestamps of H225 packet movements.
DISCONNECT-CODE-Q931 Decimal Q931 termination cause.
INTERNALCAUSE Internal termination cause.
ROUTE-RETRIES Count of attempts. Every failure increases the counter.
SRC-BYTES-IN
DST-BYTES-IN
SRC-BYTES-OUT
DST-BYTES-OUT
Byte counters.
SRC-CODEC
DST-CODEC
Selected codecs.
CALLID
CONFID
Fields from H225 messages.
PROXY-MODE Media proxying indication.
ELAPSED-TIME Elapsed time of call between Connect and Release messages.
SOURCE-FASTSTART
DESTINATION-FASTSTART
SOURCE-TUNNELLING
DESTINATION-TUNNELLING
H323 v2 attributes

Non-standart Radius attributes are coding with VSA pairs. Therefore it is important to check Cisco dictionary in Radius environment.


Control

By default versuch waits telnet connections on 2016 port. In case of typing wrong request help message will printing. Auto-fill is still in plans. List of command:
showlist or list Show active calls. showlist print list in human mode..
reloadconfig Re-read conf files.
q Q Close Telnet session
counters Data for visualization by tools like MRTG.
uptime Uptime.
details:CallRef Call details. CallRef is CallReference from H225 message.
kill:CallRef Forcing the call to shutdown.
shutdown:CallRef Attempt to shutdown the call by sending ReleaseCompete to both gateways.
TraceLevel:level Level of trace detalisation. [!! CPU overload is enabled !!]

When up/down arrow keys pressed the command history will rotate.

At finish:

Please, remember, that if you have more than 200 simultaneous calls, you may should tune your system environments, default values of systems variables are insufficient for serious load.

The core of versuch is mature and stable, but new features are adding some time...

Regards
warlock

15nov 2006
contact: warlock at elcat dot kg

download

SourceForge.net Logo