refactor: simplifica a lógica de terminação de chamada

This commit is contained in:
Felipe Medeiros 2024-10-07 01:30:03 -03:00
parent b80b203670
commit 0af00582f0

View File

@ -1677,11 +1677,7 @@ export class BaileysStartupService extends ChannelStartupService {
try { try {
const call = await this.client.offerCall(jid); const call = await this.client.offerCall(jid);
if (callDuration) { if (callDuration) {
setTimeout(async () => { setTimeout(() => this.client.terminateCall(call.id, call.to), callDuration * 1000);
console.log('Terminating call');
const aaa = await this.client.terminateCall(call.id, call.to);
console.log(aaa);
}, callDuration * 1000);
} }
return call; return call;