phone.proto 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2020 The gRPC Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package grpc.testing;
  16. message CallInfo {
  17. string session_id = 1;
  18. string media = 2;
  19. }
  20. message CallState {
  21. enum State {
  22. // The default state.
  23. UNDEFINED = 0;
  24. // The call is newly created.
  25. NEW = 1;
  26. // The call is connected.
  27. ACTIVE = 6;
  28. // The call is finished.
  29. ENDED = 7;
  30. }
  31. State state = 2;
  32. }
  33. message StreamCallRequest {
  34. string phone_number = 1;
  35. }
  36. message StreamCallResponse {
  37. oneof stream_call_response {
  38. CallInfo call_info = 1;
  39. CallState call_state = 2;
  40. }
  41. }
  42. service Phone {
  43. // Makes a phone call and communicate states via a stream.
  44. rpc StreamCall(stream StreamCallRequest) returns (stream StreamCallResponse);
  45. }