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

feat(api): add ivr.proto #727

Merged
merged 13 commits into from
Aug 22, 2022
71 changes: 71 additions & 0 deletions docs/en/design/notify/phone_call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# PhoneCall API design

## What would you like to be added
IVR API, or PhoneCall API

Developers can invoke this API to send voice messages to specific people.

## Why is this needed
In the monitoring scenarios, monitor systems need to send alarm messages to people on-call.
The messages might be in different forms, including IM,SMS, Email and phone calls, depending on the level of urgency.

## Product research
| IVR product |Docs|
|---|---|
|Aliyun VMS| https://www.aliyun.com/product/vms |
|AWS Pinpoint | https://aws.amazon.com/cn/pinpoint/ |


## Detailed Design

We need to consider the following factors:
- Portability
For example, a monitor system might be deployed on alibaba cloud(using [VMS](https://www.aliyun.com/product/vms) to send voice message) or AWS (using [AWS Pinpoint](https://aws.amazon.com/cn/pinpoint/) to send voice message). So portability is important here.

```proto
// PhoneCallService is one of Notify APIs. It's used to send voice messages
service PhoneCallService {

// Send voice using the specific template
rpc SendVoiceWithTemplate(SendVoiceWithTemplateRequest) returns (SendVoiceWithTemplateResponse) {}

}

// The request of SendVoiceWithTemplate method
message SendVoiceWithTemplateRequest{

// If your system uses multiple IVR services at the same time,
// you can specify which service to use with this field.
string service_name = 1;

// Required
VoiceTemplate template = 2;

// Required
repeated string to_mobile = 3;

// This field is required by some cloud providers.
string from_mobile = 4;

}

// VoiceTemplate
message VoiceTemplate{

// Required
string template_id = 1;

// Required
map<string, string> template_params = 2;

}

// The response of `SendVoiceWithTemplate` method
message SendVoiceWithTemplateResponse{

// Id of this request.
string request_id = 1;

}

```
53 changes: 53 additions & 0 deletions spec/proto/runtime/v1/phone_call.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
syntax = "proto3";

package spec.proto.runtime.v1;

import "google/protobuf/empty.proto";
import "google/protobuf/any.proto";

option go_package = "mosn.io/layotto/spec/proto/runtime/v1;runtime";

// PhoneCallService is one of Notify APIs. It's used to send voice messages
service PhoneCallService {

// Send voice using the specific template
rpc SendVoiceWithTemplate(SendVoiceWithTemplateRequest) returns (SendVoiceWithTemplateResponse) {}

}

// The request of SendVoiceWithTemplate method
message SendVoiceWithTemplateRequest{

// If your system uses multiple IVR services at the same time,
// you can specify which service to use with this field.
string service_name = 1;

// Required
VoiceTemplate template = 2;

// Required
repeated string to_mobile = 3;

// This field is required by some cloud providers.
string from_mobile = 4;

}

// VoiceTemplate
message VoiceTemplate{

// Required
string template_id = 1;

// Required
map<string, string> template_params = 2;

}

// The response of `SendVoiceWithTemplate` method
message SendVoiceWithTemplateResponse{

// Id of this request.
string request_id = 1;

}