//afone is the reference implementation for SIP Telephony on iOS

Related tags

Communication afone
Overview
Automat

Release v1.3 Xcode 10.2+ Swift 5.0+ iOS 12.1+ CocoaPods Compatible License MIT Twitter AutomatBerlin

//afone is the reference implementation for SIP Telephony on iOS that can be used on different SIP stacks with no effort. It comes with an easily extensible adapters concept that encapsulates all details of various providers.

Requirements

  • Xcode 10.2+
  • Swift 5.0+
  • iOS 12.1+
  • CocoaPods 1.7.0+
  • SIP-based Server / Service Provider

Features

  • VoIP Adapter Reference Implementation
  • Voice & Video Calls
  • CallKit Integration
  • DTMF Support
  • Extensible Adapters Concept
  • Push Notifications (Local)
  • Background Connectivity
  • User-friendly Animations & Feedback
  • Brand / CI Customization
  • Contact list with search and index scrolling
  • Alternative App icon support
  • Dark mode support on iOS 13

Usage

Before you use the application, you have to look up your authentication credentials to a SIP-based server and make sure they are valid.

Login Screen

Enter your credentials (account, password, server). If your server uses a default configuration, you can log in right away.

Login Settings

In case you need to customize the application to your environment, tap Advanced and configure preferences like local & remote ports, transport protocols, STUN server, or TLS certificate validation.

Dialer

Enter a phone number and make a call. You can tap on delete to revert your input.

Dialer

You can also show your local contact list and have an easier way to call your friends and business contacts.

Call Screen

//afone’s call interface supports all standard features. While making a call you can mute it, put it on the speaker, switch to a video call and switch the device camera. You can also tap on the Keypad button to enter DTMF signals.

Adapter Settings

In the Settings screen you can configure audio & video codecs, SRTP. You can also log out. The application will let you log in again afterwards.

Adapter Settings

In the Settings screen under Appearance you can change the App icon. We provide three different app icons to chose from.

Installation

Dependencies

//afone uses CocoaPods as its dependency manager. For usage and installation instructions, visit their website. Before you open & build the project in Xcode, you have to install all dependencies first. Make sure CocoaPods is installed on your machine, then install all required project dependencies:

pod install

Build & Run

After you have installed all dependencies, just open the Xcode workspace. Select the desired simulator and run the project. If you want to run //afone on a device, you’ll have to configure signing in the Xcode Target preferences. Visit the official Apple documentation for more information about device provisioning.

Customization

If you want to further customize the application you can either extend the reference PortSIPAdapter implementation, or preferably write your own adapter that conforms to the VoIPManagerDelegate protocol (and eventually other protocols if they are required by the 3rd-party client libraries you use).

Configuration

Based on the configurations you provide, the application automatically creates a settings view that lets an user select supported preferences:

var audioCodecs: [Codec] { get }

Return supported audio codecs (e. g. G.729, PCMA, GSM, ILBC, SPEEX, OPUS).

var videoCodecs: [Codec] { get }

Return supported video codecs (e. g. H.263, H.264, VP8, VP9).

var srtpOptions: [SRTP] { get }

Return your supported SRTP options (e. g. none, prefer, force).

var localVideoView: UIView? { get }

Return your local video view here, which should be provided by your VoIP SDK.

var remoteVideoView: UIView? { get }

Return your remote video view here, which should be provided by your VoIP SDK.

var needsCodecs: Bool { get }

Indicate whether the user needs to choose audio codecs in order to make a call

Delegation

Implement the following delegate functions if you want to create your own adapter:

func answerCall(_ sessionId: Int, videoCall: Bool, completion: (NSError?) -> Void)
func hangUp(_ sessionId: Int, completion: (NSError?) -> Void)
func hold(_ sessionId: Int, completion: (NSError?) -> Void)
func unhold(_ sessionId: Int, completion: (NSError?) -> Void)
func mute(_ sessionId: Int, mute: Bool, completion: (NSError?) -> Void)
func rejectCall(_ sessionId: Int, code: Int, completion: (NSError?) -> Void)
func sendDTMF(_ sessionId: Int, character: Character)
func createCall(to: String, completion: (Call?, NSError?) -> Void)
func initAdapter(credentials: Credentials, completion: @escaping (NSError?) -> Void)
func didEnterBackground()

To save battery, you should suspend connection to your backend.

func willEnterForeground()

Reestablish connection to your backend here, to be able to receive and make calls.

func logout(completion: (() -> Void)?)
func cancelLogin()
func reload(with settings: Settings)
func startAudio()
func stopAudio()
func enableLocalVideo(_ enable: Bool, completion: ((Bool) -> Void)?)
func enableRemoteVideo(_ enable: Bool, completion: ((Bool) -> Void)?)
func toggleCameraPosition(completion: (NSError?) -> Void)

The function names represent common operations and should be self-explanatory. Depending on the backend you want to integrate, you either call other 3rd-party libraries, or implement your own communication & connection handling inside these functions. See PortSIPAdapter for a reference implementation.

Colors & Other Defaults

You can customize colors and other defaults of the application in Constants. The structure holds customization options for call defaults, SIP defaults, or the keychain key name.

FAQ

Why do you have dependencies? I thought a good library shouldn’t have dependencies?

While it is technically correct that a good library should stand for itself without requiring other dependencies, //afone isn’t a library, but a complete softphone reference implementation with a full-fledged application architecture, dependency management, custom view components, and much more. Most of this functionality is a core part of the main repository, but there is no point in reinventing the wheel and writing the n-th implementation of a logging library (where already great implementations exist). If you think the project should further minimize its dependencies, we welcome your contribution and a pull request.

Known Issues

The UI is not compatible with smaller displays (4", iPhone 5, iPhone 5s, iPhone SE).

Contribute

We welcome any contributions. Contact us if you have any questions.

Contact

//afone is owned and maintained by Automat Berlin GmbH.

Acknowledgements

Elevator Music by Kevin Macleod distributed under Attribution 3.0 Unported (CC BY 3.0)

License

//afone is released under the MIT license. See LICENSE for details.

You might also like...
iOS - Real-time messaging app  🎨
iOS - Real-time messaging app 🎨

General mChat is a real-time messaging app written in Swift for iOS devices. Since mChat uses a fast and reliable Firebase Database, it receives data

Open source, native iOS Messenger, with realtime chat conversations (full offline support).
Open source, native iOS Messenger, with realtime chat conversations (full offline support).

OVERVIEW This is a native iOS Messenger app, with realtime chat conversations (full offline support). NEW FEATURES Passcode support GraphQL server sup

Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift
Messenger Clone - Real-time iOS Chat with Firebase Firestore written in Swift

Real time Swift iOS Chat with Firebase - Messenger Clone This is an extremely simple chat app source code of an iOS Swift Chat app. It leverages Messa

Free Jabber/XMPP client for iOS and macOS
Free Jabber/XMPP client for iOS and macOS

Monal A cross platform, modern XMPP client for iOS and MacOS This is the Monal XMPP client as found in the app store. If you want to use the latest st

Mumble client for iOS-based devices

Mumble for iOS (iPhone, iPod touch and iPad) Note: This repo and the app for iOS are unmaintained. If you are interested in taking over development of

Legacy mobile Rocket.Chat client in Swift for iOS
Legacy mobile Rocket.Chat client in Swift for iOS

IMPORTANT: PLEASE READ THIS FIRST Rocket.Chat mobile is moving to React Native. Development on this repository by Rocket.Chat has now ceased. If your

A private messenger for iOS.

Signal iOS Signal is a free, open source, messaging app for simple private communication with friends. Also available on Android and Desktop. Question

Spika is universal chat module with backend, web, ios and Android client.
Spika is universal chat module with backend, web, ios and Android client.

Spika Spika is messenger module for Web/iOS/Android with backend. You can include messenger feature to your app or service with minimum code. For deta

Telegram iOS Source Code Compilation Guide

Telegram iOS Source Code Compilation Guide We welcome all developers to use our API and source code to create applications on our platform. There are

Comments
  • Crashes on login

    Crashes on login

    Steps to reproduce

    • Fill in basic login details for provider (their documentation)
    • Click login
    • Briefly see spinner above login
    • App closes

    Setup

    iPhone SE (2nd Generation) iOS 14.2

    Notes

    Someone else reported the same issue on iPhone SE (1st Generation) in a review on the German App Store.
    I have verified the login credentials in another app

    opened by alanpearce 8
  • Build error

    Build error

    I have download afone

    pod install

    open .xcworkspace

    getting error in Bridging header file 'AbtoSipClientWrapper/AbtoSipPhoneObserver.h' file not found

    thanks in advance

    question 
    opened by Darshan-Sonigara 1
  • Background Connectivity works first only after first call

    Background Connectivity works first only after first call

    After starting //afone and opening another app, the background connectivity doesn't work. Background Connectivity works only after first outbound, inbound or declined call. iOS 13.4.1

    opened by helifrank 1
Releases(1.0)
Owner
Automat Berlin GmbH
Automat Berlin GmbH
A native iOS video chat app based on WebRTC

AppRTC - iOS implementation of the Google WebRTC Demo About This Xcode project is a native wrapper for the Google's WebRTC Demo. It organizes the WebR

ISBX 1.3k Dec 31, 2022
Bluetooth LE Mesh Chat for iOS and Android

BLEMeshChat Bluetooth LE mesh chat prototype for iOS. Android version over here. Goals Use the Bluetooth 4.0 Low Energy APIs on iOS and Android to all

Chris Ballinger 479 Dec 29, 2022
ChatSecure is a free and open source encrypted chat client for iOS that supports OTR and OMEMO encryption over XMPP.

ChatSecure ChatSecure is a free and open source XMPP messaging client for iOS that integrates OTR and OMEMO encrypted messaging support, and has optio

ChatSecure 3.1k Dec 31, 2022
Colloquy is an advanced IRC, SILC & ICB client for macOS and iOS!

Colloquy Dependencies This repository uses git submodules for some of its dependencies, so you will have to check those out as well. You can do this f

Colloquy 175 Jan 7, 2023
Email-based instant messaging for iOS.

deltachat-ios Email-based instant messaging for iOS. Testing Betas are distributed via Testflight. Just scan this QR code with the camera app of your

Delta Chat 258 Dec 31, 2022
A glossy Matrix collaboration client for iOS

Element iOS Element iOS is an iOS Matrix client provided by Element. It is based on MatrixKit and MatrixSDK. Beta testing You can try last beta build

Element 1.5k Jan 1, 2023
🌟🌟🌟🌟🌟 Falcon Messenger is a Fast and Beautiful cloud-based messaging app. With iOS and IPadOS Support. Available on the App Store.

Open the FalconMessenger.xcworkspace in Xcode. Change the Bundle Identifier to match your domain. Go to Firebase and create new project. Select "Add F

null 397 Dec 31, 2022
Starter code for the Flash Chat project in the Complete iOS Development Bootcamp

Flash-Chat Our Goal One of the most fundamental component of modern iOS apps is the Table View. Table Views are used everywhere from the Mail app to t

The App Brewery 45 Jul 30, 2022
IRCCloud iOS App

The official iOS app for IRCCloud.com Chat on IRC from anywhere, and never miss a message. All your chats and logs are stored in the cloud. Access the

IRCCloud Ltd. 259 Dec 18, 2022
Next generation iOS and Android apps for Mattermost in React Native

Mattermost Mobile Minimum Server versions: Current ESR version (5.37.0) Supported iOS versions: 11+ Supported Android versions: 7.0+ Mattermost is an

Mattermost 1.7k Jan 1, 2023