STWCallApi

object STWCallApi : ObservableApi

Types

Link copied to clipboard
data class AudibleCall(val call: STWVCall, val panning: Int)

Properties

Link copied to clipboard
const val CLASS_NAME: String
Link copied to clipboard
val EXTERNAL_CAMERA_ID: Int

Functions

Link copied to clipboard
fun acceptCall(context: Context, vCall: STWVCall): ApiResult<STWVCall>
Link copied to clipboard
suspend fun addFavoriteChannel(context: Context, channelIds: List<Long>): Int

Call this method to add channel to favorite list .

Link copied to clipboard
fun allAmbientListeningCalls(): List<STWVCall>

Call this method to get all current ambient listening calls

Link copied to clipboard
fun allConferenceCalls(): List<STWVCall>

Call this method to get all current conference calls

Link copied to clipboard
fun allEmergencyCalls(): List<STWVCall>

Call this method to get all current emergency calls

Link copied to clipboard
fun allLiveAudioCalls(): List<STWVCall>

Call this method to get all current live audio calls

Link copied to clipboard
fun allLiveVideoCalls(): List<STWVCall>

Call this method to get all current live video calls

Link copied to clipboard
fun allPTTCalls(): List<STWPTTCall>

Call this method to get all current PTT calls

Link copied to clipboard
fun allVideoStreamingSessions(): List<STWVCall>

Call this method to get all incoming/outgoing video streaming sessions

Link copied to clipboard
suspend fun connectToChannel(    context: Context,     channelSessionID: Long,     isVisitorChannel: Boolean = false): ApiResult<STWVCall>

Call this method to connect to a channel session with the channelSessionID

Link copied to clipboard
fun connectToVisitorChannel(    context: Context,     channelSessionId: String,     completion: CompletionCallback?)

Call this method to add a visitor channel to the local database and connect to it.

Link copied to clipboard
fun enableInstantReplayFeature(context: Context, enable: Boolean)

enable Instant replay setting to allow the user enable/disable the feature

Link copied to clipboard
fun existOngoingCellularCall(): Boolean

Call this method to check if exist an ongoing cellular call

Link copied to clipboard
fun getActiveCall(): STWVCall?

Call this method to get the active call instance if exist

Link copied to clipboard
fun getActiveCallID(): String?

Call this method to get the active call id

Link copied to clipboard
fun getAllCalls(): List<STWVCall>

Call this method to get all current calls

Link copied to clipboard
fun getAllCallsWithStatus(callStatus: Int): List<STWVCall>

Call this method to get all current calls with specific STWVCall.STWVCallConnectionStatus

Link copied to clipboard
fun getAllChannelCalls(): List<STWPTTCall>

Call this method to get all current channel calls

Link copied to clipboard
fun getAllChannelIds(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean): List<Int>?

Call this method to retrieve the channels IDs

By default, channels are ordered by name.

Link copied to clipboard
suspend fun getAllChannelListBySelection(context: Context, searchKey: String?): List<STWVoipChannel>?

Call this method to retrieve the list of all STWVoipChannel where name contains user's input search

Link copied to clipboard
fun getAllFavoriteVoipChannelsAsFlow(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     searchContent: String?): Flow<List<STWVoipChannel>?>

Call this method to retrieve the list of favorite STWVoipChannel as FLow
By default, channels are ordered by last name.

Link copied to clipboard
fun getAllFavoriteVoipChannelsAsLiveData(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     searchContent: String?): LiveData<List<STWVoipChannel>?>

Call this method to retrieve the list of favorite {@link STWVoipChannel} as LiveData
By default, channels are ordered by name.

Link copied to clipboard
fun getAllowedFeaturesAsFlow(    featureName: String,     coroutineScope: CoroutineScope,     lifecycleOwner: LifecycleOwner): StateFlow<Boolean>
fun getAllowedFeaturesAsFlow(    featureName: String,     coroutineScope: CoroutineScope,     getDisposable: (disposable: Disposable) -> Unit): StateFlow<Boolean>

Call this method to check whether the VoIP feature is allowed or not.

Link copied to clipboard
fun getAllVoipCalls(): List<STWVCall>

Call this method to get all current VoIP call other than channel and live stream

Link copied to clipboard
suspend fun getAllVoipChannels(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     searchContent: String?): List<STWVoipChannel>?

Call this method to retrieve the list of all {@link STWVoipChannel}.
By default, channels are ordered by name.

Link copied to clipboard
fun getAllVoipChannelsAsFlow(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     searchContent: String): Flow<List<STWVoipChannel>?>

Call this method to retrieve the list of all STWVoipChannel as Flow.
By default, channels are ordered by name.

