
User
Manual
[Previous] [Next]
[Contents]
2. Compiling and Installing
2.1 Compiling OpenSBC
Compiling in 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
or for Solaris and FreeBSD users
unix-shell>#gmake bothnoshared
CAVEAT:
Most operating systems already
has 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
CAVEAT:
FreeBSD users may need to install linux_base-fc-4_9.
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 here.
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.
-
Get the latest
source code of OpenSBC and OpenSIPStack from CVS
-
Place the OpenSBC
and OpenSIPStack in the same folder
-
Open the solution
file in OpenSBC/OpenSBC.sln
-
Make sure the
“Solution Explorer” Windows is displayed
-
Select the build
type as “Release” or “Debug” in
the build toolbar
-
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.
——
Build started:
Project: OpenSIPStack, Configuration: Release Win32
——
Copying
Flex.exe ...
Copying Bison.simple ...
Copying Bison.hairy ...
Copying Bison ...
Copying Expat.dll ...
Copying Sqlite3.dll ...
These
Custom Build Steps will copy the Sqlite and Expat Libraries to
$(SystemRoot)/system32/. Flex and Bison files would be copied in
C:/Tools. Important Warning!!!:
If you already have sqlite3.dll and expat.dll in system32 and some
other applications rely on these two files, it is best that you EXCLUDE
these files from the Custom Buid 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 DLL’s 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
there
shouldn’t be any trouble compiling OpenSBC in a 64-bit
setting.
CAVEAT: Windows.h missing
is a compile error commonly reported in the mailing list. This may
happen in Visual Stdio 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.
2.2 Installing OpenSBC
Running OpenSBC in Unix
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.
OpenSBC
accepts the following command line switches.
-
-v
–version display version information and exit
-
-d
–daemon run as a daemon
-
-u –uid
uid set user id to run as
-
-g –gid
gid set group id to run as
-
-p
–pid-file name or directory for PID file
-
-t
–terminate orderly terminate process in pid file
-
-k –kill
preemptively kill process in pid file
-
-s
–status check to see if daemon is running
-
-c
–console output messages to stdout rather than syslog
-
-l
–log-file file output messages to file or directory instead
of syslog [NO LONGER SUPPORTED]
-
-x
–execute execute as a normal program
-
-i
–ini-file set the ini file to use, may be
explicit file or a ‘:’ separated set of directories
to
search.
-
-H
–handlemax n set maximum number of file handles (set before
uid/gid) [MIGHT NOT ALWAYS WORK]
-
-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
Running
OpenSBC in console
#./opensbc -xc
Running
OpenSBC as a daemon
#./opensbc -d -p pidfile.txt
Running
OpenSBC using a specific config file
#./opensbc -d -p pidfile.txt -i
opensbc.ini
Running
OpenSBC using a custom HTTP
Admin port
#./opensbc -d -p pidfile.txt -i
opensbc.ini -P 4040
Stopping
OpenSBC Process
#./opensbc -k -p pidfile.txt
Checking
if OpenSBC is running
#./opensbc -s -p pidfile.txt
Running
OpenSBC in Windows
The best
way to run OpenSBC in window is to install it as a Windows Service.
OpenSBC
accepts the following command line arguments in windows
-
Install –
This argument installs OpenSBC as a Windows Service.
-
Remove –
Uninstalls the OpenSBC
Service but retains the configuration in the windows Registry. This is
usually used when upgrading OpenSBC versions
-
Deinstall
– Uninstalls and erase Registry entries. All previous
configuration data will be lost.
-
Start –
Starts the OpenSBC Service
-
Stop –
Stops the OpenSBC Service
-
Debug
– OpenSBC can also run as a “Foreground
Process” by using “debug” as the sole
argument.
[Previous] [Next]
[Contents]
|