mirror of
https://github.com/chatwoot/chatwoot.git
synced 2026-06-28 21:01:02 +08:00
Enables agents to initiate outbound calls and receive incoming calls directly from the Chatwoot dashboard, with Twilio as the initial provider. Fixes: #11481 > This is an integration branch to ensure features works well and might be often broken on down merges, we will be extracting the functionalities via smaller PRs into develop - [x] https://github.com/chatwoot/chatwoot/pull/11775 - [x] https://github.com/chatwoot/chatwoot/pull/12218 - [x] https://github.com/chatwoot/chatwoot/pull/12243 - [x] https://github.com/chatwoot/chatwoot/pull/12268 - [x] https://github.com/chatwoot/chatwoot/pull/12361 - [x] https://github.com/chatwoot/chatwoot/pull/12782 - [x] #13064 - [ ] Ability for agents to join the inbound calls ( included in this PR ) --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Muhsin Keloth <[email protected]> Co-authored-by: Sivin Varghese <[email protected]> Co-authored-by: iamsivin <[email protected]> Co-authored-by: Pranav <[email protected]>
29 lines
540 B
JavaScript
29 lines
540 B
JavaScript
export default class Timer {
|
|
constructor(onTick = null) {
|
|
this.elapsed = 0;
|
|
this.intervalId = null;
|
|
this.onTick = onTick;
|
|
}
|
|
|
|
start() {
|
|
if (this.intervalId) {
|
|
clearInterval(this.intervalId);
|
|
}
|
|
this.elapsed = 0;
|
|
this.intervalId = setInterval(() => {
|
|
this.elapsed += 1;
|
|
if (this.onTick) {
|
|
this.onTick(this.elapsed);
|
|
}
|
|
}, 1000);
|
|
}
|
|
|
|
stop() {
|
|
if (this.intervalId) {
|
|
clearInterval(this.intervalId);
|
|
this.intervalId = null;
|
|
}
|
|
this.elapsed = 0;
|
|
}
|
|
}
|