AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CommunicationsNamespace.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_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_COMMUNICATIONSNAMESPACE_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_COMMUNICATIONSNAMESPACE_H_
18 
20 
21 namespace alexaClientSDK {
22 namespace sampleApplications {
23 namespace ipcServerSampleApp {
24 namespace ipc {
25 namespace IPCNamespaces {
26 
28 static const char IPC_MSG_NAMESPACE_COMMUNICATIONS[] = "Communications";
29 
31 static const int IPC_MSG_VERSION_COMMUNICATIONS(1);
32 
34 static const char IPC_MSG_CALL_STATE_TAG[] = "callState";
35 
37 static const char IPC_MSG_NAME_CALL_STATE_CHANGE[] = "callStateChange";
38 
40 static const char IPC_MSG_CALL_TYPE_TAG[] = "callType";
41 
43 static const char IPC_MSG_PREVIOUS_SIP_USER_AGENT_STATE_TAG[] = "previousSipUserAgentState";
44 
46 static const char IPC_MSG_CURRENT_SIP_USER_AGENT_STATE_TAG[] = "currentSipUserAgentState";
47 
49 static const char IPC_MSG_DISPLAY_NAME_TAG[] = "displayName";
50 
52 static const char IPC_MSG_END_POINT_LABEL_TAG[] = "endpointLabel";
53 
55 static const char IPC_MSG_INBOUND_CALLEE_NAME_TAG[] = "inboundCalleeName";
56 
58 static const char IPC_MSG_CALL_PROVIDER_TYPE_TAG[] = "callProviderType";
59 
61 static const char IPC_MSG_INBOUND_RINGTONE_URL_TAG[] = "inboundRingtoneUrl";
62 
64 static const char IPC_MSG_OUTBOUND_RINGBACK_URL_TAG[] = "outboundRingbackUrl";
65 
67 static const char IPC_MSG_IS_DROP_IN_TAG[] = "isDropIn";
68 
73 public:
80  Message(IPC_MSG_NAMESPACE_COMMUNICATIONS, IPC_MSG_VERSION_COMMUNICATIONS, IPC_MSG_NAME_CALL_STATE_CHANGE) {
81  std::ostringstream oss;
82  oss << callStateInfo.callState;
83  addMemberInPayload(IPC_MSG_CALL_STATE_TAG, oss.str());
84  addMemberInPayload(IPC_MSG_CALL_TYPE_TAG, callStateInfo.callType);
85  addMemberInPayload(IPC_MSG_PREVIOUS_SIP_USER_AGENT_STATE_TAG, callStateInfo.previousSipUserAgentState);
86  addMemberInPayload(IPC_MSG_CURRENT_SIP_USER_AGENT_STATE_TAG, callStateInfo.currentSipUserAgentState);
87  addMemberInPayload(IPC_MSG_DISPLAY_NAME_TAG, callStateInfo.displayName);
88  addMemberInPayload(IPC_MSG_END_POINT_LABEL_TAG, callStateInfo.endpointLabel);
89  addMemberInPayload(IPC_MSG_INBOUND_CALLEE_NAME_TAG, callStateInfo.inboundCalleeName);
90  addMemberInPayload(IPC_MSG_CALL_PROVIDER_TYPE_TAG, callStateInfo.callProviderType);
91  addMemberInPayload(IPC_MSG_INBOUND_RINGTONE_URL_TAG, callStateInfo.inboundRingtoneUrl);
92  addMemberInPayload(IPC_MSG_OUTBOUND_RINGBACK_URL_TAG, callStateInfo.outboundRingbackUrl);
93  addMemberInPayload(IPC_MSG_IS_DROP_IN_TAG, callStateInfo.isDropIn);
94  addPayload();
95  }
96 };
97 
98 } // namespace IPCNamespaces
99 } // namespace ipc
100 } // namespace ipcServerSampleApp
101 } // namespace sampleApplications
102 } // namespace alexaClientSDK
103 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_COMMUNICATIONSNAMESPACE_H_
std::string outboundRingbackUrl
Outbound ringtone url.
Definition: CallStateObserverInterface.h:69
static const char IPC_MSG_OUTBOUND_RINGBACK_URL_TAG[]
The outboundRingbackUrl json key in the message.
Definition: CommunicationsNamespace.h:64
static const char IPC_MSG_IS_DROP_IN_TAG[]
The isDropIn json key in the message.
Definition: CommunicationsNamespace.h:67
static const char IPC_MSG_CALL_TYPE_TAG[]
The callType json key in the message.
Definition: CommunicationsNamespace.h:40
Message & addMemberInPayload(const std::string &name, const std::string &value)
Definition: Message.h:101
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
static const char IPC_MSG_END_POINT_LABEL_TAG[]
The endpointLabel json key in the message.
Definition: CommunicationsNamespace.h:52
std::string callProviderType
Textual description of exact call provider type.
Definition: CallStateObserverInterface.h:61
CallStateChangeMessage(const avsCommon::sdkInterfaces::CallStateObserverInterface::CallStateInfo &callStateInfo)
Definition: CommunicationsNamespace.h:79
static const char IPC_MSG_CALL_PROVIDER_TYPE_TAG[]
The callProviderType json key in the message.
Definition: CommunicationsNamespace.h:58
Message(const std::string &nameSpace, const int version, const std::string &name)
Definition: Message.h:64
static const char IPC_MSG_CURRENT_SIP_USER_AGENT_STATE_TAG[]
The currentSipUserAgentState json key in the message.
Definition: CommunicationsNamespace.h:46
std::string currentSipUserAgentState
Current sipUserAgent state.
Definition: CallStateObserverInterface.h:53
static const char IPC_MSG_CALL_STATE_TAG[]
The callState json key in the message.
Definition: CommunicationsNamespace.h:34
static const char IPC_MSG_INBOUND_CALLEE_NAME_TAG[]
The inboundCalleeName json key in the message.
Definition: CommunicationsNamespace.h:55
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:71
std::string inboundRingtoneUrl
Inbound ringtone url.
Definition: CallStateObserverInterface.h:67
static const char IPC_MSG_NAMESPACE_COMMUNICATIONS[]
The message namespace for Comms.
Definition: CommunicationsNamespace.h:28
static const char IPC_MSG_PREVIOUS_SIP_USER_AGENT_STATE_TAG[]
The previousSipUserAgentState json key in the message.
Definition: CommunicationsNamespace.h:43
static const char IPC_MSG_INBOUND_RINGTONE_URL_TAG[]
The inboundRingtoneUrl json key in the message.
Definition: CommunicationsNamespace.h:61
static const char IPC_MSG_DISPLAY_NAME_TAG[]
The displayName json key in the message.
Definition: CommunicationsNamespace.h:49
static const int IPC_MSG_VERSION_COMMUNICATIONS(1)
The namespace version for Communications.
std::string previousSipUserAgentState
Previous sipUserAgent state.
Definition: CallStateObserverInterface.h:51
static const char IPC_MSG_NAME_CALL_STATE_CHANGE[]
The message name for callStateChange.
Definition: CommunicationsNamespace.h:37

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