@@ -19,9 +19,6 @@ option go_package = "github.com/livekit/protocol/livekit";
1919option csharp_namespace = "LiveKit.Proto" ;
2020option ruby_package = "LiveKit::Proto" ;
2121
22- import "connectors/whatsapp_webhook.proto" ;
23- import "connectors/whatsapp_common.proto" ;
24-
2522service ConnectorsService {
2623 rpc CreateWhatsAppParticipant (CreateWhatsAppParticipantRequest ) returns (CreateWhatsAppParticipantResponse );
2724
@@ -35,37 +32,74 @@ service ConnectorsService {
3532}
3633
3734message 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
4345message CreateWhatsAppParticipantResponse {
4446}
4547
4648message 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+
5276message DeleteWhatsAppParticipantResponse {
5377}
5478
5579message 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
6292message ConnectWhatsAppCallResponse {
6393 string whatsapp_call_id = 1 ;
6494}
6595
6696message 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
71105message RejectWhatsAppCallResponse {
@@ -76,7 +110,8 @@ message ListWhatsAppCallsRequest {
76110}
77111
78112message ListWhatsAppCallsResponse {
79- repeated livekit.connectors.WhatsAppCall calls = 1 ;
113+ // list of call ids that are currently active
114+ repeated string calls = 1 ;
80115}
81116
82117message ConnectorsDispatchRule {
0 commit comments