Giter Club home page Giter Club logo

pjsipscript-ios's Introduction

pjsipScript-iOS

A script that automatically generates PJSIP static libraries with SSL enabled and header files for iOS.

References:

What is PJSIP? (Taken from http://www.pjsip.org/)

  • PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. It combines signaling protocol (SIP) with rich multimedia framework and NAT traversal functionality into high level API that is portable and suitable for almost any type of systems ranging from desktops, embedded systems, to mobile handsets.

What is pjsipScript.sh?

  • A script developed to ease building PJSIP libraries which can be used for developing iOS VoIP applications. There are ready scripts available for Android as well here.

What this pjsipScript.sh do?

  • Run build-libssl.sh, this script will download, compile and build OpenSSL for all available iOS device architectures (arm64, armv7 and armv7s) and iOS Simulator(i386 and x86_64) in order to add support for SSL this is must. It will generate a fat library for libcrypto.a and libssl.a placed at location “${working_dir}/lib/“. NOTE: If in case you don’t want SSL support, all you need to do is remove below line of code from pjsipScript.sh and run the script:
    1. ./build-libssl.sh (line no. 4)
    2. #define PJ_HAS_SSL_SOCK 1 (line no. 30)
  • Checkout available source code from SVN ​https://svn.pjsip.org/repos/pjproject/trunk
  • Create config_site.h with necessary line of code
  • Build static libs for below target architectures:
    1. "arm64" "armv7" "armv7s" for device
    2. "i386" "x86_64" for simulator
  • Generate a fat library for all different PJSIP static libs and place them under single folder at path ${working_dir}/trunk/lib. Even above mentioned ssl libs are copied under this very folder.
  • Copy all required header files to one path i.e. ${working_dir}/trunk/pjsip-include

How to use generated libs and include files?

Just run the script from terminal and sit back till it has completed its process/ execution. Now, we have folder name “lib” and “pjsip-include” in “${working_dir}/trunk”, lib folder contains all required static libs and pjsip-include folder contains all required header files. Later just follow below instructions to integrate generated libs to your project. These instructions are taken from Xianwen's blog which I’ve mentioned in references (How to Make an iOS VoIP App With Pjsip: Part 4)

  • Simply drag those libxxx.a into the Frameworks group, and Xcode will automatically link them during compile.
  • To use the “pjsip-include”, copy this folder into the project directory. This way, our project can be successfully compiled regardless of the outer environment.
  • In order to use pjsip, you need to update your Header Search Path of your project, so that it can reach all the header files contained in the “pjsip-include”
  • Pjsip makes use of the iOS built in frameworks, to perform tasks like using the network, audio, etc. We need to link these required frameworks in order to run our app. Add these frameworks in the “Build Phases” tab
    1. AVFoundation.framework
    2. CFNetwork.framework
    3. AudioToolbox.framework
  • Build your project and it should build successfully.

You can go through Xianwen's blog “How to Make an iOS VoIP App With Pjsip: Part 5” which explains very nicely on how to implement call handling using above integrated libs and header files.

Thanks To

  1. Xianwen Chen for providing easy to understand and very helpful articles on VoIP on Xianwen's blog.

  2. http://www.pjsip.org/ for very informative documentation and tutorials for each platform.

pjsipscript-ios's People

Contributors

hemantkadam avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.