AlexaClientSDK  1.23.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CallStateObserverInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_CALLSTATEOBSERVERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_CALLSTATEOBSERVERINTERFACE_H_
18 
19 #include <iostream>
20 
21 namespace alexaClientSDK {
22 namespace avsCommon {
23 namespace sdkInterfaces {
24 
29 public:
31  enum class CallState {
33  CONNECTING,
41  NONE
42  };
43 
45  typedef struct CallStateInfo {
49  std::string callType;
55  std::string displayName;
57  std::string endpointLabel;
59  std::string inboundCalleeName;
61  std::string callProviderType;
63  std::string inboundRingtoneUrl;
65  std::string outboundRingbackUrl;
67  bool isDropIn;
68  } CallStateInfo;
69 
73  virtual ~CallStateObserverInterface() = default;
74 
80  virtual void onCallStateChange(CallState state) = 0;
81 
87  virtual void onCallStateInfoChange(const CallStateInfo& stateInfo);
88 
99  static bool isStateActive(const CallStateObserverInterface::CallState& state);
100 };
101 
109 inline std::ostream& operator<<(std::ostream& stream, const CallStateObserverInterface::CallState& state) {
110  switch (state) {
112  stream << "CONNECTING";
113  return stream;
115  stream << "INBOUND_RINGING";
116  return stream;
118  stream << "CALL_CONNECTED";
119  return stream;
121  stream << "CALL_DISCONNECTED";
122  return stream;
124  stream << "NONE";
125  return stream;
126  }
127  return stream << "UNKNOWN STATE";
128 }
129 
131  switch (state) {
135  return true;
138  return false;
139  }
140  return false;
141 }
142 
145  return;
146 }
147 
148 } // namespace sdkInterfaces
149 } // namespace avsCommon
150 } // namespace alexaClientSDK
151 
152 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_INCLUDE_AVSCOMMON_SDKINTERFACES_CALLSTATEOBSERVERINTERFACE_H_
std::string outboundRingbackUrl
Outbound ringtone url.
Definition: CallStateObserverInterface.h:65
std::ostream & operator<<(std::ostream &stream, const AudioInputProcessorObserverInterface::State &state)
Definition: AudioInputProcessorObserverInterface.h:86
virtual void onCallStateInfoChange(const CallStateInfo &stateInfo)
Definition: CallStateObserverInterface.h:143
std::string callType
The type of the call.
Definition: CallStateObserverInterface.h:49
std::string endpointLabel
Information about the endpoint of the contact.
Definition: CallStateObserverInterface.h:57
std::string displayName
Contact name to be displayed.
Definition: CallStateObserverInterface.h:55
CallState callState
An enum representing the state of a call.
Definition: CallStateObserverInterface.h:47
std::string callProviderType
Textual description of exact call provider type.
Definition: CallStateObserverInterface.h:61
static bool isStateActive(const CallStateObserverInterface::CallState &state)
Definition: CallStateObserverInterface.h:130
std::string currentSipUserAgentState
Current sipUserAgent state.
Definition: CallStateObserverInterface.h:53
CallState
An enumeration representing the state of a call.
Definition: CallStateObserverInterface.h:31
An struct containing call state information.
Definition: CallStateObserverInterface.h:45
std::string inboundCalleeName
Name of callee for whom incoming call is intended.
Definition: CallStateObserverInterface.h:59
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool isDropIn
This indicates if it&#39;s a drop in call or not.
Definition: CallStateObserverInterface.h:67
std::string inboundRingtoneUrl
Inbound ringtone url.
Definition: CallStateObserverInterface.h:63
struct alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo CallStateInfo
An struct containing call state information.
std::string previousSipUserAgentState
Previous sipUserAgent state.
Definition: CallStateObserverInterface.h:51

AlexaClientSDK 1.23.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0