Skip to content

Commit

Permalink
Is/bug fix/call state fix for caller (#308)
Browse files Browse the repository at this point in the history
* Set CallState Active for onAnswered Received

* Post bye message for caller as well from current call

* Post Ringing message for onRingingReceived

---------

Co-authored-by: Isaac <[email protected]>
  • Loading branch information
isaacakakpo1 and isaacd3v authored Jul 4, 2023
1 parent 17d913c commit 745837b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
19 changes: 19 additions & 0 deletions telnyx_rtc/src/main/java/com/telnyx/webrtc/sdk/Call.kt
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ class Call(
)
)
)
// send bye message to the UI
client.socketResponseLiveData.postValue(
SocketResponse.messageReceived(
ReceivedMessageBody(
SocketMethod.BYE.methodName,
null
)
)
)
callStateLiveData.postValue(CallState.DONE)
client.removeFromCalls(callId)
client.callNotOngoing()
Expand Down Expand Up @@ -435,6 +444,7 @@ class Call(
)
)
)
callStateLiveData.postValue(CallState.ACTIVE)
}
else -> {
// There was no SDP in the response, there was an error.
Expand Down Expand Up @@ -545,6 +555,15 @@ class Call(
} else {
UUID.randomUUID()
}
client.socketResponseLiveData.postValue(
SocketResponse.messageReceived(
ReceivedMessageBody(
SocketMethod.RINGING.methodName,
null
)
)
)

}

override fun onIceCandidateReceived(iceCandidate: IceCandidate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,14 @@ class TelnyxClient(
jsonObject
)
call?.onRingingReceived(jsonObject)
socketResponseLiveData.postValue(
SocketResponse.messageReceived(
ReceivedMessageBody(
SocketMethod.RINGING.methodName,
null
)
)
)
}

override fun onIceCandidateReceived(iceCandidate: IceCandidate) {
Expand Down

0 comments on commit 745837b

Please sign in to comment.