Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Client disconnection on network loss (#25170)
* Clickup Task: https://app.clickup.com/t/245c0d8 Description: Agent gets disconnected (or Unregistered) from asterisk in multiple ways. The goal is that agent should remain online unless agent explicitly logs off. Agent can stop receiving calls in multiple ways due to network loss. Network loss can happen in following ways. 1. User tries to switch the network. User experiences a glitch of disconnectivity. This can be simulated by turning the network off in the network tab of chrome's dev tool. This can disconnect the UA if the disconnection happens just before the registration refresh. 2. Second reason is when computer goes in sleep mode. 3. Third reason is that when asterisk is crashed/in maintenance mode/explicitly stopped. Solution: The idea is to detect the network disconnection and start the start the attempts to reconnect. The detection of the disconnection does not happen in case#1. The SIPUA's UserAgent transport does not call onDisconnected when network loss of such kind happens. To tackle this problem, window's online and offline event handlers are used. The number of retries is configurable but ideally it is to be kept at -1. Whenever disconnection happens, it should keep on trying to reconnect with increasing backoff time. This behaviour is useful when the asterisk is stopped. When the server is disconnected, it should be indicated on the phone button. * Clickup Task: https://app.clickup.com/t/245c0d8 Description: 1. Replaced complex state handling in OmnichannelCallToggleReady.tsx. This was creating lot of erros. Added simple network status check and the phone button displays the latest state of things. 2. Some files were overwriting the changes in develop branch. Replaced that with correct changes. * Clickup Task: https://app.clickup.com/t/245c0d8 Description: Adding semi-colon to fix error. * Clickup Task : https://app.clickup.com/t/245c0d8 Description : Fixing review commnts. * removing unused files * Clickup Task: https://app.clickup.com/t/245c0d8 Description: Renaming file to correct the spelling. Making necessary changes in index.ts * Clickup Task: https://app.clickup.com/t/245c0d8 Description: Fixing incorrect spelling. * Add description to setting Co-authored-by: Kevin Aleman <kaleman960@gmail.com>
- Loading branch information