Latest 0.1.1
Homepage https://github.com/miche-atucha/taresip
License BSD
Platforms ios 7.0
Frameworks CFNetwork, AudioToolbox, AVFoundation, CoreMedia, SystemConfiguration
Authors

TareSIP

Platform: iOS 7+
Cocoapods compatible
License: BSD
[Release version]()

Cocoapod for baresip.

Installation

With CocoaPods

Add the following line to your Podfile and run pod install command.

pod 'taresip'

Build manually

  1. Download project and run build.sh script.
  2. Drag generated libraries and headers files into your XCode project.
  3. Check your XCode project has the following frameworks: CFNetwork, AudioToolbox, AVFoundation, SystemConfiguration and CoreMedia.
  4. Check your XCode project has the follwing libraries: libstdc++.tbd and libresolv.9.tbd.

Usage

Please also refer to baresip docs.

Swift

Import headers on your -Bridging_Header.h.

#import <re.h>
#import <baresip.h>

Sample call flow

var agent: COpaquePointer = COpaquePointer(nilLiteral: ())
sip(&agent)
sipClose(agent)

func sip(inout agent: COpaquePointer)
{
    var error = libre_init()
    if error != 0
    {
        return
    }

    // Initialize dynamic modules.
    mod_init()

    // Make configure file.
    let mainBundle = NSBundle.mainBundle()
    if let path = mainBundle.resourcePath
    {
        conf_path_set(getCString(path))
    }
    error = conf_configure()
    if error != 0
    {
        return
    }

    // Initialize the SIP stack.
    error = ua_init("SIP", 1, 1, 1, 0)
    if error != 0
    {
        return
    }

    // Load modules.
    error = conf_modules()
    if error != 0
    {
        return
    }

    let addr: String = "sip:user:[email protected]:port;transport=udp;answermode=auto"

    // Start user agent.
    error = ua_alloc(&agent, getCString(addr))
    if error != 0
    {
        return
    }

    // Make an outgoing call.
    error = ua_connect(agent, nil, nil, "sip:[email protected]:port", nil, VIDMODE_OFF);
    if error != 0
    {
        return
    }

    // Start the main loop.
    re_main(nil)
}

private func sipClose(agent: COpaquePointer)
{
    mem_deref(UnsafeMutablePointer(agent))
    ua_close()
    mod_close()

    // Close and check for memory leaks.
    libre_close()
    tmr_debug()
    mem_debug()
}

Latest podspec

{
    "name": "taresip",
    "version": "0.1.1",
    "authors": {
        "Michel Atucha": "[email protected]"
    },
    "homepage": "https://github.com/miche-atucha/taresip",
    "summary": "Cocoapod for baresip.",
    "source": {
        "git": "https://github.com/miche-atucha/taresip.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "license": {
        "type": "BSD",
        "file": "LICENSE"
    },
    "description": "Baresip is a portable and modular SIP User-Agent with audio and video support.",
    "source_files": [
        "build/baresip/include/**",
        "build/re/include/**",
        "build/rem/include/**"
    ],
    "public_header_files": [
        "build/baresip/include/**",
        "build/re/include/**",
        "build/rem/include/**"
    ],
    "preserve_paths": [
        "build/baresip/include/**/*",
        "build/re/include/**/*",
        "build/rem/include/**/*"
    ],
    "vendored_libraries": "build/lib/*.a",
    "xcconfig": {
        "HEADER_SEARCH_PATHS": ""$(PODS_ROOT)/taresip/build/baresip/include" "$(PODS_ROOT)/taresip/build/re/include" "$(PODS_ROOT)/taresip/build/rem/include"",
        "GCC_PREPROCESSOR_DEFINITIONS": "PJ_AUTOCONF=1"
    },
    "frameworks": [
        "CFNetwork",
        "AudioToolbox",
        "AVFoundation",
        "CoreMedia",
        "SystemConfiguration"
    ],
    "libraries": [
        "stdc++",
        "resolv.9"
    ],
    "requires_arc": false
}

Pin It on Pinterest

Share This