Skip to content

Commit

Permalink
Merge pull request #86 from signalwire/joao/force_reconnection
Browse files Browse the repository at this point in the history
Force reconnection
  • Loading branch information
jpsantosbh authored May 7, 2024
2 parents 33800c9 + 2ee9293 commit a8c22a8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions public/full.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,18 @@ window.answer = async () => {
updateUIConnected()
}

/**
* Dev Only
*/

window.simulate_no_packets = () => {
window.__call._closeWSConnection();
}

window.simulate_socket_error = () => {
window.__client.__wsClient.wsClient.store.dispatch({type: "session.forceClose"})
}

window.reject = async () => {
await window.__invite.reject()
restoreUI()
Expand Down
6 changes: 6 additions & 0 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@
<button id="btnDisconnect" class="btn btn-danger d-none" onclick="hangup()">
Disconnect
</button>
<button id="btnDisconnect" class="btn btn-danger d-none" onclick="simulate_no_packets()">
No Packets Received
</button>
<button id="btnDisconnect" class="btn btn-danger d-none" onclick="simulate_socket_error()">
Socket Error
</button>
</div>

<div class="text-center mt-3 text-muted">
Expand Down

0 comments on commit a8c22a8

Please sign in to comment.