HowTo compile sipXezPhone

From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia

Jump to: navigation, search
Important note:

sipXezPhone is still work in progress. sipXezPhone is based on the sipXtapi library (SIP stack and media framework). A first version works on the Microsoft Windows platform. The core developer team is looking for help to add features to sipXezPhone and port it to additional platforms, especially Linux and Max OS X. Also, there still is no good framework available in open source for packet loss concealment and jitter buffer management.


Contents

[edit] HowTo compile sipXezPhone from source for various platforms

This page describes how to build and install sipXezPhone from source. This process is somewhat complicated and requires a number of 3rd party software packages and manual steps.

If you have questions or problems, please consult the latest version of this document and the sipXtapi dev mailing list. The sipXtapi-dev mailing list is searchable - please search before posting your question.

[edit] Getting the Source Code

Make a new directory which will be home to your SIPfoundry projects. For example, create a "c:\sipfoundry" directory.

Using subversion from the command line, get the needed SIPfoundry projects by running the following commands from the command line.

 cd \sipfoundry
 svn checkout http://scm.sipfoundry.org/rep/sipX/branches/sipXtapi .

The sipXezPhone code and the Visual Studio project files are located in the "sipXcallLib\examples\sipXezPhone" directory.

[edit] Microsoft Windows Instructions

The sipXezPhone depends on other SIPfoundry projects such as sipXportLib, sipXtackLib, sipXmediaLib, and sipXcallLib. For more information, please see the build and install documentation for those projects. The top-level sipXezPhone.sln will configure and build all of the dependent projects.

[edit] Installing 3rd party components

[edit] Required Software

MSVC        Microsoft Visual Studio.NET 2003 (or greater).
PCRE        Perl Compatible Regular Expression Library
wxWidgets   Open-source, platform independent GUI library (does not required for building libraries only)

[edit] Installing PCRE

Latest tested version: 6.4

You will need the following PCRE packages/files:

 pcre-6.4-1.exe : Complete package, except sources

You can download the directly from gnuwin32:

 http://gnuwin32.sourceforge.net/packages/pcre.htm

Install this package and add the PCRE paths to your MSVC environment (assuming installation into C:\Program Files\GnuWin32):

Additional "Include files":

  C:\Program Files\GnuWin32\include

Additional "Library files":

  C:\Program Files\GnuWin32\lib

In MSVC, select "Options" from the "Tools" menu, select the "Projects" folder, select "VC++ Directories", and then select either "Include files" or "Library files" from the right-aligned dropdown list.

[edit] wxWidgets

sipXtapi comes bundled with wxWidgets 2.6.3, which shuld be enough to build sipXezPhone. Headers and library files of wxWidgets could be found in "sipXcallLib\examples" directory under sipXtapi source tree.

[edit] Building C++ Code

Open "sipXezPhone.sln" in MSVC, verify that "sipXezPhone" is the default project and build. You should end up building "sipXezPhone.exe", "sipXtapi.dll" and the dependent .libs.

NOTE: There is currently and issue where the projects in the sipXezPhone solution may attempt to build in the WRONG order!! If this happens, just build (dont re-build) a second time. The second pass build should succeed.

[edit] Adding Environment Variables

At runtime, the softphone needs to be able to find the pcre3.dll, and related dependencies. Add PCRE dll path to your Windows PATH environment variable. From a command prompt, this can be added by entering the following (assuming installation into C:\Program Files\GnuWin32):

 PATH=%PATH%;C:\Program Files\GnuWin32\bin

[edit] Launching the sipXezPhone

After a build, sipXezPhone.exe will be created in the sipXcallLib\examples\sipXezPhone directory. The working directory for sipXezPhone must have in it the sipXtapid.dll. Either copy the sipXtapid.dll to the directory containing sipXezPhone.exe, or point your working directory to sipXtapi's build directory.

[edit] Troubleshooting: Build Problems

[edit] RTTI must be enabled

Many of the projects are starting to use the dynamic_cast<>() mechanism to provide runtime type checking. RTTI must be enabled on all projects using dynamic_cast<>() and related functionality. By default, almost all of the sipX WIN32 projects now enable RTTI.

Failing to enable RTTI results in odd crashes/exceptions. Generally "rtti" or "RTDynamicCast" is found in stack trace.

[edit] wxWidgets Unresolved Externals and MSVC 6.0

If your wxWidgets library was not compiled with the /MT compile flag (multi-threaded), may experience 'unresoved external' link errors such as:

unresolved external symbol __ftol2

Rebuild wxWidgets with the following command lines

nmake -f makefile.vc clean FINAL=1
nmake -f makefile.vc FINAL=1 CRTFLAG=/MD    (for the multithreaded DLL)

[edit] Linux Instructions

Building and running sipXezPhone on Linux is still work in progress. A first ebuild for Gentoo exists. There still seem to be a few remaining issues with the ALSA sound system. Any help would be greatly appreciated.


[edit] Building sipXezPhone on FC4

Here'a a bit more detailed info on how to build sipXezPhone on FC4. In general you should start out doing the same as is recommended in HowTo create a build environment for sipX. Additional dependencies for the phone GUI can be easily updated with yum:

sudo yum install gtk+devel

sipXezPhone depends on wxWidgets 2.4.2 for its GUI, so download wxGTK-2.4.2.tar.gz from [http::/www.wxwidgets.org http::/www.wxwidgets.org]. Unpack the source and now you should be able to build. In FC4 there is a slight problem that the wxWidgets do not build properly with gcc4 and you might get linker errors like shown below when trying to link sipXezPhone.

/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../libwx_gtk2-2.4.so: undefined reference to `wxwxListStringNode::~wxwxListStringNode()'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../libwx_gtk2-2.4.so: undefined reference to `wxwxMenuItemListNode::~wxwxMenuItemListNode()'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../libwx_gtk2-2.4.so: undefined reference to `wxwxMenuItemListNode::~wxwxMenuItemListNode()'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../libwx_gtk2-2.4.so: undefined reference to `vtable for wxFileProto'
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../libwx_gtk2-2.4.so: undefined reference to `wxwxListStringNode::~wxwxListStringNode()'

These are known problems and there are 2 patches for wxWidgets at https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=154958. Download both patches and patch your working copy of wxGTK-2.4.2. Then build and install the widgets.


Code: Building and installing wxWidgets
./configure --with-gtk
 make
 su
 make install
 ldconfig
 cp /usr/local/lib/libwx* /usr/lib
 exit

Be sure not to forget copying the libraries over to /usr/lib otherwise you'll get an error message when trying to start up sipXezPhone.

Now you should be ready to build sipXezPhone. You need the 5 libraries sipXportLib, sipXtackLib, sipXmediaLib, sipXmediaAdapterLib, and sipXcallLib. Use subversion to check them out into a working copy. For the first 4 libaries go into their root directory (in the order given above) and follow these steps:

Code: Building the libraries
autoreconf -if
 ./configure --prefix=<your prefix>
 make
 sudo make install

For sipXcallLib, which includes the sipXezPhone as an example, do the following:

Code: Building sipXcallLib and sipXezPhone
autoreconf -if
 ./configure --enable-sipx-ezphone --prefix=<your prefix>
 make
 sudo make install

If everything went well your sipXezPhone executable should be in sipXcallLib/examples/sipXezPhone.

[edit] Please help!

Find a problem in these docs? Have suggestions ... better yet a patch with changes? Please post to the sipXtapi mailing list.

Personal tools