AlexaClientSDK  1.26.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_
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::onCallStateInfoChange
virtual void onCallStateInfoChange(const CallStateInfo &stateInfo)
Definition: CallStateObserverInterface.h:143
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::endpointLabel
std::string endpointLabel
Information about the endpoint of the contact.
Definition: CallStateObserverInterface.h:57
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallState::CALL_CONNECTED
@ CALL_CONNECTED
The call has successfully connected.
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallState
CallState
An enumeration representing the state of a call.
Definition: CallStateObserverInterface.h:31
alexaClientSDK::avsCommon::sdkInterfaces::operator<<
std::ostream & operator<<(std::ostream &stream, const AudioInputProcessorObserverInterface::State &state)
Definition: AudioInputProcessorObserverInterface.h:86
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface
Definition: CallStateObserverInterface.h:28
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallState::INBOUND_RINGING
@ INBOUND_RINGING
An incoming call is causing a ringtone to be played.
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::isDropIn
bool isDropIn
This indicates if it's a drop in call or not.
Definition: CallStateObserverInterface.h:67
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo
struct alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo CallStateInfo
An struct containing call state information.
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::inboundRingtoneUrl
std::string inboundRingtoneUrl
Inbound ringtone url.
Definition: CallStateObserverInterface.h:63
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::~CallStateObserverInterface
virtual ~CallStateObserverInterface()=default
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::onCallStateChange
virtual void onCallStateChange(CallState state)=0
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallState::NONE
@ NONE
No current call state to be relayed to the user.
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::outboundRingbackUrl
std::string outboundRingbackUrl
Outbound ringtone url.
Definition: CallStateObserverInterface.h:65
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::inboundCalleeName
std::string inboundCalleeName
Name of callee for whom incoming call is intended.
Definition: CallStateObserverInterface.h:59
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallState::CALL_DISCONNECTED
@ CALL_DISCONNECTED
The call has ended.
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::previousSipUserAgentState
std::string previousSipUserAgentState
Previous sipUserAgent state.
Definition: CallStateObserverInterface.h:51
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::displayName
std::string displayName
Contact name to be displayed.
Definition: CallStateObserverInterface.h:55
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo
An struct containing call state information.
Definition: CallStateObserverInterface.h:45
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::isStateActive
static bool isStateActive(const CallStateObserverInterface::CallState &state)
Definition: CallStateObserverInterface.h:130
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::callType
std::string callType
The type of the call.
Definition: CallStateObserverInterface.h:49
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallState::CONNECTING
@ CONNECTING
The call is connecting.
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::currentSipUserAgentState
std::string currentSipUserAgentState
Current sipUserAgent state.
Definition: CallStateObserverInterface.h:53
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::callState
CallState callState
An enum representing the state of a call.
Definition: CallStateObserverInterface.h:47
alexaClientSDK::avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo::callProviderType
std::string callProviderType
Textual description of exact call provider type.
Definition: CallStateObserverInterface.h:61

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