OpenSBC Manual
OpenSBC Manual
Table of Contents
1. Introduction..................................................................................................................2
1.1 About.......................................................................................................................2
1.2 Copyright.................................................................................................................2
1.3 Download.................................................................................................................4
1.4 Mailing List and Forums..........................................................................................4
1.5 Sponsors.................................................................................................................5
2. Compiling and Installing.............................................................................................6
2.1 Compiling OpenSBC...............................................................................................6
2.2 Installing OpenSBC.................................................................................................9
3. Quick Start..................................................................................................................12
3.1 Basic Configuration...............................................................................................12
3.2 Adding User Accounts...........................................................................................13
3.3 Adding Basic Routes.............................................................................................14
3.4 Sending Traffic......................................................................................................15
4. HTTP Admin...............................................................................................................19
4.1 OpenSBC HTTP Admin........................................................................................19
4.2 OpenSBC General Parameters.............................................................................20
4.2.1 [Logging].........................................................................................................20
4.2.2 [Modes]...........................................................................................................21
4.2.3 [Listeners].......................................................................................................23
4.2.4 [Media]............................................................................................................23
4.2.5 [Call Transfer].................................................................................................24
4.2.6 [Encryption]....................................................................................................25
4.2.7 [Event Processors].........................................................................................26
4.2.8 [Timers]..........................................................................................................26
Page 1 of 26 12/17/07
OpenSBC Manual
1. Introduction
1.1 About
OpenSBC is an ongoing attempt to create an open-source Session Border Controller that is fully compliant
with the mandates of RFC 3261. OpenSBC can be used as a SIP router, media anchor for far-end NAT
traversal, SIP egress and ingress trunking among others. OpenSBC functionalities are as follows
Current Functionalities:
Future Functionalities
● Voice XML
● Third Party Call Control (3PCC)
● Dialog Events
● Signaling Compression (SIGCOMP)
Page 2 of 26 12/17/07
OpenSBC Manual
1.2 Copyright
OpenSBC is published under the MPL, GPL, LGPL triple license. The default active license is MPL.
However, because of the inherent incompatibility between MPL and GNU licenses, we decided to explicitly
publish OpenSBC using GPL and LGP as alternative licenses. The full text of the license is as follows
Page 3 of 26 12/17/07
OpenSBC Manual
others to
* use your version of this file under the terms of the MPL,
indicate your
* decision by deleting the provisions above and replace them with
the notice
* and other provisions required by the GPL or the LGPL. If you do
not delete
* the provisions above, a recipient may use your version of this
file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* The OpenSIPStack Library includes some GPL/LGPL code libraries
that MAY be
* enabled at compile time using the --enable-gpllibs configure
switch. If
* enabled, the content of this file is published under the terms
of GNU
* General Public License Version 2. For a detailed list of the
available
* GPL code, see $(opensipstack)/gnu/README file.
1.3 Download
The latest development releases and binaries can be downloaded at the following locations
* http://www.opensipstack.org
* http://www.opensourcesip.org
* Source Forge (http://sourceforge.net/projects/opensipstack/)
Page 4 of 26 12/17/07
OpenSBC Manual
1.5 Sponsors
The chief architect and coordinator of the OpenSBC project is Joegen E. Baclor.
([email protected])
Solegy Systems (http://www.solegy.com/) sponsored the main functionalities of OpenSBC.
Ryan Colobong ([email protected]) is a Solegy Architect dedicated to work on OpenSBC.
Page 5 of 26 12/17/07
OpenSBC Manual
Compiling in Linux/Unix
Most Unix/Linux distribution already goes with all the dependency requirement for OpenSBC and
OpenSIPStack to build properly out of the box. Technically, its just a matter of running the ‘configure’
script before running a ‘make bothnoshared’.
Compile opensipstack first before compiling opensbc using the steps below.
unix-shell>#./configure
There might be instances when file run permissions are not properly set for the configure script either due
to previous commits from a Windows source or your CVS client was not able to properly preserve the file
attributes. If you are unable to run the configure script properly, you may do one of two things. Do a
‘chmod +x ./configure’ or you may regenerate the file by issuing an autoconf within the
opensipstack directory. The latter should regenerate a fresh copy of the configure script from the
configure.ac autoconf template.
If all goes well with the configuration boot strap all that required to be done is:
unix-shell>#make bothnoshared
unix-shell>#gmake bothnoshared
CAVEAT: Most operating systems already have expat installed. If the configure script complains about
not finding the expat library, please install expat 2.0 (or higher) development package. OpenSIPStack
goes with a built-in expat source but this is intended for use with Windows builds.
CAVEAT: For OpenSolaris users, you might need to define the CC variable to use gcc instead of default
‘cc’ compiler that ships with Solaris.
solaris-shell>#gmake bothnoshared CC=gcc
Page 6 of 26 12/17/07
OpenSBC Manual
Compiling In Windows
OpenSIPStack and OpenSBC goes with project files for Visual C++ 7.10 and Visual C++ 8.0. If you don’t
have access to any of these compilers, Visual C++ Express Edition is available for free download at
http://msdn.microsoft.com/vstudio/express/visualc/download/. When using Visual Studio 8.0, make sure
you open the solution name opensipstack.sln and not opensipstack-7.10.sln to avoid Visual
Studio 8.0 from converting the solution to the recognized format. Compile the Release build first followed
by the Debug build. The sequence is important. There are known issues with the Debug build regarding
Custom Build Steps.
CAVEAT: Take note that as of version 1.1.4 Visual Studio 7.10 projects files are no longer supported. If
you are using these project files, you may need to manually modify the project files to include missing .cxx
files.
1. Get the latest source code of OpenSBC and OpenSIPStack from CVS.
2. Place the OpenSBC and OpenSIPStack in the same folder.
3. Open the solution file OpenSBC/OpenSBC.sln.
4. Make sure the “Solution Explorer” Windows is displayed.
5. Select the build type as “Release” or “Debug” in the build toolbar.
6. Right-click on “OpenSBC” and select “Build” from the menu to build both OpenSIPStack and
OpenSBC. Just like OpenSIPStack, OpenSBC has a configure Custom Build Step.
When the compile process has started there will be five Custom Build Steps that will be performed.
These Custom Build Steps will copy the Sqlite and Expat Libraries to $(SystemRoot)/system32/. Flex and
Bison files would be copied in C:/Tools.
Page 7 of 26 12/17/07
OpenSBC Manual
Important Warning!!!: If you already have sqlite3.dll and expat.dll in system32 folder and some
other applications rely on these two files, it is best that you EXCLUDE these files from the Custom Build
Process. All custom build files are located in “Make/Custom Build” folder in the project explorer tab of
Visual C++ 8.0. Version conflicts may arise if your copy is of different from the Expat and SQLite3 DLLs
that goes with opensipstack. You need to either upgrade your local copy or try changing the header
files in the opensipstack/external folder to your specific version and hope for the best.
After the Custom Build Steps have been performed, the configuration bootstrap will start searching for
existing SDK and libraries installed in your system. My compiler displays this information after the
configure script has finished searching.
Searching C:\
Located IPv6 Support at C:\Program Files\Microsoft Visual Studio
8\SmartDevices\SDK\PocketPC2003\Include\
Located DNS Resolver at C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\
Located QoS Support at C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\Include\
Searching X:\
Located OPAL at X:\dev\opensipstack\
Located MYACMLIB at X:\dev\opensipstack\external\codecs\
Located VOICEAGE at X:\dev\opensipstack\external\codecs\
Located SQLITE at X:\dev\opensipstack\external\CppSQLite\3.1\Common\
Located CPPSQLITE at X:\dev\opensipstack\external\CppSQLite\3.1\Common\
Located Expat XML at X:\dev\opensipstack\external\Expat-2.0.0\
Located LibJingle at X:\dev\opensipstack\external\jingle\talk\
If all goes well, with the configuration, OpenSIPStack should start compiling, hopefully, without any
problem.
Most recently, a new build configuration for Windows 64-bit has been added to the Visual C++ 8.0 project.
Aside from some benign warning about data truncation,
1>.\src\pwlib\src\ptlib\common\regex\regcomp.c(122) :
warning C4267: ‘=’ : conversion from ‘size_t’ to ‘sopno’, possible loss of
data
Page 8 of 26 12/17/07
OpenSBC Manual
CAVEAT: Windows.h missing is a compile error commonly reported in the mailing list. This may
happen in Visual Studio 2005 Express edition of Visual C++. Windows.h goes with the Platform SDK and
is available via a separate installation here http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/.
CAVEAT: Windows Vista might not allow the configure script to copy SQLite.dll and Expat.dll to
the system folder. To circumvent this, right click on the Visual Studio 2005 icon in the menu and click “Run
as Administrator”. This would give Visual studio temporary write access to the system folders.
There is no special install process for OpenSBC. Just copy the binary to a folder of your choice and run
OpenSBC. OpenSBC requires 'oss-application.conf.xml' to be in the same directory as the
opensbc binary. If this file is not present, opensbc will not start.
If you are going to use OpenSBC as a far end media anchor (RTP Proxy), you may need to increase the
number of file handles per process using "ulimit -n". The default is normally 1024 which will not
accommodate much connections. There are operating systems that does not allow limits to be modified
via ulimit. In Ubuntu, for example, limits can be defined in /etc/security/limits.conf.
Page 9 of 26 12/17/07
OpenSBC Manual
● -P –http-port n set the http listener port for the application admin page
● -a –app-name name set the identifier name that would be display in the http home page
Page 10 of 26 12/17/07
OpenSBC Manual
argument.
Page 11 of 26 12/17/07
OpenSBC Manual
3. Quick Start
After a successful installation of OpenSBC, the HTTP admin should already be accessible via port 9999 of
the server where OpenSBC is running. Figure 1 shows the main HTTP admin page. Pictures speak
louder than words!
Page 12 of 26 12/17/07
OpenSBC Manual
After this, you MUST RESTART OpenSBC so that the changes would take effect. Not all parameters in
OpenSBC requires a restart. But these two does!
Page 13 of 26 12/17/07
OpenSBC Manual
opensbcrocks.org is not a real domain with either host or SRV records. OpenSBC will not be able to
resolve this domain properly. Luckily, there is a way around this problem. You may statically map
domains using the "Internal DNS Mapping" section. In our case we want to map opensbcrocks.org:
9999 to the OpenSBC IP address. Figure 5 shows how to add an internal DNS map entry.
Page 14 of 26 12/17/07
OpenSBC Manual
Page 15 of 26 12/17/07
OpenSBC Manual
Page 16 of 26 12/17/07
OpenSBC Manual
The next step is to provide the user name and password of our hypothetical user John.
Page 17 of 26 12/17/07
OpenSBC Manual
On successful registration, we can now call our FWD echo server route by dialing 613.
Page 18 of 26 12/17/07
OpenSBC Manual
4. HTTP Admin
The HTTP Admin pages houses all configurable parameters to control the behavior of OpenSBC.
OpenSBC uses an XML template (oss-application.conf.xml) file for the HTTP admin. This file should be
present in the same directory of OpenSBC. The idea behind the XML template is to automate the addition
of new parameters in the config pages without the need to code anything.
Page 19 of 26 12/17/07
OpenSBC Manual
4.2.1 [Logging]
All OpenSBC logs are stored in $(OPENSBCDIR)/logs directory. Logs are created each time
OpenSBC is lauched and is rotated on a daily basis. The log filename format is $(prefix)-YYYY-MM-
DD-$(process-id).log; for example, b2bua-2007-07-17-3464.log. There are two types of
log entries in OpenSBC - SIP Logs and PTRACE Logs. PTRACE is used for debugging purposes while
SIP log displays the library and application level activities. Configurable parameters related to logging are
listed below:
[SIP Log Level] - Level of verbosity for SIP Logs. Valid Range is 0-5
[PTRACE Log Level] - Level of verbosity for PTRACE Logs. Valid Range is 0-5
Page 20 of 26 12/17/07
OpenSBC Manual
[Log File Prefix] - The prefix is configurable. This is handy during times when its necessary to run
multiple instances of OpenSBC and you want to set which log file belongs to which OpenSBC instance.
4.2.2 [Modes]
The architecture of OpenSBC allows it to act both as a B2BUA, Registrar, and as a pure SIP Proxy. You
may control which functionality you like by choosing the mode for OpenSBC. Each mode is explained
further below.
[SBC Mode]
1. Full Mode - By default OpenSBC runs in full mode exposing its capability both as a relay SIP proxy,
Registrar and as a B2B User Agent. When OpenSBC receives an INVITE or a REGISTER request it
would follow the following procedure to make a decision how to route a request:
● If the Request-URI resolves to a remote domain, the request will be relayed. If a relay route is
available, the request is sent to that route. If a relay route is not available, then the URI is
resolved via DNS.
● If the Startline-URI resolves as a local address and port, the To URI is checked if it resolves to a
local domain and port. If not, the request would be proxied using Relay Routes or via DNS
resolution. The Request URI would be rewritten to point to the resolved route.
Page 21 of 26 12/17/07
OpenSBC Manual
● INVITE: If both Request URI and To URI resolves to a local listener and port, the B2BUA Route is
used to route the INVITE.
● REGISTER: If both Request URI and To URI resolves to a local listener and port, the local
Registrar will process the registration. This would include Authorization of the user.
2. B2BOnly Mode - This mode removes the relay capability but exposes the Registrar and the B2BUA
functionalities. This mode does not do the checks performed by Full Mode. It will always process
REGISTER and INVITE as local.
● INVITE: This mode always use B2BUA Route to route calls. If there is not corresponding route
found, a DNS resolutions is done against the Request URI or the To URI in case the Request-URI
resolves to a local address.
● REGISTER: Registrations are always handled by the local registrar.
3. Proxy Only Mode - This mode removes the B2BUA functionality but exposes Registrar and the relay
SIP Proxy functionalities
● Always uses Relay Routes for all messages including REGISTER. If a relay route is not
configured, Requests will be relayed using DNS resolution. If a registrations is resolved as local,
the registrar would handle the registration including authorization
4. B2BUpperReg Mode - This is almost the same as the B2BOnly mode but with the additional capability
of relaying registrations to upper registrars.
● INVITE: This mode always uses B2BUA Route.
● REGISTER: For registrations, it performs the Request URI and To URI checking and relay for a
remote domain or process the registration locally for local domains.
● Upper-Registration: This mode also has the capability to hijack-registrations towards upstream
registrars.
4.2.3 [Listeners]
By default, OpenSBC listens on 5060 for UDP in all available Interfaces. OpenSBC also provides a means
to configure bindings to a specific address. To do this one must explicitly assign the address of the
interface. The ability of OpenSBC to listen on multiple interfaces gave it the powerful capability to bridge
calls across distinct networks if installed on a multi-homed host. Which interface to use for sending
messages is intelligently determined via the OS routing table. Both SIP and RTP are seamlessly bridged
by OpenSBC.
[Interface Address]
Page 22 of 26 12/17/07
OpenSBC Manual
4.2.4 [Media]
Audio NAT traversal is achieved by OpenSBC by proxying media between the NATed user agent (UA)
and the Internet. When OpenSBC detects that a call came from a NATed UA based on the via address, it
would automatically proxy media for the call. OpenSBC also uses the Registration information of UAs to
determine if calls terminating to the UA needs to be media-proxied. It must be noted that proxying media
is not always a guarantee of successful NAT traversal for audio. It is required that User Agents uses the
same UDP socket to send and receive RTP packets.
Page 23 of 26 12/17/07
OpenSBC Manual
[Pass-through REFER]
Pass-through REFER works by relaying the REFER to the remote UA. The Refer-To header is rewritten
to point back to OpenSBC while the original Refer-To header is added as prefix to the User portion of the
Refer-To URI. This way, OpenSBC would always stay in between the call legs even if the call is
transfered. OpenSBC just reconstructs the original Refer-To URI by extracting the prefix from the User
portion of the incoming Request-URI.
[Enable Local Refer]
4.2.6 [Encryption]
OpenSBC Supports two types of encryption. These are non-standard encryption supported by some
popular hardware vendors of IP Phones and ATA's.
[Encryption Mode]
[Encryption Key]
Page 24 of 26 12/17/07
OpenSBC Manual
4.2.8 [Timers]
Application timers are exposed to allow custom timeouts for alerting and call seizure. This is used by the
failover routing functionality.
[Alerting Timeout]
Page 25 of 26 12/17/07
OpenSBC Manual
[Seize Timeout]
Page 26 of 26 12/17/07