Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls support #40

Open
billantony opened this issue May 1, 2023 · 28 comments
Open

Calls support #40

billantony opened this issue May 1, 2023 · 28 comments
Labels
enhancement New feature or request

Comments

@billantony
Copy link

Before adding this issue, make sure you do the following to make sure this is not a duplicate:

  1. Search through the repo's previous issues
  2. Read through the readme at least once
  3. Search the docs for the feature you're looking for

I am interested in handling incoming voice calls on WhatsApp programmatically.

Receive incoming WhatsApp calls
Answer the call
Receive streaming data and send data back simultaneously in a bidirectional connection
End the call

@erickythierry
Copy link
Contributor

up

1 similar comment
@Guilherme-j10
Copy link

up

@Auties00
Copy link
Collaborator

Auties00 commented May 5, 2023

Before adding this issue, make sure you do the following to make sure this is not a duplicate:

  1. Search through the repo's previous issues
  2. Read through the readme at least once
  3. Search the docs for the feature you're looking for

I am interested in handling incoming voice calls on WhatsApp programmatically.

Receive incoming WhatsApp calls Answer the call Receive streaming data and send data back simultaneously in a bidirectional connection End the call

you can't do that currently, we are working on it

@ripreal
Copy link

ripreal commented May 16, 2023

I have noticed that sending voice call is possible to implement. But what to do next i do not understand

{ "tag": "call", "attrs": { "to": { "_jid": { "type": 1, "user": "1234567890", "device": 0, "domainType": 0 } }, "id": "5223.12338-39" }, "content": [ { "tag": "relaylatency", "attrs": { "call-id": "0DDBB7F053B6361A9A0A9F5369F6D5D7", "call-creator": { "_jid": { "type": 1, "user": "1234567890123", "device": 9, "domainType": 0 } } }, "content": [ { "tag": "te", "attrs": { "latency": "33554930" }, "content": { "0": 157, "1": 240, "2": 205, "3": 62, "4": 13, "5": 150 } }, { "tag": "destination", "attrs": {}, "content": [ { "tag": "to", "attrs": { "jid": { "_jid": { "type": 1, "user": "1234567890", "device": 0, "domainType": 0 } } }, "content": null }, { "tag": "to", "attrs": { "jid": { "_jid": { "type": 1, "user": "1234567890", "device": 29, "domainType": 0 } } }, "content": null } ] } ] } ] }

@Auties00
Copy link
Collaborator

I have noticed that sending voice call is possible to implement. But what to do next i do not understand

{ "tag": "call", "attrs": { "to": { "_jid": { "type": 1, "user": "1234567890", "device": 0, "domainType": 0 } }, "id": "5223.12338-39" }, "content": [ { "tag": "relaylatency", "attrs": { "call-id": "0DDBB7F053B6361A9A0A9F5369F6D5D7", "call-creator": { "_jid": { "type": 1, "user": "1234567890123", "device": 9, "domainType": 0 } } }, "content": [ { "tag": "te", "attrs": { "latency": "33554930" }, "content": { "0": 157, "1": 240, "2": 205, "3": 62, "4": 13, "5": 150 } }, { "tag": "destination", "attrs": {}, "content": [ { "tag": "to", "attrs": { "jid": { "_jid": { "type": 1, "user": "1234567890", "device": 0, "domainType": 0 } } }, "content": null }, { "tag": "to", "attrs": { "jid": { "_jid": { "type": 1, "user": "1234567890", "device": 29, "domainType": 0 } } }, "content": null } ] } ] } ] }

as i said it's possible, but it still needs to be implemented as it's a very complex issue

@edgardmessias
Copy link
Contributor

There are two parts to work with calls: the websocket commands and the WebRTC connection.

I am able to understand how to offer or accept a call, but the WebRTC connection is the problem.

They use a full customized version of pjsip.

The code that I did to offer a call, without connecting: https://github.com/wppconnect-team/wa-js/blob/00abf6bfe42424a3dc126b06bd11e8ba50e1888b/src/call/functions/offer.ts#L70

@edgardmessias
Copy link
Contributor

