Skip to content

Commit

Permalink
feat(api): add ivr.proto (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeflood authored Aug 22, 2022
1 parent c116079 commit d1505ce
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
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;

}

0 comments on commit d1505ce

Please sign in to comment.