reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Event.cxx
Go to the documentation of this file.
1#include "Event.hxx"
3
4#define RESIPROCATE_SUBSYSTEM kurento::KurentoSubsystem::KURENTOCLIENT
5
6using namespace kurento;
7
8const std::string OnIceCandidateFoundEvent::EVENT_NAME = "IceCandidateFound";
9const std::string OnIceGatheringDoneEvent::EVENT_NAME = "IceGatheringDone";
10const std::string OnConnectionStateChangedEvent::EVENT_NAME = "ConnectionStateChanged";
11const std::string OnMediaStateChangedEvent::EVENT_NAME = "MediaStateChanged";
12const std::string OnMediaTranscodingStateChangeEvent::EVENT_NAME = "MediaTranscodingStateChange";
13const std::string OnMediaFlowInStateChangeEvent::EVENT_NAME = "MediaFlowInStateChange";
14const std::string OnMediaFlowOutStateChangeEvent::EVENT_NAME = "MediaFlowOutStateChange";
15const std::string OnKeyframeRequiredEvent::EVENT_NAME = "KeyframeRequired";
16const std::string OnErrorEvent::EVENT_NAME = "Error";
17const std::string OnDataChannelOpenEvent::EVENT_NAME = "DataChannelOpen";
18
19Event::Event(const std::string& name)
20 : mName(name)
21{
22}
23
25{
26}
27
28std::shared_ptr<Event>
29Event::make_event(const std::string& eventType, const json::Object& message)
30{
31 Event* event = 0;
32
34 event = new OnIceCandidateFoundEvent(message);
36 event = new OnIceGatheringDoneEvent(message);
38 event = new OnConnectionStateChangedEvent(message);
40 event = new OnMediaStateChangedEvent(message);
42 event = new OnMediaTranscodingStateChangeEvent(message);
44 event = new OnMediaFlowInStateChangeEvent(message);
46 event = new OnMediaFlowOutStateChangeEvent(message);
48 event = new OnKeyframeRequiredEvent(message);
50 event = new OnErrorEvent(message);
52 event = new OnDataChannelOpenEvent(message);
53 }
54 return std::shared_ptr<Event>(event);
55}
56
58 : Event(EVENT_NAME)
59{
60 json::Object candidate = message["params"]["value"]["data"]["candidate"];
61 mCandidate = json::String(candidate["candidate"]).Value();
62 mLineIndex = json::Number(candidate["sdpMLineIndex"]).Value();
63 mId = json::String(candidate["sdpMid"]).Value();
64}
65
69
71 : Event(EVENT_NAME)
72{
73}
74
78
80 : Event(EVENT_NAME)
81{
82}
83
87
89 : Event(EVENT_NAME)
90{
91}
92
96
98 : Event(EVENT_NAME)
99{
100}
101
105
107 : Event(EVENT_NAME)
108{
109}
110
114
116 : Event(EVENT_NAME)
117{
118}
119
123
125 : Event(EVENT_NAME)
126{
127}
128
132
133OnErrorEvent::OnErrorEvent(const json::Object& message)
134 : Event(EVENT_NAME)
135{
136}
137
141
143 : Event(EVENT_NAME)
144{}
145
148
149/* ====================================================================
150
151 Copyright (c) 2021, Software Freedom Institute https://softwarefreedom.institute
152 Copyright (c) 2021, Daniel Pocock https://danielpocock.com
153 All rights reserved.
154
155 Redistribution and use in source and binary forms, with or without
156 modification, are permitted provided that the following conditions are
157 met:
158
159 1. Redistributions of source code must retain the above copyright
160 notice, this list of conditions and the following disclaimer.
161
162 2. Redistributions in binary form must reproduce the above copyright
163 notice, this list of conditions and the following disclaimer in the
164 documentation and/or other materials provided with the distribution.
165
166 3. Neither the name of Plantronics nor the names of its contributors
167 may be used to endorse or promote products derived from this
168 software without specific prior written permission.
169
170 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
171 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
172 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
173 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
174 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
175 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
176 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
177 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
178 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
179 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
180 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
181
182 ==================================================================== */
Event(const std::string &name)
Definition Event.cxx:19
virtual ~Event()
Definition Event.cxx:24
static std::shared_ptr< Event > make_event(const std::string &eventType, const json::Object &message)
Definition Event.cxx:29
static const std::string EVENT_NAME
Definition Event.hxx:66
OnConnectionStateChangedEvent(const json::Object &message)
Definition Event.cxx:79
OnDataChannelOpenEvent(const json::Object &message)
Definition Event.cxx:142
static const std::string EVENT_NAME
Definition Event.hxx:129
virtual ~OnErrorEvent()
Definition Event.cxx:138
static const std::string EVENT_NAME
Definition Event.hxx:120
OnErrorEvent(const json::Object &message)
Definition Event.cxx:133
OnIceCandidateFoundEvent(const json::Object &message)
Definition Event.cxx:57
static const std::string EVENT_NAME
Definition Event.hxx:39
static const std::string EVENT_NAME
Definition Event.hxx:57
OnIceGatheringDoneEvent(const json::Object &message)
Definition Event.cxx:70
static const std::string EVENT_NAME
Definition Event.hxx:111
OnKeyframeRequiredEvent(const json::Object &message)
Definition Event.cxx:124
static const std::string EVENT_NAME
Definition Event.hxx:93
OnMediaFlowInStateChangeEvent(const json::Object &message)
Definition Event.cxx:106
OnMediaFlowOutStateChangeEvent(const json::Object &message)
Definition Event.cxx:115
static const std::string EVENT_NAME
Definition Event.hxx:102
static const std::string EVENT_NAME
Definition Event.hxx:75
OnMediaStateChangedEvent(const json::Object &message)
Definition Event.cxx:88
OnMediaTranscodingStateChangeEvent(const json::Object &message)
Definition Event.cxx:97
static const std::string EVENT_NAME
Definition Event.hxx:84
This class is used in the logging subsystem to identify logging messages generated from the Kurento c...
void list()
Definition userAdmin.cxx:66