We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9ac25a commit eda65b9Copy full SHA for eda65b9
call.go
@@ -92,3 +92,21 @@ func (cli *Client) handleCallEvent(node *waBinary.Node) {
92
cli.dispatchEvent(&events.UnknownCallEvent{Node: node})
93
}
94
95
+
96
+// RejectCall reject an incoming call.
97
+func (cli *Client) RejectCall(callFrom types.JID, callID string) error {
98
+ ownID := cli.getOwnID()
99
+ if ownID.IsEmpty() {
100
+ return ErrNotLoggedIn
101
+ }
102
+ ownID, callFrom = ownID.ToNonAD(), callFrom.ToNonAD()
103
+ return cli.sendNode(waBinary.Node{
104
+ Tag: "call",
105
+ Attrs: waBinary.Attrs{"id": cli.GenerateMessageID(), "from": ownID, "to": callFrom},
106
+ Content: []waBinary.Node{{
107
+ Tag: "reject",
108
+ Attrs: waBinary.Attrs{"call-id": callID, "call-creator": callFrom, "count": "0"},
109
+ Content: nil,
110
+ }},
111
+ })
112
+}
0 commit comments