Link copied to clipboard
fun getAllVoipChannelsAsLiveData(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean): LiveData<List<STWVoipChannel>?>

Call this method to retrieve the list of all {@link STWVoipChannel} as LiveData.
By default, channels are ordered by name.

Link copied to clipboard
fun getAudibleSessionId(panning: Int): String?

Call this method to retrieve the audible call.

Link copied to clipboard
fun getAudioLowLatencyLibrary(context: Context): Int

Call this method to retrieve the audio low latency library used

Link copied to clipboard
fun getAudioSource(context: Context): Int

Call this method to get the noise reduction status. Noise reduction enabled means : use MediaRecorder.AudioSource.MIC as audio source Noise reduction disabled means : use MediaRecorder.AudioSource.VOICE_COMMUNICATION as audio source

Link copied to clipboard
fun getCallWithId(callId: String): STWVCall?
Link copied to clipboard
suspend fun getConversationBySessionId(sessionId: String, context: Context): STWConversation?

retrieves the related conversation for the given sessionId or null if no conversation

Link copied to clipboard
suspend fun getLastBursts(context: Context, sessionId: String): List<STWLastPTTBurst?>

Call this method to retrieve the last bursts for a session (PTT/channel) sorted by last start time

Link copied to clipboard
suspend fun getListOfAllFavoriteVoipChannels(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     searchContent: String?): List<STWVoipChannel>?

Call this method to retrieve the list of favorite {@link STWVoipChannel}.
By default, channels are ordered by name .

suspend fun getListOfAllVoipChannelsWithoutDenyToTransmit(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     searchContent: String?): List<STWVoipChannel>?

Call this method to retrieve the list of all {@link STWVoipChannel}.
By default, channels are ordered by name, deney to transmit are ignored

Link copied to clipboard
fun getListOfRecentVoipChannelsAsFlow(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean): Flow<List<STWVoipChannel>?>

Call this method to retrieve the list of recent active STWVoipChannel as FLow
By default, channels are ordered by last active date.

Link copied to clipboard
fun getListOfRecentVoipChannelsAsLiveData(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean): LiveData<List<STWVoipChannel>?>

Call this method to retrieve the list of recent active {@link STWVoipChannel} as LiveData
By default, channels are ordered by last active date.

Link copied to clipboard
fun getOrganizationPriorityMaxLevels(context: Context): Long

get The maximum number of priority levels allowed in the organization

Link copied to clipboard
fun getPagedChannels(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     searchContent: String): PagingSource<Int, STWVoipChannel>

Call this method to load page of STWVoipChannel .
By default, channels are ordered by name.

Link copied to clipboard
suspend fun getRecentChannelListBySelection(context: Context, searchKey: String?): List<STWVoipChannel>?

Call this method to retrieve the list of recent active STWVoipChannel where name contains user's input search

Link copied to clipboard
suspend fun getRecentVoipChannels(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean): List<STWVoipChannel>?

Call this method to retrieve the list of recent active {@link STWVoipChannel}.
By default, channels are ordered by last active date.

Link copied to clipboard
fun getUsedAudioOutput(): Int

Call this method to retrieve the used(active) audio output. it return the audio output by priority :

Link copied to clipboard
fun getVoipChannelByGroupId(context: Context, groupId: String): STWVoipChannel?

Call this method to retrieve STWVoipChannel given a contact group ID

Link copied to clipboard
fun getVoipChannelByGroupIdAsFlow(context: Context, groupId: String): Flow<STWVoipChannel?>

Call this method to retrieve STWVoipChannel given a contact group ID

Link copied to clipboard
fun getVoipSessionById(context: Context, voipSessionId: String): VoipSessionItem?
Link copied to clipboard
fun getVoipSessionMaxParticipants(context: Context): Int

Call this method to get maximum voip session participants from preference.

Link copied to clipboard
fun hasOngoingLiveStreamCall(): Boolean

Call this method to check if the call manager contains at least one live stream call

Link copied to clipboard
suspend fun inviteParticipants(    context: Context,     sessionId: String,     recipients: List<STWRecipient>?,     externalRecipients: List<STWRecipientSingle>?,     conversationName: String?): ApiResult<STWVCall>

Call this method to invite new participants to a PTT or Conference call

Link copied to clipboard
fun isBluetoothWithAudioOutputConnected(): Boolean

Call this method to check whether a bluetooth device with audio output is connected or not.

Link copied to clipboard
fun isCallForwardAllowed(context: Context): Boolean

Check whether the isCallForward feature is enabled or not.

Link copied to clipboard
fun isCallForwardSettingsModificationAllowed(context: Context): Boolean

Check whether the isCallForwardSettingsModification feature is enabled or not.

