Using Voximplant SDKs

Voximplant can accept and initiate calls from phones, SIP devices and it's own SDKs. The SDK needs to connect to the cloud and login via Voximplant user credentials. After that, SDK API can be used to initiate a call to the cloud and SDK events can be subscribed to accept a call from the cloud. On the cloud side there is generally no difference between phone, SIP and SDK calls. Media streams from audio and/or video calls can be routed and connected in any combinations. SDKs can also initiate and accept video calls and use the messaging subsystem.

To start using SDKs, select the appropriate SDK and create a new project.

Most modern web browsers limit voice and video capture only to web pages loaded over HTTPS. This also means that such page can't be loaded from a local .html file. For development purpose, local files can be self-hosted. Web browsers allow to load self-hosted pages from localhost over HTTP. For this tutorial, make sure NodeJS is installed, create an index.html file, execute the following code to start a local server and open http://localhost:8080 in a web browser:

Modify the Android Studio project's build.gradle config file to include the Voximplant SDK

dependencies {
// Add this line with the latest version number from the SDK changelog
implementation 'com.voximplant:voximplant-sdk:2.3.5'
...
}​

The Voximplant iOS SDK uses CocoaPods for dependency management. After CocoaPods is installed, create the Podfile and install dependencies via the following commands:

target 'TargetName' do
use_frameworks!
pod 'VoxImplantSDK', '2.12.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
end​

After dependencies are installed, open the generated .xcworkspace file in the XCode. Include the NSMicrophoneUsageDescription and the NSCameraUsageDescription keys in your app's Info.plist file and provide reasonable strings for these keys. Declare four "Background Modes" via the XCode interface: "Audio and AirPlay", "Background fetch", "Remote notifications" and "Voice over IP".

Run the npm install react-native-voximplant@latest --save command in the project directory. Further steps should be made for both iOS and Android platforms, see the details in our guide.

You should initialize the Voximplant SDK before you can use it.

MANY OPERATIONS ARE ASYNCHRONOUS

Many Voximplant SDK operations are asynchronous. You need to use a platform-specific way to continue executing your code after such an operation completes. Depending on the platform, it can be callback, promise, etc.

To distinguish between different SDKs connected to the Voximplant cloud, each SDK should log in to the cloud using the Voximplant user credentials. Depending on your goal, you can configure the SDKs so that all instances log in as one Voximplant user or you can use different credentials for each instance. The Voximplant user credentials can be created programmatically via the Voximplant HTTP API.

USE A FULL USERNAME AND ADD THE USER TO THE VOXIMPLANT APP

Voximplant requires fully-qualified credentials to select which application will handle the call. A login attempt will fail if the specified user was not assigned to the specified application in the Voximplant control panel.

This quickstart step demonstrates a simple one-leg case where an SDK endpoint calls the Voximplant cloud, and the cloud generates an audio stream via the built-in text-to-speech conversion engine. Use the call method of the selected SDK in order to start a call:

The Voximplant SDK is asynchronous: you subscribe to events like "connected" or "disconnected", and the SDK will execute the specified callbacks. The IncomingCall event is triggered when the call from the Voximplant cloud reaches the SDK endpoint.

The Voximplant SDK is asynchronous: you subscribe to events like "connected" or "disconnected", and the SDK will execute the specified callbacks. The onIncomingCall event is triggered when the call from the Voximplant cloud reaches the SDK endpoint.

The Voximplant SDK is asynchronous: you subscribe to events like "connected" or "disconnected", and the SDK will execute the specified callbacks. The client:didReceiveIncomingCall:withIncomingVideo:headers: event is triggered when the call from the Voximplant cloud reaches the SDK endpoint.

The Voximplant SDK is asynchronous: you subscribe to events like "connected" or "disconnected", and the SDK will execute the specified callbacks. The ClientEvents.IncomingCall event is triggered when the call from the Voximplant cloud reaches the SDK endpoint.