Skip to content

Latest commit

 

History

History

AudioCallKit

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Voximplant Audio Call Kit Demo (iOS)

This demo demonstrates CallKit integration with basic audio call functionality of the Voximplant iOS SDK . The application supports audio calls between this iOS app and other apps that use any Voximplant SDK.

CallKit lets you integrate your calling services with other call-related apps on the system.

CallKit provides the calling interface, and you handle the back-end communication with your VoIP service.

For incoming and outgoing calls, CallKit displays the same interfaces as the Phone app, giving your app a more native look and feel. And CallKit responds appropriately to system-level behaviors such as Do Not Disturb.

In addition to handling calls, you can provide a Call Directory app extension to provide caller ID information and a list of blocked numbers associated with your service.

Features

The application is able to:

  • log in to the Voximplant Cloud
  • auto login using access tokens
  • make an audio call
  • receive an incoming call
  • put a call on hold / take it off hold
  • change an audio device (speaker, receiver, wired headset, bluetooth headset) during a call
  • mute audio during a call
  • send DTMF
  • auto reconnect/relogin
  • push notifications
  • CallKit integration

Install the app

From the source code

  1. Clone this repo

  2. Open the Swift.xcodeproj workspace

  3. Target AudioCallKit and build the project using Xcode

Download the application build

Use the invite link to get access the latest builds and subscribe for the application updates.

⚠️    Please consider that you need to set up a Voximplant account to make calls. Please follow the instructions below.
⚠️    Push notifications require additional setup. If the application is built from the source code, set up push notifications. If the application was installed from the invite link, push notifications cannot be configured.

Getting started

To get started, you'll need to register a free Voximplant developer account.

You'll need the following:

  • Voximplant application
  • two Voximplant users
  • VoxEngine scenario
  • routing setup
  • VoIP services certificate for push notifications. Follow this tutorial to upload the certificate to the Voximplant Control Panel

Automatic

We've implemented a special template to enable you to quickly use the demo – just install SDK tutorial from our marketplace: marketplace

Manual

You can set up it manually using our Getting started guide and tutorials

VoxEngine scenario example:

require(Modules.PushService);
VoxEngine.addEventListener(AppEvents.CallAlerting, (e) => {
const newCall = VoxEngine.callUserDirect(
  e.call, 
  e.destination,
  e.callerid,
  e.displayName,
  null
);
VoxEngine.easyProcess(e.call, newCall, ()=>{}, true);
});

Usage

User login

login

Log in using:

After each successful login the demo app registers the VoIP push token via VIClient.registerVoIPPushNotificationsToken(voipToken:completion:)

See the following classes for code details:

CallKit integration architecture

CallManager.swift creates and stores CXProvider that is responsible for reporting out-of-band call notifications that occur to the system:

  • incoming call
  • outgoing call connected
  • call ended by the far-end

CXCallController is used to report call events generated by the current user:

Make or receive calls

call

Enter a Voximplant user name to the input field and press "Call" button to make a call.

outgoingCall To make an outgoing call, MainViewController requests a CXStartCallAction object from its CXCallController object. The action consists of a UUID to uniquely identify the call and a CXHandle object to specify the recipient.

CallManager implements CXProviderDelegate methods and processes CXStartCallAction by creating VICall instance.

incomingCall To receive an incoming call from the Voximplant Cloud, CallManager implements VIClientCallManagerDelegate and reports it to the CallKit using the reportNewIncomingCall(with:update:completion:) method

See the following classes for code details:

Audio call controls

inCall

It is possible to synchronize the call states (such as audio mute, hold, audio device change) between CallKit UI and application call view using CallKit CXCallController and CXProvider.

See the following classes for code details:

Useful links

  1. Getting started
  2. Voximplant iOS SDK reference
  3. Installing the Voximplant iOS SDK
  4. Push Notifications
  5. HowTo's
  6. WWDC 2016 - Enhancing VoIP Apps with CallKit