Link copied to clipboard
fun isCallOutAllowed(context: Context): Boolean

Call this method to check whether the CallOut feature is enabled or not.

Link copied to clipboard
fun isCallTransferAllowed(context: Context): Boolean

Check whether the isCallTransfer feature is enabled or not.

Link copied to clipboard
fun isCellularCallAllowed(context: Context): Boolean

Call this method to check whether the CellularCall feature is enabled or not.

Link copied to clipboard
fun isChannelReachBackRequestAllowed(context: Context): Boolean
Link copied to clipboard
fun isChannelsAllowed(context: Context): Boolean

Call this method to check if Channel is allowed

Link copied to clipboard
fun isConferenceCallAllowed(context: Context): Boolean

Call this method to check whether the ConferenceCall feature is enabled or not.

Link copied to clipboard
fun isGuest(context: Context): Boolean

Call this method to check if the user is a guest

Link copied to clipboard
fun isHeadsetPlugged(): Boolean

Checks whether a wired headset is connected or not.

fun isHeadsetPluggedOrBluetoothDeviceConnected(): Boolean
Link copied to clipboard
fun isInstantReplayFeatureAllowed(context: Context): Boolean

Call this method to check if Instant replay feature is allowed or not

Link copied to clipboard
fun isInstantReplayFeatureEnabled(context: Context): Boolean

check if the Instant replay setting is enable/disable

Link copied to clipboard
fun isMultiChannelAllowed(context: Context): Boolean

Call this method to check if the user is allowed to use multi channel feature

Link copied to clipboard
fun isReachBackRequestAllowed(context: Context): Boolean
Link copied to clipboard
fun isShareVideoStreamingAllowed(context: Context): Boolean

Call this method to check whether the video streaming feature is enabled or not.

Link copied to clipboard
fun isVoiceMailAllowed(context: Context): Boolean

Call this method to check whether the Voice Mail feature is allowed or not

Link copied to clipboard
fun isVoipAlwaysConnectedModeAllowed(context: Context): Boolean

Call this method to check if voip always connected mode is allowed

Link copied to clipboard
fun isVoipCallAllowed(context: Context): Boolean

Call this method to check whether the voip feature is enabled or not.

Link copied to clipboard
fun isVoipVideoAllowed(context: Context): Boolean

Call this method to check whether the VoipVideo feature is enabled or not.

Link copied to clipboard
fun isVoipVideoCallAllowed(context: Context): Boolean

Call this method to check if Live video call is allowed

Link copied to clipboard
fun isWalkieTalkieAllowed(context: Context): Boolean

Call this method to check whether the Walkie-Talkie feature is enabled or not.

Link copied to clipboard
suspend fun joinAudioConferenceCall(context: Context, threadId: Int): ApiResult<STWVCall>

Call this method to join an ongoing Audio Conference call using a conversation id

Link copied to clipboard
suspend fun joinPTTCall(context: Context, threadId: Int): ApiResult<STWVCall>

Call this method to join an ongoing Audio Conference call using a conversation id

Link copied to clipboard
suspend fun mergeCalls(    context: Context,     sessionId1: String,     sessionId2: String,     conversationName: String): ApiResult<STWVCall>
Link copied to clipboard
fun onRequestPermissionForStack(permission: String, grantResult: Int)

Call this method to request permission. Should call this method after received the callback STWRequestPermissionsCallback.requestPermission to return the permission result (granted or denied)

Link copied to clipboard
fun redirectAudioOutputToBluetooth()

Call this method to change audio output in bluetooth device

Link copied to clipboard
fun redirectAudioOutputToEarpieceOrHeadset()

Call this method to change audio output in earpiece or headset

Note that : system not authorize headset and earpiece at the same time.

Link copied to clipboard
fun redirectAudioOutputToSpeaker()

Call this method to change audio output in loud speaker

Link copied to clipboard
fun refuseVoipCall(    context: Context,     vCall: STWVCall,     reason: Int?)
Link copied to clipboard
fun registerForExternalCameraPlug()

Call this method to register to camera attach/detach events

Link copied to clipboard

Call this method to register for permission callback

Link copied to clipboard
suspend fun removeFavoriteChannel(context: Context, channelIds: List<Long>): Int

Call this method to remove channel from favorite list .

Link copied to clipboard
fun searchChannelsAsFlow(    context: Context,     activeFirst: Boolean,     activeChannelOrderedByLevel: Boolean,     search: String?): Flow<List<STWVoipChannel>?>

This method will first emit the channels from the local database and then request the filtered company contacts from the remote server, it will then emit the result as soon as it is received merged with the local result.

Link copied to clipboard
fun setActiveCallID(sessionIdentifier: String): Boolean

