Skip to content

Reject Call don't work #201746

@adibmak

Description

@adibmak

Issue Description

client.once("ready", () => {
if (typeof client.setRejectIncomingCalls === "function") {
client.setRejectIncomingCalls(true).catch(() => {});
}
});
client.on("call", async (call) => {
if (call.fromMe) return;
try {
await call.reject();
console.log(
[${tenantId}] Rejected incoming ${call.isVideo ? "video" : "voice"} call from ${call.from},
);
} catch (e) {
console.error([${tenantId}] rejectCall:, e.message);
}
});

Reproduction Steps

client.on("call", async (call) => {
if (call.fromMe) return;
try {
await call.reject();
console.log(
[${tenantId}] Rejected incoming ${call.isVideo ? "video" : "voice"} call from ${call.from},
);
} catch (e) {
console.error([${tenantId}] rejectCall:, e.message);
}
});

Code Sample

User Setup

WhatsApp Type
Account Type WhatsApp Business
Authentication Strategy LocalAuth
WhatsApp Web Version latest
whatsapp-web.js Version 1.34.7
Environment Version
Browser Type cmd
Browser Version v
Phone OS Version 1.34.7
Running OS Version windows
Node.js Version 1.34.7

Checklist

  • I use the latest released version of whatsapp-web.js.
  • I have searched existing issues and confirmed this is not a duplicate.
  • I have verified this is a library issue, not a problem with my code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenissued highHigh impact issuetypingsType definitions

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions