Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Latest commit

 

History

History

AudioCallKit

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
  • 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

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 cervices 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 page 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);
});

Installing

  1. Clone this repo

  2. Open the ObjectiveC.xcodeproj workspace

  3. Target AudioCallKit and build the project using Xcode

Usage

User login

login

Log in using:

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

See the following classes for code details:

CallKit integration architecture

CallManager.m 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 Voximplant iOS SDK
  4. Push Notifications
  5. HowTo's
  6. WWDC 2016 - Enhancing VoIP Apps with CallKit