Call this method to change the active call

Link copied to clipboard
fun setAudioLowLatencyLibrary(context: Context, lowLatencyLib: Int)

Call this method to change the audio low latency library that will be used for future calls

Link copied to clipboard
fun setAudioSource(context: Context, audioSource: Int)

Call this method to change the audio source

Link copied to clipboard
suspend fun startAudioConferenceCall(    context: Context,     threadId: Int,     forOnlyAvailableRecipients: Boolean = false,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new Audio Conference call using a conversation id

suspend fun startAudioConferenceCall(    context: Context,     recipients: List<STWRecipient>,     conversationName: String?,     forOnlyAvailableRecipients: Boolean = false,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new Audio Conference call using recipients list

Link copied to clipboard
suspend fun startCallOut(    context: Context,     recipient: STWRecipientSingle,     isAnonymous: Boolean = false): ApiResult<STWVCall>

Call this method to start a new call out using recipient

suspend fun startCallOut(    context: Context,     threadId: Int,     isAnonymous: Boolean = false): ApiResult<STWVCall>

Call this method to start a new call out using thread id

Link copied to clipboard
suspend fun startFreeCall(    context: Context,     recipient: STWRecipientSingle,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new audio VoIP call using recipient

suspend fun startFreeCall(    context: Context,     threadId: Int,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new audio VoIP call using a conversation ID

Link copied to clipboard
suspend fun startPTTCall(    context: Context,     threadId: Int,     forOnlyAvailableRecipients: Boolean = false,     floorRequestOnInvite: Boolean = false,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new PTT call using a conversation id

suspend fun startPTTCall(    context: Context,     recipients: List<STWRecipient>,     conversationName: String?,     forOnlyAvailableRecipients: Boolean = false,     floorRequestOnInvite: Boolean = false,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new PTT call using recipients list

Link copied to clipboard
suspend fun startVideoCall(    context: Context,     recipient: STWRecipientSingle,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new video call using recipient

suspend fun startVideoCall(    context: Context,     threadId: Int,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new video call using thread id

Link copied to clipboard
suspend fun startVideoStreamingSession(    context: Context,     recipients: List<STWRecipient>?,     callPriority: Int = STWCallPriority.NORMAL): ApiResult<STWVCall>

Call this method to start a new Video Streaming session with recipients list or to dispatcher

Link copied to clipboard
fun stopCall(context: Context, stwvCall: STWVCall)
Link copied to clipboard
suspend fun transferCall(    context: Context,     vCall: STWVCall,     recipient: STWRecipientSingle): ApiResult<STWVCall>

Call this method to transfer an ongoing live call (1 to 1) to a new user

Link copied to clipboard
suspend fun transferCallToExternal(    context: Context,     vCall: STWVCall,     recipient: STWRecipientSingle,     isAnonymous: Boolean = false): ApiResult<STWVCall>

Call this method to transfer an ongoing live call (1 to 1) to an external user

Link copied to clipboard
fun unRegisterForExternalCameraPlug()

Call this method to unRegister to camera attach/detach events

Link copied to clipboard
fun unRegisterForRequestPermissionCallback()

Call this method to unregister from permission callback

Link copied to clipboard
suspend fun updateFavoriteChannel(    context: Context,     selectedList: List<Long>,     unselectedList: List<Long>,     callback: (ApiResult<Any>) -> Unit?? = null)

Call this method to update list of favorite channel (add/remove) .

Inherited functions

Link copied to clipboard
fun subscribe(listener: STWEventListener<STWEvent>): Disposable
Link copied to clipboard
fun subscribeFor(eventTypes: Array<Class<out STWEvent>>, listener: STWEventListener<STWEvent>): Disposable
fun subscribeFor(eventTypes: Array<String>, listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client.

fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<Class<out STWEvent>>,     listener: STWEventListener<STWEvent>): Disposable
fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<String>,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client, in the lifecycle of lifecycleOwner.

fun subscribeFor(    eventTypes: Array<String>,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client with additional filter.

fun subscribeFor(    lifecycleOwner: LifecycleOwner,     eventTypes: Array<String>,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes to the specific eventTypes of the client with additional filter, in the lifecycle of lifecycleOwner.

Link copied to clipboard
fun <T : STWEvent> subscribeForSingle(eventType: Class<T>, listener: STWEventListener<T>): Disposable
fun subscribeForSingle(eventType: String, listener: STWEventListener<STWEvent>): Disposable

Subscribes for the next event with the given eventType.

fun subscribeForSingle(    eventType: String,     filter: (STWEvent) -> Boolean,     listener: STWEventListener<STWEvent>): Disposable

Subscribes for the next event with the given eventType with additional filter.