-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} |