I was needed to somehow add VoIP into my Level4 Project. It made me search all over Google for some existing work. And found this project Siphon that enables SIP voice calls. There are few guides on Siphon Wiki, still I was stuck with linking issues for nearly a month. After trying lots of hours I gave up all that trying to compile for iPhone 3.0. Again yesterday, I have been trying to compile free open source project Siphon to run on iPhone Simulator and iPhone all day. It was really difficult task having the Siphon team done lots of effort on making an Open Source project, still just to compile it. My lack of knowledge in C++ or C made this even harder. Finally lots of hours invested, days wasted now I have it running on my iPhone. So may be this will help some newbie on low level coding (C, C++) other than Objective-C to run this amazing app compiled on your iPod or iPhone. Having credits on your SIP account you may convert your iPod into an iPhone on WiFi.
Siphon Project on Google Code

Siphon has wiki pages saying how it could compile to iPhone OS 2.x but still it seems to be not enough and I couldn’t make it success by any means unfortunately.
Steps to follow for Newbie.
1. We need to compile and build required libraries from compiling PJSIP project first. There are few things I did wrong here. I have compiled for Device and tried to run it on Simulator without writing my own configure script. Trying to use same one on PJSIP Then I got so many linking issues that I couldn’t understand WTF is this.
2. Let’s compile PJSIP for iPhone first and build libraries required and then to Simulator as well with a more change to configure script. Before going into Siphon project.
2-1. Download PJSIP source code from here. Now it includes configure script for iPhone that you need to edit once for iPhone again for Simulator.
svn co http://svn.pjsip.org/repos/pjproject/trunk pjproject
2-2. Create a new file pjlib/include/pj/config_site.h. Add following code into it.
#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>
2-3. If you go to pjproject folder, you will see configure-iphone script. Need to edit this to compile for your desired iPhone SDK. Open this with your favorite Text editor, mine was TextWrangler.
$ edit configure-iphone
2-4. Hard code the $DEVPATH and $IPHONESDK. So you don’t need to export those environment variables. If you not specify $IPHONESDK it will be the OS default. ex.
DEVPATH=/Developer/Platforms/iPhoneOS.platform/Developer
IPHONESDK=iPhoneOS3.0.sdk
2-5. Now you can easily build the libraries that will be stored in lib directories of folders, pjlib, pjlib-util, pjmedia, pjnath, pjsip, third_party. Check once again about your configure-iphone script for correct paths and compile and build libraries using following commands simply.
$ cd /path/to/your/pjproject/dir
$ ./configure-iphone
$ make dep && make clean && make
2-6. Now you have libraries for iPhone. Make a copy of pjproject folder and rename it to pjproject_sim. Here we are going to have our iPhone Simulator libraries built
$ cd /path/to/your/pjproject_sim/dir
$ edit configure-iphone
2-7. Hard code the $DEVPATH and $IPHONESDK. This time they should the paths for Simulator SDKs. And one more change here, that I was missing. caused all sorts of problems.
2-8. Search for 'ls -d ${SDKPATH}/usr/lib/gcc/arm-apple-darwin*' in configure script and replace it with following that way you could build correct libraries for simulator.
ls -d ${SDKPATH}/usr/lib/gcc/i686-apple-darwin*
2-9. Great now you have all libraries needed in folders, pjproject and pjproject_sim.
3. Now let’s go and checkout siphon project.
svn checkout http://siphon.googlecode.com/svn/trunk/ siphon
4. There was a compilation issue in Siphon code, that you could ignore by doing a little trick, I don’t know whether its right or wrong. But it works perfect. Otherwise, project didn’t compile for me. Open Siphon2 folder iPhone project on iPhone then go to call.m. Search for PJSIP_CRED_DATA_MJ_DIGEST and replace it with PJSIP_CRED_DATA_DIGEST.
5. Now add all the library .a files in following folders to the project. pjlib, pjlib-util, pjmedia, pjnath, pjsip, third_party.
6. Now follow the screen shots carefully. If you build for simulator use simulator library files (pjproject_sim folder) and include files to library and header search paths, other wise use libraries & include files in pjproject folder.

Make a duplicate of Debug to run in iPhone, let debug to be used by used by simulator libraries.

Let’s add Library Search Paths & Header Search Paths for siphon target. Following are examples of my locations for simulator. For device its the location to pjproject folder we built and stored our library files for Device.



Change CYDIA=0 in Preprocessor Macros

7. Add the Settings Bundle for your project as given in this following link. It works perfect then.
Siphon and Settings Bundles
8. Now you could run it on your iPhone or Simulator. Use a free SIP service to create SIP accounts to test the app. I have used, Sip2Sip
NOTES ABOUT COMPILING “PJSIP”
Following link contains very useful information updated about how to get PJSIP compiled for iOS. Please refer to the pjproject Wiki page below.
Building for Apple iPhone, iPad and iPod Touch
* IMPORTANT: I had to follow additional step to get things done for iOS Simulator. before run ./configure-iphone script
export DEVPATH=/Developer/Platforms/iPhoneSimulator.platform/Developer
export CC=$DEVPATH/usr/bin/gcc
export CFLAGS="-O2 -m32 -miphoneos-version-min=3.0" LDFLAGS="-O2 -m32"