The steps:

  • Socket: Send a offer call
    • Response: {rte: <some ip:port>, key: <base64>, relay: {te2:<ip:port>, token}[]}
  • Nodejs: Process the response and get the ice/stun servers and token
  • WebRTC: Send a customized STUN request to make a NAT connection
    • Custom attribute 0x4000: Maybe part of token
    • XOR-RELAYED-ADDRESS: ip of server
    • MESSAGE-INTEGRITY: HMAC-SHA1 of message
  • WebRTC: Send a customized STUN request to PING
    • Custom attribute: 0x4002 or 0x4003
  • Nodejs: Get the timming of response for each server
  • Socket: Send a relaylatency with the timming of ping
  • ... to find out yet

@ripreal
Copy link

ripreal commented May 16, 2023

@edgardmessias cool. But i did not find in code https://github.com/wppconnect-team/wa-js/blob/00abf6bfe42424a3dc126b06bd11e8ba50e1888b/src/call/functions/offer.ts#L70 proto like this. Are you using it?
`
interface ICall {

        /** Call callKey */
        callKey?: (Uint8Array|null);

        /** Call conversionSource */
        conversionSource?: (string|null);

        /** Call conversionData */
        conversionData?: (Uint8Array|null);

        /** Call conversionDelaySeconds */
        conversionDelaySeconds?: (number|null);
    }

`

@edgardmessias
Copy link
Contributor

@ripreal probally this proto is a part of puzzle to solve

@clairton
Copy link

+1

@badereddineqodia
Copy link

+2

@WeberIT
Copy link

WeberIT commented Aug 24, 2023

+3

atm i have absolutely no time but ill be in the boat if i can get some free time

@zhinea
Copy link

zhinea commented Sep 28, 2023

+4

@Auties00 Auties00 changed the title Handling Incoming Whatsapp Calls Programmatically Calls support Oct 5, 2023
@Auties00 Auties00 added the enhancement New feature or request label Oct 5, 2023
@clairton
Copy link

clairton commented Dec 2, 2023

@Pulij
Copy link

Pulij commented Feb 3, 2024

https://github.com/bhavya32/WA-Calls

don't work:(

@Keito-Klein
Copy link

Before adding this issue, make sure you do the following to make sure this is not a duplicate:

  1. Search through the repo's previous issues
  2. Read through the readme at least once
  3. Search the docs for the feature you're looking for

I am interested in handling incoming voice calls on WhatsApp programmatically.

Receive incoming WhatsApp calls
Answer the call
Receive streaming data and send data back simultaneously in a bidirectional connection
End the call

I interested too, but i want reject that call when receive incoming Whatsapp call. I've tried various methods but still can't find the function.

@gamersindo1223
Copy link

is there any update?

@ahmedRSA
Copy link

ahmedRSA commented Apr 1, 2024

any update on this?

@irux
Copy link

irux commented Jun 9, 2024

Any new findings on this?

@erickythierry
Copy link
Contributor

Any new findings on this?

There probably won't be anything else coming out about this (at least not here)
since those mainly responsible for this adaptation ended up leaving the project due to legal notice from Meta

@Mangaka-bot
Copy link

What's new? Any updates on this issue?

@Pulij
Copy link

Pulij commented Sep 22, 2024

What's new? Any updates on this issue?

No:(

@erickythierry
Copy link
Contributor

What's new? Any updates on this issue?

There is a Brazilian company that managed to make it work (with the help of the current main maintainer of Baileys)
wavoip

@billantony
Copy link
Author

You can explore this library
https://github.com/rs-company-project/wavoip-api

@billantony
Copy link
Author

You can integrate it into Baileys, it works well

@gamersindo1223
Copy link

You can integrate it into Baileys, it works well

But looks like it's a service.

@Guilherme-j10
Copy link

You can integrate it into Baileys, it works well

But looks like it's a service.

yep its a service, and u need pay to use

@billantony billantony reopened this Oct 4, 2024
@kabaweb
Copy link

kabaweb commented Oct 10, 2024

Regarding this information, is it possible to replicate it and then leave it in an open project? From what I understand, communication is a point with socket.io to then communicate with asterix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests