Handling Calls With UI using Reve Voice SDK
After calling the SIPWrapper.startSIP()
method VOIP Calling is available to you through the method
Kotlin
ReveSdkCallHandler.makeCall()
java
ReveSdkCallHandler.Companion.makeCall()
But Even if you have access to the call functionalites, you need to Make your UI work according to the background tasks. The Listeners Interfaces SDKSIPListener and SDKServiceListener are used for that reason. See Listeners Guide to correctly Implement Listeners.
After Listeners are correctly implemented you can use your UI to start your calls with the method
Kotlin
ReveSdkCallHandler.makeCall(phoneNumber:String)
Java
ReveSdkCallHandler.Companion.makeCall(phoneNumber:String)
This method can be called and the you can get the relevant call related info through the Listeners.
After you have started a call with makeCall method, you can end this call by invoking the the following method
Kotlin
ReveSdkCallHandler.endCall()
Java
ReveSdkCallHandler.Companion.endCall()
Finally you can accept incoming calls by invoking the method
Kotlin
ReveSdkCallHandler.acceptCall(callID)
Java
ReveSdkCallHandler.Companion.acceptCall(callID)
You can find the callID through the SDKServiceListener (See Listeners Guide)
In call Functionalities
While a call is going on three features of calls can also be found in this SDK. You can
- Mute your Microphone,
- Hold your Call &
- Turn on the Speaker. You can use the following methods to achieve the aforementioned call features.
To mute call
Kotlin
ReveSdkCallHandler.setCallMute(true)
Java
ReveSdkCallHandler.Companion.setCallMute(true)
To unmute call
Kotlin
ReveSdkCallHandler.setCallMute(false)
Java
ReveSdkCallHandler.Companion.setCallMute(false)
To hold call
Kotlin
ReveSdkCallHandler.holdCall(true)
Java
ReveSdkCallHandler.Companion.holdCall(true)
To unhold call
Kotlin
ReveSdkCallHandler.holdCall(false)
Java
ReveSdkCallHandler.Companion.holdCall(false)
To turn on speaker
Kotlin
ReveSdkCallHandler.setSpeakerOn(true)
Java
ReveSdkCallHandler.Companion.setSpeakerOn(true)
To turn off speaker
Kotlin
ReveSdkCallHandler.setSpeakerOn(false)
Java
ReveSdkCallHandler.Companion.setSpeakerOn(false)