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: roberto....@gmail.com
Hi. I can build and run the csipsimple application without problems if I use the downloaded library. When I used the lib built by myself the application crashes here:
it trows an null pointer exception. I followed your the instructions to download the lib and build it
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: r3gis...@gmail.com
@roberto : check that the build you generate yourself is put in the correct directory. Depending on your folders organisation you may have to modify the projet path in the Application.mk file to make the output directory be the CSipSimple (java part) directory.
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: roberto....@gmail.com
Thank you for your replay. I think I put the .so file in the correct folder because I did it manually and I replaced the file that was already there and that works.
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: roberto....@gmail.com
In the meanwhile I have another question and I hope you can help me. I tried to use the package org.pjsip.pjsua in my own application.By using the downloaded library I managed to use the pjsip lib to register a UA. The problem is that when I call the function call_make_call I see another exception that I find weird. It's a NoClassDefFound?. The class that can't be found is com.csipsimple.service.SipService?. The problem is that I don't understand where that class comes from because I don't have it in my code. Searching in the .so file I found the error message I could see in the log. I can't find that string in my built library. So the question is: why is the downloaded library looking for that class? And why the code under svn is not? Thank-you in advance Roberto
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: roberto....@gmail.com
One thing I can add is that I see an error log from android_jni_dev complaining about the missing class but I cannot find that error string in the cpp file
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: r3gis...@gmail.com
You are probably not up to date either on the java or the cpp part. I recently change the way the native library ask the java part to setup audio mode to in call. Previously it was done by calling a static member of the SIP service defined in the java space. It was not clean but quicker to develop. Now that I have more time for non-features implementation I have refactored this part to do something much more clean by calling back the Callback glue from the dev.
So update both java -I guess it's your java part that is not up to date- and c source to latest svn version, and it should work then. There is no magic, if nightly build server build and run, it means than latest SVN version are fine cause nightly build server acts automatically following a simple script that is more or less what is shown in this wiki page (more or less cause it builds several targets).
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: roberto....@gmail.com
OK thank-you! Now it's clear why both things were not working...
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: marcello...@gmail.com
@r3gis
Can you give a short hint about MY_ANDROID_DEV flag in apps/pjsip/Application.mk? What does 1 or 2 mean?
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: r3gis...@gmail.com
You're right I should explain a little bit more the Application.mk file. I'll update this page to reflect current dev status.
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: khayer.b...@gmail.com
my project's developping a sip application in android & I want to build on csipsimple, so i need documentation of different packages & classes ... if you can advise me to build my code by which i started ... 10x
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: r3gis...@gmail.com
@khayer : are you aware about the fact csipsimple is under GPL license? You should read licensing wiki page and check you can release your project under GPL too. Other solution would be to use CSipSimple as a third party application that provide SIP. If you choose this method there is an API provided by csipsimple to allow third party application to use sip on android without redevelopping everything.
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: khayer.b...@gmail.com
the license's in the form of a header that is added on top of each class. I saw the site where I can get it. so how can i use/find API CSipSimple as a third party.
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: Broi.jul...@gmail.com
Hi !
I'm trying to make csipsimple run on my emulator. At the begining i had an error saying : Errors occurred during the build. Errors running builder 'Integrated External Tool Builder' on project 'csipsimple'. Variable references empty selection: ${project_loc} Variable references empty selection: ${project_loc}
I rode above that i should delete .externalToolBuilders in my project and did it but now i get :
Errors occurred during the build. Errors running builder 'Integrated External Tool Builder' on project 'CSipSimple'. The builder launch configuration could not be found. The builder launch configuration could not be found.
Could you please help me ?
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: zahir.ab...@gmail.com
HI! As someone mentioned that "there is an API provided by csipsimple to allow third party application to use sip on android without redevelopping everything" from where i get this API . Please Guide us. i also want to use csipsimple api for android.
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: r3gis...@gmail.com
@joyit., @saquib : that was a bug, fixed it. Thx for reporting. Do not hesitate to contribute the source code. Remember, the project is released under GPL and contributions are welcome !
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: Broi.jul...@gmail.com
Hello !
A bug is still remaining. When go to settings -> Network the program craches. (ExceptionInInitializerError?)
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: zahir.ab...@gmail.com
hi guys, i wanna use API provided by csipsimple, as i am really new to android, i am facing two problems with aidl files.
1. "ipSipService.aidl defines methods; for example; "void sipstart ()" , "getSipProfileState" and so on for other methods". for this service i could not find where these functions are implemented after proper search in the api. May be new implementation for me.
2. For isipconfiguration service i understand how develpors is defining it and where but i am unable how to use particular functions as desirbed below
"iSipConfiguration.aidl defines a method "getAccount ()", "addOrUpdateAccount", "setpreferencestring" i don't know how to call these functions in my app using the remote service. as functions arguments seeming complex to me. I treid on the net alot to find how to use parceable aidl files work and call, even in the documentation, but it could not help alot. any help will be great appriciated. Regards zaheer
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: manu.gok...@gmail.com
Hi all, i an trying to build the Android app by copying the pjsip libraries from latest nightly apk. I copied the lib folder and its contents to the CsipSimple? foler of my Java project. But still when i build the Java project, the generated apk do not contain the lib folder and hence the Sip Stack initialisation fails when i launch the apk in my device.
Do i need to change any configuration in the java project after i copy teh lib folder from the latest apk to Java project folder?
appreciate any pointers.
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: inaam.ka...@gmail.com
Hi, I have the same problem as Robert : <<... I tried to use the package org.pjsip.pjsua in my own application.By using the downloaded library I managed to use the pjsip lib to register a UA. The problem is that when I call the function call_make_call I see another exception that I find weird. It's a NoClassDefFound??. The class that can't be found is com.csipsimple.service.SipService??. The problem is that I don't understand where that class comes from because I don't have it in my code. Searching in the .so file I found the error message I could see in the log. I can't find that string in my built library. So the question is: why is the downloaded library looking for that class? And why the code under svn is not? ...>>
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: greene...@gmail.com
Hi
I can build the application from svn, and get the application to run and connect to my opensips server and make calls and send instant messages using my 2.2 Droidx device.
However using same build, on the emulator I can never get the Service com.csipsimple.service.SipService? to run on the emulator. Hence I never can use the app on emulator and continue to test and develop the app.
Are there any settings I need to use, can someone please help me find pointers to get the app to work on emulator.
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: r3gis...@gmail.com
activate the I'm allowed over 3g option. emulator only simulates a 3g connection .
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: greene...@gmail.com
Thanks Heaps.
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: r3gis...@gmail.com
Disable G7221 option if you want to make a tls build. TLS and G7221 are not compatible yet.
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: ramesh.s...@gmail.com
I had tried all the ways that i know for building the library , but its in vein , pls someone help me out ... We are following these steps for Build the pjsip library for android:
•Official android NDK:wget http://dl.google.com/android/ndk/android-ndk-r5b-linux-x86.tar.bz2 tar -xvf android-ndk-r5b-linux-x86.tar.bz2 mv android-ndk-r5b pjsip_android cd pjsip_android/ 1.Get only the relevant part of the svn svn checkout http://csipsimple.googlecode.com/svn/trunk/pjsip_android/apps apps cd ../../ Note : the source is also available in a Bazar mirror Build the library
•Go into the pjsip_android directory: cd pjsip_android •Launch a make (but it will generate only one target lib) make APP=pjsip
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: pankajja...@gmail.com
Hi, I am trying to build the library with TLS/ZRTP support with MY_USE_TLS := 1 and have the following errors
apps/pjsip/project/build/..//pjlib/build/..//src/pj/ssl_sock_ossl.c:45:25: error: openssl/bio.h: No such file or directory apps/pjsip/project/build/..//pjlib/build/..//src/pj/ssl_sock_ossl.c:46:25: error: openssl/ssl.h: No such file or directory apps/pjsip/project/build/..//pjlib/build/..//src/pj/ssl_sock_ossl.c:47:25: error: openssl/err.h: No such file or directory apps/pjsip/project/build/..//pjlib/build/..//src/pj/ssl_sock_ossl.c:48:28: error: openssl/x509v3.h: No such file or directory
I am building this on Mac and Openssl is already installed. If we use MY_USE_TLS := 0 everything is ok.