Skip to content

Commit cd848ff

Browse files
committed
cleanup
1 parent 3a1550d commit cd848ff

5 files changed

Lines changed: 49 additions & 235 deletions

File tree

magefile.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ func Proto() error {
7979
"rpc/whip_signal.proto",
8080
"rpc/sip.proto",
8181
}
82-
connectorProtoFiles := []string{
83-
"connectors/whatsapp_api.proto",
84-
"connectors/whatsapp_common.proto",
85-
"connectors/whatsapp_webhook.proto",
86-
}
8782

8883
fmt.Println("generating protobuf")
8984
target := "livekit"
@@ -199,19 +194,6 @@ func Proto() error {
199194
return err
200195
}
201196

202-
fmt.Println("generating connector protobuf")
203-
args = append([]string{
204-
"--go_out", ".",
205-
"--go_opt=paths=source_relative",
206-
"--plugin=go=" + protocGoPath,
207-
"-I=./protobufs",
208-
}, connectorProtoFiles...)
209-
cmd = exec.Command(protoc, args...)
210-
connectStd(cmd)
211-
if err := cmd.Run(); err != nil {
212-
return err
213-
}
214-
215197
return nil
216198
}
217199

protobufs/connectors/whatsapp_api.proto

Lines changed: 0 additions & 53 deletions
This file was deleted.

protobufs/connectors/whatsapp_common.proto

Lines changed: 0 additions & 63 deletions
This file was deleted.

protobufs/connectors/whatsapp_webhook.proto

Lines changed: 0 additions & 87 deletions
This file was deleted.

protobufs/livekit_connectors.proto

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ option go_package = "github.com/livekit/protocol/livekit";
1919
option csharp_namespace = "LiveKit.Proto";
2020
option ruby_package = "LiveKit::Proto";
2121

22-
import "connectors/whatsapp_webhook.proto";
23-
import "connectors/whatsapp_common.proto";
24-
2522
service ConnectorsService {
2623
rpc CreateWhatsAppParticipant(CreateWhatsAppParticipantRequest) returns (CreateWhatsAppParticipantResponse);
2724

@@ -35,37 +32,74 @@ service ConnectorsService {
3532
}
3633

3734
message CreateWhatsAppParticipantRequest {
35+
// The number of the business that is initiating the call
3836
string from_phone_number_id = 1;
37+
// The number of the user that is supossed to receive the call
3938
string to_phone_number_id = 2;
40-
optional string biz_opaque_callback_data = 3; // for logging purposes
39+
// The API key of the business that is initiating the call
40+
string whatsapp_api_key = 3;
41+
// An arbitrary string you can pass in that is useful for tracking and logging purposes.
42+
optional string biz_opaque_callback_data = 4;
4143
}
4244

4345
message CreateWhatsAppParticipantResponse {
4446
}
4547

4648
message DeleteWhatsAppParticipantRequest {
47-
optional string whatsapp_call_id = 1;
48-
optional livekit.connectors.WhatsAppCallWebhook call_terminate_webhook = 2;
49-
optional bool is_call_rejected = 3;
49+
oneof request {
50+
DeleteWhatsAppParticipantWithCallId call_id = 1;
51+
DeleteWhatsAppParticipantForRejectedCall rejected_call = 2;
52+
// when the call is rejected by the other side, we receive a webhook:
53+
// https://developers.facebook.com/docs/whatsapp/cloud-api/calling/business-initiated-calls#call-status-webhook
54+
string call_status_rejected_webhook = 3;
55+
// when the call is terminated by the other side, we receive a webhook:
56+
// https://developers.facebook.com/docs/whatsapp/cloud-api/calling/business-initiated-calls#call-terminate-webhook
57+
// terminate webhook is the same for both user and business initiated calls
58+
string call_terminate_webhook = 4;
59+
}
5060
}
5161

62+
message DeleteWhatsAppParticipantWithCallId {
63+
// when the call is rejected or terminated by the other side, we don't need to make any API calls
64+
// we only need to do it when we are terminating the call
65+
string phone_number_id = 1;
66+
string whatsapp_call_id = 2;
67+
string whatsapp_api_key = 3;
68+
69+
}
70+
71+
message DeleteWhatsAppParticipantForRejectedCall {
72+
string whatsapp_call_id = 1;
73+
}
74+
75+
5276
message DeleteWhatsAppParticipantResponse {
5377
}
5478

5579
message ConnectWhatsAppCallRequest {
56-
string livekit_participant_identity= 1;
57-
map<string, string> participant_attributes = 2;
58-
livekit.connectors.WhatsAppCallWebhook call_connect_webhook = 3;
59-
ConnectorsDispatchRule dispatch_rule = 4;
80+
string phone_number_id = 1;
81+
string whatsapp_api_key = 2;
82+
string livekit_participant_identity= 3;
83+
map<string, string> livekit_participant_attributes = 4;
84+
ConnectorsDispatchRule dispatch_rule = 5;
85+
oneof request {
86+
string whatsapp_call_id = 6;
87+
string call_connect_webhook = 7;
88+
}
89+
6090
}
6191

6292
message ConnectWhatsAppCallResponse {
6393
string whatsapp_call_id = 1;
6494
}
6595

6696
message RejectWhatsAppCallRequest {
67-
optional string whatsapp_call_id = 1;
68-
optional livekit.connectors.WhatsAppCallWebhook call_connect_webhook = 2;
97+
string phone_number_id = 1;
98+
string whatsapp_api_key = 2;
99+
oneof request {
100+
string whatsapp_call_id = 3;
101+
string call_connect_webhook = 4;
102+
}
69103
}
70104

71105
message RejectWhatsAppCallResponse {
@@ -76,7 +110,8 @@ message ListWhatsAppCallsRequest {
76110
}
77111

78112
message ListWhatsAppCallsResponse {
79-
repeated livekit.connectors.WhatsAppCall calls = 1;
113+
// list of call ids that are currently active
114+
repeated string calls = 1;
80115
}
81116

82117
message ConnectorsDispatchRule {

0 commit comments

Comments
 (0)