signalwire-js
signalwire-js copied to clipboard
CF SDK - Implicit reattach
Description
This PR will enable developers to integrate call reattachment without explicitly calling the "reattach" method. The "dial" method now tracks calls based on the destination address, and in cases where the call is not terminated correctly (e.g., due to a page reload, or the user pressing the browser back button), the "dial" method will automatically perform an implicit reattach without notifying the developer or user.
This is the default behavior which can be overridden by passing the optional flag allowReattach: false
to the "dial" method.
The explicit "reattach" method is still available for the developer to use.
Type of change
- [ ] Internal refactoring
- [ ] Bug fix (bugfix - non-breaking)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Code snippets
const call = await client.dial({ to: "......", allowReattach: true|false })