feat: complete WhatsApp call signaling (voice, video, call links) (#245)
feat: complete WhatsApp call signaling (voice, video, call links) (#245)
This commit is contained in:
+43
-1
@@ -1,4 +1,30 @@
|
||||
export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'accept' | 'terminate'
|
||||
export type WACallUpdateType =
|
||||
| 'offer'
|
||||
| 'ringing'
|
||||
| 'timeout'
|
||||
| 'reject'
|
||||
| 'accept'
|
||||
| 'terminate'
|
||||
| 'preaccept'
|
||||
| 'transport'
|
||||
| 'relaylatency'
|
||||
| 'group_update'
|
||||
| 'reminder'
|
||||
| 'heartbeat'
|
||||
| 'mute_v2'
|
||||
| 'enc_rekey'
|
||||
| 'video'
|
||||
| 'relay'
|
||||
|
||||
export type WACallParticipant = {
|
||||
jid?: string
|
||||
/** 'connected' | 'invited' | 'left' etc. */
|
||||
state?: string
|
||||
/** Phone number in s.whatsapp.net format */
|
||||
userPn?: string
|
||||
/** 'admin' for group call link creator */
|
||||
type?: string
|
||||
}
|
||||
|
||||
export type WACallEvent = {
|
||||
chatId: string
|
||||
@@ -13,4 +39,20 @@ export type WACallEvent = {
|
||||
latencyMs?: number
|
||||
/** Phone number of the caller (sanitized to fix Brazilian landline bug) */
|
||||
callerPn?: string
|
||||
/** Call link token (forms URL: https://call.whatsapp.com/video/<token>) */
|
||||
linkToken?: string
|
||||
/** JID of who created the call link */
|
||||
linkCreator?: string
|
||||
/** Phone number of link creator */
|
||||
linkCreatorPn?: string
|
||||
/** Media type: 'video' or 'audio' */
|
||||
media?: string
|
||||
/** Max participants for group/link calls */
|
||||
connectedLimit?: number
|
||||
/** Participants in a group/link call */
|
||||
participants?: WACallParticipant[]
|
||||
/** Call duration in ms (from terminate/call_summary) */
|
||||
duration?: number
|
||||
/** Terminate reason (e.g. 'group_call_ended', 'accepted_elsewhere', 'timeout') */
|
||||
terminateReason?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user