-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
101 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,39 @@ | ||
package com.vonage.client.kt | ||
|
||
import com.vonage.client.voice.CallInfo | ||
import com.vonage.client.voice.CallInfoPage | ||
import com.vonage.client.voice.CallsFilter | ||
import com.vonage.client.voice.VoiceClient | ||
import com.vonage.client.voice.ncco.Ncco | ||
import java.net.URI | ||
import java.util.* | ||
|
||
class Voice(private val voiceClient: VoiceClient) { | ||
|
||
fun getCall(callId: UUID): CallInfo = getCall(callId.toString()) | ||
fun call(callId: String): Call = Call(callId) | ||
|
||
fun getCall(callId: String): CallInfo = voiceClient.getCallDetails(callId) | ||
fun call(callId: UUID): Call = call(callId.toString()) | ||
|
||
|
||
inner class Call(val callId: String) { | ||
|
||
fun get(): CallInfo = voiceClient.getCallDetails(callId) | ||
|
||
fun hangup() = voiceClient.terminateCall(callId) | ||
|
||
fun mute() = voiceClient.muteCall(callId) | ||
|
||
fun unmute() = voiceClient.unmuteCall(callId) | ||
|
||
fun earmuff() = voiceClient.earmuffCall(callId) | ||
|
||
fun unearmuff() = voiceClient.unearmuffCall(callId) | ||
|
||
fun transfer(ncco: Ncco) = voiceClient.transferCall(callId, ncco) | ||
|
||
fun transfer(nccoUrl: String) = voiceClient.transferCall(callId, nccoUrl) | ||
|
||
fun transfer(nccoUrl: URI) = transfer(nccoUrl.toString()) | ||
} | ||
|
||
fun listCalls(filter: CallsFilter? = null): CallInfoPage = voiceClient.listCalls(filter) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters