Closed itzharDev closed 3 years ago
not able to fin anything ...but sound a great idea
I've spent some time on it. It's simple enough to listen to a call event but because Whatsapp web doesn't actually deal with calls, I can't get it to reject the call even, yet.
I think reject is nice to have, but not mandatory
@github-actions run
@itzharDev you can now use client.onIncomingCall
https://smashah.github.io/sulla/classes/whatsapp.html#onincomingcall
Here's the call object interface: https://github.com/smashah/sulla/blob/master/src/api/model/call.ts
peerJid
is the number of the caller.
client.onIncomingCall(call=>console.log('newcall',call));
Let me know if this works for you. There may be a solution to rejecting the call but its a slim chance.
Thanks
Thank you so much, Is there a way to reject or accept the incoming call please?
@tinyCoder32 not right yet maybe in the future.
This is tested so closing for now. Report back if there are further issues.
Apparently call rejection is possible now. Reopening to implement rejectCall
I'm new to open-wa. is there any "Easy API" parameter to detect call and send a reply to the caller?
A reply as a text...yes
client.onIncomingCall(call => {
client.sendText(call.peerJid, 'Lo sentimos, pero no podemos atender su llamada, por favor envienos un audio o un mensaje con su consulta');
; });
A reply as a text...yes
client.onIncomingCall(call => { client.sendText(call.peerJid, 'Lo sentimos, pero no podemos atender su llamada, por favor envienos un audio o un mensaje con su consulta'); ; });
thank you for the reply.
but I'm using the open-wa webhook method to get messages to my system.
npx @open-wa/wa-automate -w 'https://my.domain.com/7a00ac21-60f2-411e-a571-515b37b2025a'
like this.
i trying to find any parameter to handle "Incoming Call"..
or is there any place to input that code.?
@malakaisbest If I'm understanding you correctly, it looks like you need some sort of automatic call response message - where you can set a flag with a default message to send to a number that is trying to call you - which is not a feature yet, but it can be.
Would something like this work for you?
> npx @open-wa/wa-automate -w 'https://my.domain.com/7a00ac21-60f2-411e-a571-515b37b2025a' --on-call "Please do not call this number"
yes absolutely.
@malakaisbest great idea. I'll implement that now.
@github-actions run
@malakaisbest
Please update your local npx cache and try it out!
> npm i @open-wa/wa-automate@latest
> npx @open-wa/wa-automate -w 'https://my.domain.com/7a00ac21-60f2-411e-a571-515b37b2025a' --on-call "Please do not call this number"
@malakaisbest
Please update your local npx cache and try it out!
> npm i @open-wa/wa-automate@latest > npx @open-wa/wa-automate -w 'https://my.domain.com/7a00ac21-60f2-411e-a571-515b37b2025a' --on-call "Please do not call this number"
I updated it.and it's working fine.. thank you very much :D :D :100:
just idea ~~ if there is any way to decline the call.it will be a good feature...
@malakaisbest Please update your local npx cache and try it out!
> npm i @open-wa/wa-automate@latest > npx @open-wa/wa-automate -w 'https://my.domain.com/7a00ac21-60f2-411e-a571-515b37b2025a' --on-call "Please do not call this number"
I updated it.and it's working fine.. thank you very much :D :D 💯
just idea ~~ if there is any way to decline the call.it will be a good feature...
Yes. That's the reason this issue is opened actually.
@github-actions run
@malakaisbest
You can now try out local call auto-reject as part of the Insider's Program. Please note, this will automatically reject the call from the host account device. The call from the initiator will continue to ring as if your host account device is offline. As of yet, there is nothing that can be done to remedy this.
Usage:
...
//just reject the call on the host account device
await client.autoReject()
//Reject the call and send a message to the call-initiating account.
await client.autoReject("Please do not call this number")
//If you have an insider's key both will return true, else false.
...
CLI:
> npx @open-wa/wa-automate ... --auto-reject --on-call "Please do not call this number"
Everybody in this issue above this comment will be getting a free-for-life Insider's Program license key, please DM me on discord to redeem.
For anyone else, please follow the instructions here: https://docs.openwa.dev/pages/The%20Client/licensed-features.html#keys
@malakaisbest
You can now try out local call auto-reject as part of the Insider's Program. Please note, this will automatically reject the call from the host account device. The call from the initiator will continue to ring as if your host account device is offline. As of yet, there is nothing that can be done to remedy this.
Usage:
... //just reject the call on the host account device await client.autoReject() //Reject the call and send a message to the call-initiating account. await client.autoReject("Please do not call this number") //If you have an insider's key both will return true, else false. ...
CLI:
> npx @open-wa/wa-automate ... --auto-reject --on-call "Please do not call this number"
Everybody in this issue above this comment will be getting a free-for-life Insider's Program license key, please DM me on discord to redeem.
For anyone else, please follow the instructions here: https://docs.openwa.dev/pages/The%20Client/licensed-features.html#keys
@smashah thanks for the call auto-reject function. I updated to the 4.4.0 version. but still this function not working for me. The caller and receiver ringing without auto rejecting the call. how can I fix this?
@malakaisbest you need a license to use this feature. Please click on the discord badge in the readme and DM me on discord
Is there any event for incoming call?
For bots is good to auto reject for calls