Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation, either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see http://www.gnu.org/licenses/.
Getting Started: Building and Using PJSIP and PJMEDIA
[Last Update: $Date: 2007-02-02 20:42:44 +0000 (Fri, 02 Feb 2007) $]
Print Friendly Page
_________________________________________________________________
This article describes how to download, customize, build, and use the open
source PJSIP and PJMEDIA SIP and media stack. The online (and HTML) version
of this file can be downloaded from http://www.pjsip.org/using.htm
Quick Info
_________________________________________________________________
Building with GNU tools (Linux, *BSD, MacOS X, mingw, etc.)
Generally these should be all that are needed to build the libraries,
applications, and samples:
$ ./configure
$ make dep && make clean && make
Building Win32 Target with Microsoft Visual Studio
Generally we can just do these steps:
1. Visual Studio 6: open pjproject.dsw workspace,
2. Visual Studio 2005: open pjproject-vs8.sln solution,
3. Create an empty pjlib/include/pj/config_site.h, and
4. build the pjsua application.
Building for Windows Mobile
Generally these are all that are needed:
1. Open pjsip-apps/build/wince-evc4/wince_demos.vcw EVC4 workspace,
2. Create an empty pjlib/include/pj/config_site.h, and
3. build the pjsua_wince application.
Invoking Older Build System (e.g. for RTEMS)
Generally these should be all that are needed to build the libraries,
applications, and samples:
$ ./configure-legacy
$ make dep && make clean && make
Locating Output Binaries/Libraries
Libraries will be put in lib directory, and binaries will be put in
bin directory, under each projects.
Running the Applications
After successful build, you can try running pjsua application on
pjsip-apps/bin directory. PJSUA manual can be found in
http://www.pjsip.org/pjsua.htm page.
Table of Contents:
_________________________________________________________________
1. Getting the Source Distribution
1.1 Getting the Release tarball
1.2 Getting from Subversion trunk
1.3 Source Directories Layout
2. Build Preparation
2.1 config_site.h file
2.2 Disk Space Requirements
3. Building Linux, *nix, *BSD, and MacOS X Targets with GNU Build
Systems
3.1 Supported Targets
3.2 Requirements
3.3 Running configure
3.4 Running make
3.5 Cross Compilation
3.6 Build Customizations
4. Building for Windows Targets with Microsoft Visual Studio
4.1 Requirements
4.2 Building the Projects
4.3 Debugging the Sample Application
5. Building for Windows Mobile Targets (Windows CE/WinCE/PDA/SmartPhone)
5.1 Requirements
5.2 Building the Projects
6. Older PJLIB Build System for Non-Autoconf Targets (e.g. RTEMS)
6.1 Supported Targets
6.2 Invoking the Build System
7. Running the Applications
7.1 pjsua
7.2 Sample Applications
7.3 pjlib-test
7.4 pjsip-test
8. Using PJPROJECT with Applications
Appendix I: Common Problems/Frequently Asked Question (FAQ)
I.1 fatal error C1083: Cannot open include file: 'pj/config_site.h':
No such file or directory
1. Getting the Source Code Distribution
_________________________________________________________________
All libraries (PJLIB, PJLIB-UTIL, PJSIP, PJMEDIA, and PJMEDIA-CODEC) are
currently distributed under a single source tree, collectively named as
PJPROJECT or just PJ libraries. These libraries can be obtained by either
downloading the release tarball or getting them from the Subversion trunk.
1.1 Getting the Release tarball
_________________________________________________________________
Getting the released tarball is a convenient way to obtain stable version of
PJPROJECT. The tarball may not contain the latest features or bug-fixes, but
normally it is considered more stable as each will be tested more rigorously
before released.
The latest released tarball can be downloaded from the
http://www.pjsip.org/download.htm.
1.2 Getting from Subversion trunk
_________________________________________________________________
PJPROJECT Subversion repository will always contain the latest/most
up-to-date version of the sources. Normally the Subversion repository is
always kept in a "good" state. However, there's always a chance that things
break and the tree doesn't build correctly (particularly for the
"not-so-popular" targets), so please consult the mailing list should there
be any problems.
Using Subversion also has benefits of keeping the local copy of the source
up to date with the main PJ source tree and to easily track the changes made
to the local copy, if any.
What is Subversion
Subversion (SVN) is Open Source version control system similar to CVS.
Subversion homepage is in http://subversion.tigris.org/
Getting Subversion Client
A Subversion (SVN) client is needed to download the PJ source files from
pjsip.org SVN tree. SVN client binaries can be downloaded from
http://subversion.tigris.org/, and the program should be available for
Windows, Linux, MacOS X, and many more platforms.
Getting the Source for The First Time
Once Subversion client is installed, we can use these commands to initially
retrieve the latest sources from the Subversion trunk:
$ svn co http://svn.pjproject.net/repos/pjproject/trunk pjproject
$ cd pjproject
Keeping The Local Copy Up-to-Date
Once sources have been downloaded, we can keep the local copy up to date by
periodically synchronizing the local source with the latest revision from
the PJ's Subversion trunk. The mailing list provides best source of
information about the availability of new updates in the trunk.
To update the local copy with the latest changes in the main PJ's
repository:
$ cd pjproject
$ svn update
Tracking Local and Remote Changes
To see what files have been changed locally:
$ cd pjproject
$ svn status
The above command only compares local file against the original local copy,
so it doesn't require Internet connection while performing the check.
To see both what files have been changed locally and what files have been
updated in the PJ's Subversion repository:
$ cd pjproject
$ svn status -u
Note that this command requires active Internet connection to query the
status of PJPROJECT's source repository.
1.3 Source Directories Layout
_________________________________________________________________
Top-Level Directory Layout
The top-level directories (denoted as $TOP here) in the source distribution
contains the following sub-directories:
$TOP/build
Contains makefiles that are common for all projects.
$TOP/pjlib
Contains header and source files of PJLIB. PJLIB is the base
portability and framework library which is used by all other
libraries
$TOP/pjlib-util