-
Notifications
You must be signed in to change notification settings - Fork 0
Observe call events
kristiyan-petrov edited this page Nov 23, 2023
·
7 revisions
To observe the call state it is necessary to observe the state flow exposed.
call.state.onEach { callState ->
Log.d("CALL STATE", "$callState")
}.launchIn(MainScope())
Whenever a call is recorded, the call recording type can be either manual (recording is started by admin callee) or automatic (recording starts when the call is connected).
Call.Recording.Type can be retrieved from call info as show below.
call.recording.onEach { callRecordingType ->
Log.d("CALL RECORDING TYPE", "$callRecordingType") // Call.Recording.Type.OnConnect or Call.Recording.Type.OnDemand or Call.Recording.Type.Never
}.launchIn(MainScope())
Call recording state can be observed as shown below:
call.recording.flatMapLatest { it.state }.onEach { callRecordingState ->
Log.d("CALL RECORDING STATE", "$callRecordingState")
}.launchIn(MainScope())