# Integrate the Telephony SDK

## Prerequisites

1. [Complete the Getting Started Guide](/guides/getting-started.md)
2. [Integrate the User SDK](/guides/users/integrate-the-user-sdk.md)
3. [Integrate the Sudo SDK](/guides/sudos/integrate-the-sudo-sdk.md)

## Get Started

* [Integrate the iOS SDK](#integrate-the-ios-sdk)
* [Integrate the Android SDK](#integrate-the-android-sdk)
* Integrate the Web SDK (Coming soon!)

## Integrate the iOS SDK

Add this line to your [Podfile](/guides/getting-started.md#ios-only-setup-cocoapods-in-a-project) near the line `pod 'SudoUser'`

```
pod 'SudoTelephony'
```

Install pod dependencies by running the following command in your project directory:

```
pod install --repo-update
```

This will update the local CocoaPods repository and install the latest version of the Telephony SDK.

{% hint style="info" %}
In order to instantiate a Telephony client, make sure you have followed instructions for [Getting Started](/guides/getting-started.md), [User SDK](/guides/users/integrate-the-user-sdk.md) and [Sudo SDK](/guides/sudos/integrate-the-sudo-sdk.md) (see [Prerequisites](#prerequisites) above)
{% endhint %}

To instantiate a client in your application, add the following

{% tabs %}
{% tab title="Swift" %}

```swift
import SudoTelephony

let userClient = // ... see "Users" docs
let profilesClient = // ... see "Sudos" docs
let callingProviderConfig = // .. Optional. see "Voice Call" docs
let telephonyClient = try! DefaultSudoTelephonyClient(
    sudoUserClient: userClient, 
    sudoProfilesClient: profilesClient,
    callProviderConfiguration: callingProviderConfig
)
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If you are integrating [voice calling](/guides/telephony/calling.md) into your application, you must pass in a CallProviderConfiguration. Failure to do so will result in errors being returned when attempting to make a voice call.
{% endhint %}

{% hint style="warning" %}
You only need one client instance for a given user per device. Instantiating multiple clients with the same configuration and using them at the same time may cause unexpected runtime errors to occur.
{% endhint %}

{% hint style="success" %}
**See it in action.** Be sure to take a look at the [open source iOS sample app](https://github.com/sudoplatform/samples-ios) on GitHub that our team published as a reference for integrating the Telephony SDK into your app as quickly and seamlessly as possible.
{% endhint %}

## Integrate the Android SDK

Add this line to the dependencies section of the app module `build.gradle` and run gradle sync

```
dependencies {
    api 'com.sudoplatform:sudotelephony:$latest_version'
}
```

{% hint style="info" %}
The latest version of the SDK can be found at [SDK Releases](/guides/telephony/sdk-releases.md).
{% endhint %}

{% hint style="info" %}
In order to instantiate a Telephony client, make sure you have followed instructions for [Getting Started](/guides/getting-started.md), [User SDK](/guides/users/integrate-the-user-sdk.md) and [Sudo SDK](/guides/sudos/integrate-the-sudo-sdk.md) (see [Prerequisites](#prerequisites) above).
{% endhint %}

To instantiate a client in your application, add the following

{% tabs %}
{% tab title="Kotlin" %}

```kotlin
val userClient = // ... see "Users" docs
val profilesClient = // ... see "Sudos" docs

val telephonyClient = DefaultSudoTelephonyClient(
    appContext, 
    userClient, 
    profilesClient
)
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
You only need one client instance for a given user per device. Instantiating multiple clients with the same configuration and using them at the same time may cause unexpected runtime errors to occur.
{% endhint %}

{% hint style="success" %}
**See it in action.** Be sure to take a look at the [open source Android sample app](https://github.com/sudoplatform/samples-android/tree/master/telephony) on GitHub that our team published as a reference for integrating the Telephony SDK into your app as quickly and seamlessly as possible.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sudoplatform.com/guides/telephony/integrate-the-telephony-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
