Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
e127ef09
Commit
e127ef09
authored
Nov 17, 2017
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send full state NOTIFY of a conference to a specific device.
parent
c50ba661
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
local-conference-event-handler-p.h
src/conference/local-conference-event-handler-p.h
+3
-1
local-conference-event-handler.cpp
src/conference/local-conference-event-handler.cpp
+15
-12
No files found.
src/conference/local-conference-event-handler-p.h
View file @
e127ef09
...
...
@@ -29,10 +29,11 @@
LINPHONE_BEGIN_NAMESPACE
class
Participant
;
class
ParticipantDevice
;
class
LocalConferenceEventHandlerPrivate
:
public
ObjectPrivate
{
public
:
void
notifyFullState
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
Participant
>
&
participant
);
void
notifyFullState
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
Participant
Device
>
&
device
);
void
notifyAllExcept
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
Participant
>
&
exceptParticipant
);
void
notifyAll
(
const
std
::
string
&
notify
);
std
::
string
createNotifyFullState
(
int
notifyId
=
-
1
);
...
...
@@ -52,6 +53,7 @@ private:
std
::
string
createNotify
(
Xsd
::
ConferenceInfo
::
ConferenceType
confInfo
,
int
notifyId
=
-
1
,
bool
isFullState
=
false
);
void
notifyParticipant
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
Participant
>
&
participant
);
void
notifyParticipantDevice
(
const
std
::
string
&
notify
,
const
std
::
shared_ptr
<
ParticipantDevice
>
&
device
);
L_DECLARE_PUBLIC
(
LocalConferenceEventHandler
);
};
...
...
src/conference/local-conference-event-handler.cpp
View file @
e127ef09
...
...
@@ -37,8 +37,8 @@ using namespace Xsd::ConferenceInfo;
// -----------------------------------------------------------------------------
void
LocalConferenceEventHandlerPrivate
::
notifyFullState
(
const
string
&
notify
,
const
shared_ptr
<
Participant
>
&
participant
)
{
notifyParticipant
(
notify
,
participant
);
void
LocalConferenceEventHandlerPrivate
::
notifyFullState
(
const
string
&
notify
,
const
shared_ptr
<
Participant
Device
>
&
device
)
{
notifyParticipant
Device
(
notify
,
device
);
}
void
LocalConferenceEventHandlerPrivate
::
notifyAllExcept
(
const
string
&
notify
,
const
shared_ptr
<
Participant
>
&
exceptParticipant
)
{
...
...
@@ -54,14 +54,17 @@ void LocalConferenceEventHandlerPrivate::notifyAll (const string ¬ify) {
}
void
LocalConferenceEventHandlerPrivate
::
notifyParticipant
(
const
string
&
notify
,
const
shared_ptr
<
Participant
>
&
participant
)
{
for
(
const
auto
&
device
:
participant
->
getPrivate
()
->
getDevices
())
{
if
(
device
->
isSubscribedToConferenceEventPackage
())
{
LinphoneEvent
*
ev
=
device
->
getConferenceSubscribeEvent
();
LinphoneContent
*
content
=
linphone_core_create_content
(
ev
->
lc
);
linphone_content_set_buffer
(
content
,
(
const
uint8_t
*
)
notify
.
c_str
(),
strlen
(
notify
.
c_str
()));
linphone_event_notify
(
ev
,
content
);
linphone_content_unref
(
content
);
}
for
(
const
auto
&
device
:
participant
->
getPrivate
()
->
getDevices
())
notifyParticipantDevice
(
notify
,
device
);
}
void
LocalConferenceEventHandlerPrivate
::
notifyParticipantDevice
(
const
string
&
notify
,
const
shared_ptr
<
ParticipantDevice
>
&
device
)
{
if
(
device
->
isSubscribedToConferenceEventPackage
())
{
LinphoneEvent
*
ev
=
device
->
getConferenceSubscribeEvent
();
LinphoneContent
*
content
=
linphone_core_create_content
(
ev
->
lc
);
linphone_content_set_buffer
(
content
,
(
const
uint8_t
*
)
notify
.
c_str
(),
strlen
(
notify
.
c_str
()));
linphone_event_notify
(
ev
,
content
);
linphone_content_unref
(
content
);
}
}
...
...
@@ -280,9 +283,9 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev) {
if
(
linphone_event_get_subscription_state
(
lev
)
==
LinphoneSubscriptionActive
)
{
unsigned
int
lastNotify
=
static_cast
<
unsigned
int
>
(
Utils
::
stoi
(
linphone_event_get_custom_header
(
lev
,
"Last-Notify-Version"
)));
if
(
lastNotify
==
0
)
{
lInfo
()
<<
"Sending initial notify of conference:"
<<
d
->
conf
->
getConferenceAddress
().
asStringUriOnly
()
<<
" to: "
<<
participant
->
getAddress
().
asString
();
lInfo
()
<<
"Sending initial notify of conference:"
<<
d
->
conf
->
getConferenceAddress
().
asStringUriOnly
()
<<
" to: "
<<
device
->
getGruu
().
asString
();
device
->
setConferenceSubscribeEvent
(
lev
);
d
->
notifyFullState
(
d
->
createNotifyFullState
(),
participant
);
d
->
notifyFullState
(
d
->
createNotifyFullState
(),
device
);
}
else
if
(
lastNotify
<
d
->
lastNotify
)
{
lInfo
()
<<
"Sending all missed notify for conference:"
<<
d
->
conf
->
getConferenceAddress
().
asStringUriOnly
()
<<
" from: "
<<
lastNotify
<<
" to: "
<<
participant
->
getAddress
().
asString
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment