IOS development: Using pjsip to develop VoIP applications

Source: Internet
Author: User

From: http://www.wuleilei.com/blog/327

VoIP is used in recent projects. The full name of VoIP is voice over Internet protocol, that is, network telephone, which is frequently used in daily life, such as Skype.

There are not many VoIP libraries that can be used on the iPhone. At first, we were prepared to use lipphone, but the compilation was too slow. After compiling for n times, we finally gave up. Then I tried to use pjsip, but the operation was successful. I simply recorded the process and operated it on the official website :)

I. environment requirements:

SDK 4.xis recommended for iPhone applications, and 3.x is also supported. iPad applications only support SDK 3.2 or above.

2. Preparations before Compilation:

1. Download pjsip source code;

2. Create config_site.h in the/pjsip/pjlib/include/PJ/directory and paste the following code into the directory:

#define PJ_CONFIG_IPHONE 1#include <pj/config_site_sample.h>

3. Compile pjsip:

Run the following command on the terminal:

$ cd /path/to/your/pjsip/$ ./configure-iphone$ make dep && make clean && make

4. Compile the pjsip library for the simulator:

Run the following command on the terminal:

export DEVPATH=/Developer/Platforms/iPhoneSimulator.platform/Developerexport CC=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0CFLAGS="-O2 -m32 -miphoneos-version-min=4.0" LDFLAGS="-O2 -m32" ./configure-iphonemake dep && make clean && make

5. Compile the sample:

Compile the project in the directory pjproject/pjsip-apps/src/ipjsua. If the above steps are successful, you can see the main interface of the app.

6. Test the call:

1. Set up a VoIP Server:

There are a lot of free sip servers on the Internet. I use the free version of minisipserver. The installation is very simple, and the next step is OK as prompted on the interface. After installation, do not forget to create an account (Here we use 100 and 101 as an example ).

2. Install the VoIP client:

I use 3cx phone client. Login Account 100.

3. log on to account 101 on the pjsip page of the iPhone:

+aYour SIP URL: (empty to cancel): sip:101@192.168.1.1URL of the registrar: (empty to cancel): sip:192.168.1.1Auth Realm: (empty to cancel): *Auth Username: (empty to cancel): 101Auth Password: (empty to cancel): 123456

And call 100:

+bEnter buddy's URI: (empty to cancel): sip:100@192.168.1.1mMake call: 1

The call operation can also be simplified:

mMake call: sip:sip:100@192.168.1.1

At this moment, do you feel very excited when you hear the call!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.