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
55 changes: 55 additions & 0 deletions docs/en/design/notify/ivr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# IVR 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

service IvrService {

//Send voice using the specific template
seeflood marked this conversation as resolved.
Show resolved Hide resolved
rpc SendVoiceWithTemplate(SendVoiceWithTemplateRequest) returns (SendVoiceWithTemplateResponse) {}

}

message SendVoiceWithTemplateRequest{
// Required
Template template = 1;
// Required
string to_mobile = 2;
seeflood marked this conversation as resolved.
Show resolved Hide resolved
// This field is required by some cloud providers.
string from_mobile = 3;
}

message Template{
// Required
string template_id = 1;
// Required
map<string, string> template_params = 2;
}

message SendVoiceWithTemplateResponse{
string message_id = 1;
}


```
35 changes: 35 additions & 0 deletions spec/proto/runtime/v1/ivr.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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";

service IvrService {

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

}

message SendVoiceWithTemplateRequest{
// Required
Template template = 1;
// Required
string to_mobile = 2;
seeflood marked this conversation as resolved.
Show resolved Hide resolved
// This field is required by some cloud providers.
string from_mobile = 3;
}

message Template{
// Required
string template_id = 1;
// Required
map<string, string> template_params = 2;
}

message SendVoiceWithTemplateResponse{
string message_id = 1;
}