... | ... | @@ -3,7 +3,7 @@ |
|
|
Reve Voice SDK for Android provides you with the Opportunity to make VOIP (Voice over Internet Protocol) Calls and Peer to Peer calls.<br>
|
|
|
Follow the steps below to integrate Reve Voice SDK with your native android app.
|
|
|
|
|
|
**Step 1. Installation:** In the build.gradle in your project file, make sure you have the following items
|
|
|
**Step 1. Installation:** In **build.gradle** in your project file, make sure you have the following items
|
|
|
```groovy
|
|
|
buildscript {
|
|
|
repositories {
|
... | ... | @@ -31,8 +31,7 @@ repositories { |
|
|
|
|
|
|
|
|
maven {
|
|
|
url "http://maven.iptelephony.revesoft.com:8081/artifactory/libs-release-local"
|
|
|
allowInsecureProtocol(true)
|
|
|
url "https://maven.iptelephony.revesoft.com/artifactory/libs-release-local/"
|
|
|
}
|
|
|
maven { url 'https://jitpack.io' }
|
|
|
}
|
... | ... | @@ -41,7 +40,7 @@ Finally add the following line in your **app/build.gradle** file's dependencies |
|
|
```groovy
|
|
|
dependencies {
|
|
|
...
|
|
|
implementation 'reve-voice-sdk:1.0.0'
|
|
|
implementation 'com.revesoft.sdk:revecallsdk:1.0.1'
|
|
|
...
|
|
|
}
|
|
|
```
|
... | ... | @@ -85,30 +84,13 @@ Follow the [Instructions](Get-Api-Key) to get your own API Key. |
|
|
UserInfo.setUsername(AppUI.getusername())
|
|
|
UserInfo.setPassword(AppUI.getSipPassword())
|
|
|
```
|
|
|
**Step 4. Starting the Call Functionalities** At this stage The configuration of the App is complete. Now you can start to activate the functionalities of this sdk. You have to call the function `SIPWrapper.startSIP(context: Context, appConfig:AppConfig)`. This method starts the components that lets you start/receive and end calls. Here context should be the default applicationContext and the appConfig is what you created in **Step 2.**
|
|
|
**Step 4. Starting the Call Functionalities** At this stage The configuration of the App is complete. Now you can start to activate the functionalities of this sdk. You have to call the function `SIPWrapper.startSIP(context: Context, appConfig:AppConfig)`. This method starts the components that lets you start/receive and end calls. Here context is recommended to be the default applicationContext and the appConfig is what you created in **Step 2.**
|
|
|
If all the configuration is ok, this function will start the core components of this sdk. You have to make sure that you are using the exact configuration provided by Reve Systems. You can call this method inside an activity or a service.
|
|
|
|
|
|
**Step 5. Permission:** Make sure your app has permission to **record Audio**. Otherwise no audio data will be sent via this app.
|
|
|
<br>Add the following line in your Manifest file
|
|
|
```xml
|
|
|
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
|
|
```
|
|
|
You can use the following code snippet to check for permission and ask for permission if it is not already greanted.
|
|
|
|
|
|
```kotlin
|
|
|
private fun checkAndRequestPermissions() {
|
|
|
if (ContextCompat.checkSelfPermission(applicationContext,
|
|
|
android.Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED
|
|
|
) {
|
|
|
ActivityCompat.requestPermissions(this, arrayOf(android.Manifest.permission.RECORD_AUDIO), 101)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
**Step 5. Permission:** Make sure to ask for permissions for Audio record and Make Calls in your app. Otherwise the sdk wont work.
|
|
|
|
|
|
**Step 6. Call Handling:** The aforementioned `SIPWrapper.startSIP(Context,AppConfig)` function will initialize **CallHandler**, a class for all types of call related activites. You can now make a call by simply calling `CallHandler.makeCall(number:String)`
|
|
|
function and end call by calling `CallHandler.endCall()` function. You can receive Peer to Peer calls by using `CallHandler.acceptCall(callid:String)`.
|
|
|
**Step 6. Call Handling:** The aforementioned `SIPWrapper.startSIP(Context,AppConfig)` function will initialize **CallHandler**, a class for all types of call related activites. You can now make a call by simply using `CallHandler.makeCall(number:String)` function.
|
|
|
function and end call by using`CallHandler.endCall()` function. You can receive Peer to Peer calls by using `CallHandler.acceptCall(callid:String)`.
|
|
|
|
|
|
Check out the **[Call Handling guide](Call-Handling)** for details on Handling of calls using this SDK and UI integration with Native App.
|
|
|
|
... | ... | |