For any question on how to build PLEASE join the development group Also, if you build CSipSimple, you should first read the Licensing wiki page
The application has two distinct parts :
If you are a java developer and you are not interested in building the sip stack, there is an alternate - not easy to maintain - way to build by getting auto-generated swig java class and the dynamic library from nightly build website. Please search the dev google group to get info about this method that is not recommended.
Some very important note : CSipSimple is released under GPL license. Be really aware about what does that mean before developing. Read Licensing wiki page.
So if you plan to improve CSipSimple and redistribute it, you MUST release your source code. As we (CSipSimple developers) are open to any contribution, I'd advise you to directly contribute the CSipSimple project. All contributions are welcome !!!
You'll need following package you may need to adapt depending to your distribution packages names
subversion git quilt unzip wget swig2.0 python make yasm
You also have to install the android NDK and the android SDK. I do not details here how to install android NDK and SDK. Please read Android documentations about that :
Android SDK doc
To install correctly the android NDK, please add the NDK to your path. I usually recommend to add these lines to your .bashrc :
export ANDROID_NDK=/_path_to/android-ndk-linux/
export ANDROID_SDK=/_path_to/android-sdk-linux/
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK
Anyway the naming of ANDROID_NDK export is important in the build of one part of the application. You can also do that only at build time, but if you use to develop for android, it's a good idea to do that.
Don't forget to install SDK and NDK dependencies as well. For example, on ubuntu 64bits system you will need ia32-libs
for both NDK and SDK.
Thx to Benjamin and Magnus for the contrib on these instructions
For main instructions it's almost the same as for Linux.
Packages are a little bit more complicated to get however. The two more difficult to get are quilt and swig2.0.
DUE TO A BUG IN MACPORT with quilt 0.6 -- DON'T USE THE FOLLOWING.
To install quilt you should install MacPorts first (http://www.macports.org). Installation instructions
If you work behind a proxy follow these instructions additionally MacPorts behind proxy
And then install quilt using :
sudo port selfupdate sudo port install quilt
Instead build it from source
Download quilt from latest source available here : http://download.savannah.gnu.org/releases/quilt/ And then execute
./configure # optionally add prefix here to be able to install in your env make make install # optionally do that in sudo if target is read only for the current user
To install swig 2.0 : download from source available here : http://www.swig.org/download.html And then execute
./configure # optionally add prefix here to be able to install in your env make make install # optionally do that in sudo if target is read only for the current user
Finally, since csipsimple make file has some crappy hard coded link to swig tool for now, you have to add a symbolic link to allow your system to recognize swig2.0 to be the same than swig. The faster way is probably to make a symlink:
sudo ln -s <path to swig> /opt/local/bin/swig2.0
Other packages (subversion git unzip wget python make) should be easier to install but are also required on Mac.
Continue instructions of Linux build. It should go the same way once packages are installed.
I don't not explain how to build for Windows because if you really want to develop you probably don't and shouldn't use Windows. However it should be possible to build it for Windows too. To do so, you must understand Makefile syntax and have a look on commands to run to build the project. It's most about checkouting other projects using git, getting zip files from elsewhere, applying patches, and generating a swig interface. Maybe using cygwin it's easier.
So, in this case the easiest way is to use the virtual machine as described in following chapter.
If you want to have an environment with everything required for CSipSimple you can use a Virtual Machine. Thanks to Dennis work, there is one ready for direct use :
You can get root privilege with sudo command. The password is equals to the username, which should be "user".
Using, this machine, you should still read the following step for your complete understand of how things work, but don't need to run the commands since everything was already done. The step about how to update may be necessary to read if you want to be able to update to latest source code.
Launch android sdk manager to download and install the SDK of versions listed as target in files : CSipSimple project.properties and ABS project.properties.
We assume here you are in your folder where you put dev with a shell.
Start with a checkout of source code
# Checkout CSipSimple incl. all svn dependancies svn checkout http://csipsimple.googlecode.com/svn/trunk/ CSipSimple-trunk
It will create a folder CSipSimple-trunk with the following folder structure containing all source code and SVN dependencies:
Go into source folder
cd CSipSimple-trunk/CSipSimple
Launch make to build the native part of the library and dependancies
make
If needed build video support libary (Optional)
make VideoLibs
If needed build CodecPackLibs (Optional)
make CodecPackLibs
If needed build CodecG729 (Optional)
make CodecG729
Note that you can use make -j4 to make things go faster if your computer allow that
If you get a problem at this point, it could be because there is a missing package on your system install. Since at this point it will do git, swig2.0, wget, unzip, quilt... there is chance one of these apps is missing. If so, try to get that installed on your system first. About swig you may have to build and install it by yourself because version 2.0 is recent.
If everything goes well, congrats, you have created the native libraries for CSipSimple (it will also produce native libs for plugins apps).
Alternate way -- most developers should ignore this section
This method is not officially supported. However it's helpful if you have not knowledge in native development or GNU toolchains.
The native library build produce two things :
org.tar.gz and unpack it to have the org.pjsip package in the src folder of CSipSimple.
To get the .so files, download latest nightly build from nightly build website and unpack the apk file (apk files are just zip files). Then get lib/ARCH/.so files and copy it into CSipSimple libs/ARCH/.so
There is several ways to build the apk once the native library is built. You can either use an IDE that integrates android development toolchains (described in details for Eclipse) or you can use Ant (for command line environments).
You can now open the projects with Eclipse or your preferred java IDE that is able to build a regular android application.
Import the projects into Eclipse as an Android projects (right click > import > Android project from source) and select the folder CSipSimple-trunk.
Pick at least SipHome and ActionBarSherlock. Add CSipSimpleXXX-projects if needed.
Then when ADT plugin will ask you which android version you'd like to link on, you should check the "project.properties" file of each project you are importing (do that both for CSipSimple and ActionBarSherlock). You can have a look to online files here : CSipSimple project.properties and ABS project.properties. Obviously you need these versions to be installed by Android SDK Manager if not already done.
Don't be worried about the fact it's high values! It does not mean that your app will not run with older android versions. Actually, it will be able to run on android 1.6! MinSdk version and targetVersion are not linked. Backward compatibility is ensured by code not by the lib you link on while building.
Finally, you need to add the project dependencies to "SipHome", which is at least "ActionBarSherlock" and optional native lib projects. In Eclipse: right-click on "SipHome"-> Properties -> Java Build Path -> Projects.
If you encounter some problems about override of methods, ensure that your Eclipse env setup projects for "java 1.6" or upper. -You should also check that per project if necessary-
You should now be able to launch the application as an Android application.
This is particularly useful for a pure command line environment. It's used on the automatic nightly build server for example.
Directory structure:
Steps:
android update project -p ./
android update project -p ./
You have to create your own ant script based integrating ant scripts from the SDK. You can get inspired of what is produced by command line tool of the sdk http://developer.android.com/guide/developing/projects/projects-cmdline.html.
Some interesting tutorial to follow : http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html.
You can also add additional ant task such as the one made for automatic revision in code number of the manifest.
If you would like to update your checkout of CSipSimple-trunk to the current SVN revision use the provided make tasks! This command will remove all applied quilt patches from SVN dependencies, update the SVN dependencies and CSipSimple-repository, and re-apply the new patches. All native libraries must be re-build.
make update && make
If you want to automate the build of the native part as well as the build of the android project, you can do that by installing CDT on eclipse and then on the android project do : New Project->Other->C++->Convert to C++ and tells it's a makefile project.
OldWayToBuild wiki page gives for reference the old way to build the library on older csipsimple versions. It's not supported anymore in development process.
Wiki: BuildGplBrandedVersion
Wiki: IntegrateExistingPjsipModule
Wiki: Licensing
Wiki: MainSideBar
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: debangan...@gmail.com
hi, I have followed the exactly same way as described above....it creates account successfully under local network....but the account is not registered successfully....it shows inactive with orange bar.....help me with this...
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: sram...@gmail.com
Can you give the solution for this issue i was trying to resolve i could not able to do where is the issue and i am using ubuntu 12.04 and android-ndkr9c
Applying patch 002pjsip-webrtc-aec.diff patching file sources/aconfigure patching file sources/aconfigure.ac patching file sources/build/rules.mak Hunk #1 FAILED at 167. 1 out of 1 hunk FAILED -- rejects in file sources/build/rules.mak patching file sources/pjmedia/build/os-auto.mak.in patching file sources/pjmedia/build/os-darwinos.mak Hunk #1 FAILED at 59. 1 out of 1 hunk FAILED -- rejects in file sources/pjmedia/build/os-darwinos.mak patching file sources/pjmedia/build/os-linux.mak Hunk #1 FAILED at 53. 1 out of 1 hunk FAILED -- rejects in file sources/pjmedia/build/os-linux.mak patching file sources/pjmedia/build/os-win32.mak Hunk #1 FAILED at 55. 1 out of 1 hunk FAILED -- rejects in file sources/pjmedia/build/os-win32.mak patching file sources/pjmedia/include/pjmedia/echo.h Hunk #1 FAILED at 78. 1 out of 1 hunk FAILED -- rejects in file sources/pjmedia/include/pjmedia/echo.h patching file sources/pjmedia/src/pjmedia/echo_common.c Hunk #1 FAILED at 125. Hunk #2 FAILED at 177. 2 out of 2 hunks FAILED -- rejects in file sources/pjmedia/src/pjmedia/echo_common.c patching file sources/pjmedia/src/pjmedia/echo_internal.h Hunk #1 FAILED at 77. 1 out of 1 hunk FAILED -- rejects in file sources/pjmedia/src/pjmedia/echo_internal.h patching file sources/pjmedia/src/pjmedia/echo_webrtc_aec.c patching file sources/third_party/build/os-auto.mak.in patching file sources/third_party/build/os-darwinos.mak Hunk #1 FAILED at 5. 1 out of 1 hunk FAILED -- rejects in file sources/third_party/build/os-darwinos.mak patching file sources/third_party/build/os-linux.mak Hunk #1 FAILED at 5. 1 out of 1 hunk FAILED -- rejects in file sources/third_party/build/os-linux.mak patching file sources/third_party/build/webrtc/Makefile patching file sources/third_party/build/webrtc/os-auto.mak.in patching file sources/third_party/build/webrtc/os-darwinos.mak patching file sources/third_party/build/webrtc/os-linux.mak patching file sources/third_party/build/webrtc/os-win32.mak Patch 002pjsip-webrtc-aec.diff does not apply (enforce with -f) make1?: * [.patched_sources] Error 1 *
make: * [jni/pjsip/.patched_sources] Error 2 *
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: qincunr...@gmail.com
Hello. I have just updated to the last revision and I have a problem running "make". I am getting this error: fatal: unable to access 'https://android.googlesource.com/platform/external/aac/': Failed to connect to android.googlesource.com port 443: Operation not permitted
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: jery....@gmail.com
hello can i build with only g722 codec.(passing options in the make stage)
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: normal.t...@gmail.com
How to build the codec pack? I built CSIPSIMPLE with make CodecPackLibs? but it seems not to be in the final apk. How to make that codecpack apk?
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: blackeir...@gmail.com
can anybody customise csipsimple for me, and what's the price, anyone available mail me on blackeire123@gmail.com. thanks
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: adrian.s...@gmail.com
hi ... i've cheked out latest trunk on my ubuntu12.04 x32 and VeideoLibs? are going bananas on all architectures. please find the error below.
armeabi? SharedLibrary? : libpj_video_android.so jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1086: error: undefined reference to 'av_strerror' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1324: error: undefined reference to 'avcodec_close' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1325: error: undefined reference to 'av_free' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1328: error: undefined reference to 'avcodec_close' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1329: error: undefined reference to 'av_free' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1430: error: undefined reference to 'avcodec_get_frame_defaults' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1455: error: undefined reference to 'av_init_packet' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1460: error: undefined reference to 'avcodec_encode_video2' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:409: error: undefined reference to 'av_opt_set' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:427: error: undefined reference to 'av_opt_set_int' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:434: error: undefined reference to 'av_opt_set_int' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:442: error: undefined reference to 'av_opt_set' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:445: error: undefined reference to 'av_opt_set' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1116: error: undefined reference to 'avcodec_alloc_context3' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1125: error: undefined reference to 'avcodec_alloc_context3' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1185: error: undefined reference to 'avcodec_open2' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1200: error: undefined reference to 'avcodec_open2' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1222: error: undefined reference to 'avcodec_close' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1223: error: undefined reference to 'av_free' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1228: error: undefined reference to 'avcodec_close' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1229: error: undefined reference to 'av_free' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1680: error: undefined reference to 'avcodec_get_frame_defaults' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1683: error: undefined reference to 'av_init_packet' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:1705: error: undefined reference to 'avcodec_decode_video2' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:629: error: undefined reference to 'avcodec_register_all' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c:632: error: undefined reference to 'av_codec_next' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/converter_libswscale.c:172: error: undefined reference to 'sws_freeContext' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/converter_libswscale.c:152: error: undefined reference to 'sws_scale' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/converter_libswscale.c:112: error: undefined reference to 'sws_getContext' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/ffmpeg_util.c:113: error: undefined reference to 'av_log_get_level' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/ffmpeg_util.c:88: error: undefined reference to 'av_log_set_level' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/ffmpeg_util.c:89: error: undefined reference to 'av_log_set_callback' jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/ffmpeg_util.c:90: error: undefined reference to 'av_register_all' collect2: error: ld returned 1 exit status make1?: * [obj/local/armeabi/libpj_video_android.so] Error 1 *
Please help!