Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
bb5b22b9
Commit
bb5b22b9
authored
Nov 21, 2017
by
Ghislain MARY
Browse files
Use IdentityAddress in conference.
parent
7b3df0c4
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
103 additions
and
102 deletions
+103
-102
src/c-wrapper/api/c-chat-room.cpp
src/c-wrapper/api/c-chat-room.cpp
+5
-1
src/chat/chat-room/basic-chat-room.cpp
src/chat/chat-room/basic-chat-room.cpp
+5
-5
src/chat/chat-room/basic-chat-room.h
src/chat/chat-room/basic-chat-room.h
+4
-4
src/chat/chat-room/client-group-chat-room-p.h
src/chat/chat-room/client-group-chat-room-p.h
+1
-1
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+19
-19
src/chat/chat-room/client-group-chat-room.h
src/chat/chat-room/client-group-chat-room.h
+7
-7
src/chat/chat-room/server-group-chat-room-p.h
src/chat/chat-room/server-group-chat-room-p.h
+2
-2
src/chat/chat-room/server-group-chat-room-stub.cpp
src/chat/chat-room/server-group-chat-room-stub.cpp
+7
-7
src/chat/chat-room/server-group-chat-room.h
src/chat/chat-room/server-group-chat-room.h
+4
-4
src/conference/conference-interface.h
src/conference/conference-interface.h
+5
-5
src/conference/conference-listener.h
src/conference/conference-listener.h
+4
-4
src/conference/conference-p.h
src/conference/conference-p.h
+2
-2
src/conference/conference.cpp
src/conference/conference.cpp
+10
-9
src/conference/conference.h
src/conference/conference.h
+6
-6
src/conference/handlers/local-conference-event-handler.cpp
src/conference/handlers/local-conference-event-handler.cpp
+12
-12
src/conference/local-conference.cpp
src/conference/local-conference.cpp
+5
-7
src/conference/local-conference.h
src/conference/local-conference.h
+3
-3
src/conference/participant-device.cpp
src/conference/participant-device.cpp
+1
-1
src/conference/participant-device.h
src/conference/participant-device.h
+1
-1
src/conference/participant-p.h
src/conference/participant-p.h
+0
-2
No files found.
src/c-wrapper/api/c-chat-room.cpp
View file @
bb5b22b9
...
...
@@ -234,7 +234,11 @@ void linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAdd
}
void
linphone_chat_room_add_participants
(
LinphoneChatRoom
*
cr
,
const
bctbx_list_t
*
addresses
)
{
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
addParticipants
(
L_GET_RESOLVED_CPP_LIST_FROM_C_LIST
(
addresses
,
Address
),
nullptr
,
false
);
list
<
LinphonePrivate
::
Address
>
lAddr
=
L_GET_RESOLVED_CPP_LIST_FROM_C_LIST
(
addresses
,
Address
);
list
<
LinphonePrivate
::
IdentityAddress
>
lIdentAddr
;
for
(
const
auto
&
addr
:
lAddr
)
lIdentAddr
.
push_back
(
LinphonePrivate
::
IdentityAddress
(
addr
));
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
addParticipants
(
lIdentAddr
,
nullptr
,
false
);
}
bool_t
linphone_chat_room_can_handle_participants
(
const
LinphoneChatRoom
*
cr
)
{
...
...
src/chat/chat-room/basic-chat-room.cpp
View file @
bb5b22b9
...
...
@@ -46,16 +46,16 @@ bool BasicChatRoom::canHandleParticipants () const {
return
false
;
}
const
Address
&
BasicChatRoom
::
getConferenceAddress
()
const
{
const
Identity
Address
&
BasicChatRoom
::
getConferenceAddress
()
const
{
lError
()
<<
"a BasicChatRoom does not have a conference address"
;
return
Utils
::
getEmptyConstRefObject
<
Address
>
();
return
Utils
::
getEmptyConstRefObject
<
Identity
Address
>
();
}
void
BasicChatRoom
::
addParticipant
(
const
Address
&
,
const
CallSessionParams
*
,
bool
)
{
void
BasicChatRoom
::
addParticipant
(
const
Identity
Address
&
,
const
CallSessionParams
*
,
bool
)
{
lError
()
<<
"addParticipant() is not allowed on a BasicChatRoom"
;
}
void
BasicChatRoom
::
addParticipants
(
const
list
<
Address
>
&
,
const
CallSessionParams
*
,
bool
)
{
void
BasicChatRoom
::
addParticipants
(
const
list
<
Identity
Address
>
&
,
const
CallSessionParams
*
,
bool
)
{
lError
()
<<
"addParticipants() is not allowed on a BasicChatRoom"
;
}
...
...
@@ -67,7 +67,7 @@ void BasicChatRoom::removeParticipants (const list<shared_ptr<Participant>> &) {
lError
()
<<
"removeParticipants() is not allowed on a BasicChatRoom"
;
}
shared_ptr
<
Participant
>
BasicChatRoom
::
findParticipant
(
const
Address
&
)
const
{
shared_ptr
<
Participant
>
BasicChatRoom
::
findParticipant
(
const
Identity
Address
&
)
const
{
lError
()
<<
"findParticipant() is not allowed on a BasicChatRoom"
;
return
nullptr
;
}
...
...
src/chat/chat-room/basic-chat-room.h
View file @
bb5b22b9
...
...
@@ -34,17 +34,17 @@ class LINPHONE_PUBLIC BasicChatRoom : public ChatRoom {
public:
CapabilitiesMask
getCapabilities
()
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
const
Identity
Address
&
getConferenceAddress
()
const
override
;
bool
canHandleParticipants
()
const
override
;
void
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipant
(
const
Identity
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Identity
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
)
override
;
void
removeParticipants
(
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
participants
)
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Identity
Address
&
addr
)
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
...
...
src/chat/chat-room/client-group-chat-room-p.h
View file @
bb5b22b9
...
...
@@ -31,7 +31,7 @@ class ClientGroupChatRoomPrivate : public ChatRoomPrivate {
public:
ClientGroupChatRoomPrivate
()
=
default
;
std
::
list
<
Address
>
cleanAddressesList
(
const
std
::
list
<
Address
>
&
addresses
)
const
;
std
::
list
<
Identity
Address
>
cleanAddressesList
(
const
std
::
list
<
Identity
Address
>
&
addresses
)
const
;
std
::
shared_ptr
<
CallSession
>
createSession
();
void
notifyReceived
(
const
std
::
string
&
body
);
void
multipartNotifyReceived
(
const
std
::
string
&
body
);
...
...
src/chat/chat-room/client-group-chat-room.cpp
View file @
bb5b22b9
...
...
@@ -39,13 +39,13 @@ LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
list
<
Address
>
ClientGroupChatRoomPrivate
::
cleanAddressesList
(
const
list
<
Address
>
&
addresses
)
const
{
list
<
Identity
Address
>
ClientGroupChatRoomPrivate
::
cleanAddressesList
(
const
list
<
Identity
Address
>
&
addresses
)
const
{
L_Q
();
list
<
Address
>
cleanedList
(
addresses
);
list
<
Identity
Address
>
cleanedList
(
addresses
);
cleanedList
.
sort
();
cleanedList
.
unique
();
for
(
auto
it
=
cleanedList
.
begin
();
it
!=
cleanedList
.
end
();)
{
if
(
q
->
findParticipant
(
*
it
)
||
(
q
->
getMe
()
->
getAddress
()
==
IdentityAddress
(
*
it
))
)
if
(
q
->
findParticipant
(
*
it
)
||
(
q
->
getMe
()
->
getAddress
()
==
*
it
))
it
=
cleanedList
.
erase
(
it
);
else
it
++
;
...
...
@@ -64,7 +64,7 @@ shared_ptr<CallSession> ClientGroupChatRoomPrivate::createSession () {
shared_ptr
<
Participant
>
focus
=
qConference
->
getPrivate
()
->
focus
;
shared_ptr
<
CallSession
>
session
=
focus
->
getPrivate
()
->
createSession
(
*
q
,
&
csp
,
false
,
q
);
const
Address
&
myAddress
=
q
->
getMe
()
->
getAddress
();
session
->
configure
(
LinphoneCallOutgoing
,
nullptr
,
nullptr
,
myAddress
,
focus
->
get
Contact
Address
());
session
->
configure
(
LinphoneCallOutgoing
,
nullptr
,
nullptr
,
myAddress
,
focus
->
getAddress
());
session
->
initiateOutgoing
();
return
session
;
}
...
...
@@ -105,25 +105,25 @@ bool ClientGroupChatRoom::canHandleParticipants () const {
return
RemoteConference
::
canHandleParticipants
();
}
const
Address
&
ClientGroupChatRoom
::
getConferenceAddress
()
const
{
const
Identity
Address
&
ClientGroupChatRoom
::
getConferenceAddress
()
const
{
return
RemoteConference
::
getConferenceAddress
();
}
void
ClientGroupChatRoom
::
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
list
<
Address
>
addresses
;
void
ClientGroupChatRoom
::
addParticipant
(
const
Identity
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
list
<
Identity
Address
>
addresses
;
addresses
.
push_back
(
addr
);
addParticipants
(
addresses
,
params
,
hasMedia
);
}
void
ClientGroupChatRoom
::
addParticipants
(
const
list
<
Address
>
&
addresses
,
const
list
<
Identity
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
L_D
();
L_D_T
(
RemoteConference
,
dConference
);
list
<
Address
>
addressesList
=
d
->
cleanAddressesList
(
addresses
);
list
<
Identity
Address
>
addressesList
=
d
->
cleanAddressesList
(
addresses
);
if
(
addressesList
.
empty
())
return
;
...
...
@@ -166,7 +166,7 @@ void ClientGroupChatRoom::removeParticipants (const list<shared_ptr<Participant>
RemoteConference
::
removeParticipants
(
participants
);
}
shared_ptr
<
Participant
>
ClientGroupChatRoom
::
findParticipant
(
const
Address
&
addr
)
const
{
shared_ptr
<
Participant
>
ClientGroupChatRoom
::
findParticipant
(
const
Identity
Address
&
addr
)
const
{
return
RemoteConference
::
findParticipant
(
addr
);
}
...
...
@@ -264,7 +264,7 @@ void ClientGroupChatRoom::leave () {
void
ClientGroupChatRoom
::
onChatMessageReceived
(
const
shared_ptr
<
ChatMessage
>
&
msg
)
{}
void
ClientGroupChatRoom
::
onConferenceCreated
(
const
Address
&
addr
)
{
void
ClientGroupChatRoom
::
onConferenceCreated
(
const
Identity
Address
&
addr
)
{
L_D
();
L_D_T
(
RemoteConference
,
dConference
);
dConference
->
conferenceAddress
=
addr
;
...
...
@@ -272,14 +272,14 @@ void ClientGroupChatRoom::onConferenceCreated (const Address &addr) {
getCore
()
->
getPrivate
()
->
insertChatRoom
(
getSharedFromThis
());
}
void
ClientGroupChatRoom
::
onConferenceTerminated
(
const
Address
&
addr
)
{
void
ClientGroupChatRoom
::
onConferenceTerminated
(
const
Identity
Address
&
addr
)
{
L_D
();
L_D_T
(
RemoteConference
,
dConference
);
dConference
->
eventHandler
->
resetLastNotify
();
d
->
setState
(
ChatRoom
::
State
::
Terminated
);
}
void
ClientGroupChatRoom
::
onFirstNotifyReceived
(
const
Address
&
addr
)
{
void
ClientGroupChatRoom
::
onFirstNotifyReceived
(
const
Identity
Address
&
addr
)
{
L_D
();
d
->
setState
(
ChatRoom
::
State
::
Created
);
getCore
()
->
getPrivate
()
->
insertChatRoomWithDb
(
getSharedFromThis
());
...
...
@@ -288,7 +288,7 @@ void ClientGroupChatRoom::onFirstNotifyReceived (const Address &addr) {
void
ClientGroupChatRoom
::
onParticipantAdded
(
const
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
{
L_D_T
(
RemoteConference
,
dConference
);
const
Address
&
addr
=
event
->
getParticipantAddress
();
const
Identity
Address
&
addr
=
event
->
getParticipantAddress
();
if
(
isMe
(
addr
))
return
;
...
...
@@ -318,7 +318,7 @@ void ClientGroupChatRoom::onParticipantRemoved (const shared_ptr<ConferenceParti
L_D_T
(
RemoteConference
,
dConference
);
const
Address
&
addr
=
event
->
getParticipantAddress
();
const
Identity
Address
&
addr
=
event
->
getParticipantAddress
();
shared_ptr
<
Participant
>
participant
=
findParticipant
(
addr
);
if
(
!
participant
)
{
lWarning
()
<<
"Participant "
<<
addr
.
asString
()
<<
" removed but not in the list of participants!"
;
...
...
@@ -337,7 +337,7 @@ void ClientGroupChatRoom::onParticipantRemoved (const shared_ptr<ConferenceParti
}
void
ClientGroupChatRoom
::
onParticipantSetAdmin
(
const
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
{
const
Address
&
addr
=
event
->
getParticipantAddress
();
const
Identity
Address
&
addr
=
event
->
getParticipantAddress
();
shared_ptr
<
Participant
>
participant
;
if
(
isMe
(
addr
))
participant
=
getMe
();
...
...
@@ -383,7 +383,7 @@ void ClientGroupChatRoom::onSubjectChanged (const shared_ptr<ConferenceSubjectEv
}
void
ClientGroupChatRoom
::
onParticipantDeviceAdded
(
const
shared_ptr
<
ConferenceParticipantDeviceEvent
>
&
event
,
bool
isFullState
)
{
const
Address
&
addr
=
event
->
getParticipantAddress
();
const
Identity
Address
&
addr
=
event
->
getParticipantAddress
();
shared_ptr
<
Participant
>
participant
;
if
(
isMe
(
addr
))
participant
=
getMe
();
...
...
@@ -410,7 +410,7 @@ void ClientGroupChatRoom::onParticipantDeviceAdded (const shared_ptr<ConferenceP
void
ClientGroupChatRoom
::
onParticipantDeviceRemoved
(
const
shared_ptr
<
ConferenceParticipantDeviceEvent
>
&
event
,
bool
isFullState
)
{
(
void
)
isFullState
;
const
Address
&
addr
=
event
->
getParticipantAddress
();
const
Identity
Address
&
addr
=
event
->
getParticipantAddress
();
shared_ptr
<
Participant
>
participant
;
if
(
isMe
(
addr
))
participant
=
getMe
();
...
...
@@ -450,7 +450,7 @@ void ClientGroupChatRoom::onCallSessionStateChanged (
if
(
state
==
LinphoneCallConnected
)
{
if
(
d
->
state
==
ChatRoom
::
State
::
CreationPending
)
{
Address
addr
(
session
->
getRemoteContactAddress
()
->
asStringUriOnly
());
Identity
Address
addr
(
session
->
getRemoteContactAddress
()
->
asStringUriOnly
());
onConferenceCreated
(
addr
);
if
(
session
->
getRemoteContactAddress
()
->
hasParam
(
"isfocus"
))
dConference
->
eventHandler
->
subscribe
(
getChatRoomId
());
...
...
src/chat/chat-room/client-group-chat-room.h
View file @
bb5b22b9
...
...
@@ -43,17 +43,17 @@ public:
CapabilitiesMask
getCapabilities
()
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
const
Identity
Address
&
getConferenceAddress
()
const
override
;
bool
canHandleParticipants
()
const
override
;
void
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipant
(
const
Identity
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Identity
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
)
override
;
void
removeParticipants
(
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
participants
)
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Identity
Address
&
addr
)
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
...
...
@@ -73,9 +73,9 @@ private:
void
onChatMessageReceived
(
const
std
::
shared_ptr
<
ChatMessage
>
&
msg
)
override
;
void
onConferenceCreated
(
const
Address
&
addr
)
override
;
void
onConferenceTerminated
(
const
Address
&
addr
)
override
;
void
onFirstNotifyReceived
(
const
Address
&
addr
)
override
;
void
onConferenceCreated
(
const
Identity
Address
&
addr
)
override
;
void
onConferenceTerminated
(
const
Identity
Address
&
addr
)
override
;
void
onFirstNotifyReceived
(
const
Identity
Address
&
addr
)
override
;
void
onParticipantAdded
(
const
std
::
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
override
;
void
onParticipantRemoved
(
const
std
::
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
override
;
void
onParticipantSetAdmin
(
const
std
::
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
override
;
...
...
src/chat/chat-room/server-group-chat-room-p.h
View file @
bb5b22b9
...
...
@@ -37,7 +37,7 @@ class ServerGroupChatRoomPrivate : public ChatRoomPrivate {
public:
ServerGroupChatRoomPrivate
()
=
default
;
std
::
shared_ptr
<
Participant
>
addParticipant
(
const
Address
&
addr
);
std
::
shared_ptr
<
Participant
>
addParticipant
(
const
Identity
Address
&
addr
);
void
confirmCreation
();
void
confirmJoining
(
SalCallOp
*
op
);
std
::
shared_ptr
<
Participant
>
findRemovedParticipant
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
const
;
...
...
@@ -46,7 +46,7 @@ public:
void
subscribeReceived
(
LinphoneEvent
*
event
);
void
update
(
SalCallOp
*
op
);
void
dispatchMessage
(
const
Address
&
fromAddr
,
const
Content
&
content
);
void
dispatchMessage
(
const
Identity
Address
&
fromAddr
,
const
Content
&
content
);
void
storeOrUpdateMessage
(
const
std
::
shared_ptr
<
ChatMessage
>
&
msg
)
override
;
LinphoneReason
messageReceived
(
SalOp
*
op
,
const
SalMessage
*
msg
)
override
;
void
setConferenceAddress
(
const
IdentityAddress
&
confAddr
);
...
...
src/chat/chat-room/server-group-chat-room-stub.cpp
View file @
bb5b22b9
...
...
@@ -29,7 +29,7 @@ LINPHONE_BEGIN_NAMESPACE
// -----------------------------------------------------------------------------
shared_ptr
<
Participant
>
ServerGroupChatRoomPrivate
::
addParticipant
(
const
Address
&
)
{
shared_ptr
<
Participant
>
ServerGroupChatRoomPrivate
::
addParticipant
(
const
Identity
Address
&
)
{
return
nullptr
;
}
...
...
@@ -55,7 +55,7 @@ void ServerGroupChatRoomPrivate::update (SalCallOp *) {}
// -----------------------------------------------------------------------------
void
ServerGroupChatRoomPrivate
::
dispatchMessage
(
const
Address
&
,
const
Content
&
)
{}
void
ServerGroupChatRoomPrivate
::
dispatchMessage
(
const
Identity
Address
&
,
const
Content
&
)
{}
void
ServerGroupChatRoomPrivate
::
storeOrUpdateMessage
(
const
shared_ptr
<
ChatMessage
>
&
)
{}
...
...
@@ -79,7 +79,7 @@ bool ServerGroupChatRoomPrivate::isAdminLeft () const {
ServerGroupChatRoom
::
ServerGroupChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
SalCallOp
*
op
)
:
ChatRoom
(
*
new
ServerGroupChatRoomPrivate
,
core
,
ChatRoomId
(
IdentityAddress
(
op
->
get_to
()),
IdentityAddress
(
op
->
get_to
()))),
LocalConference
(
core
,
Address
(
op
->
get_to
()),
nullptr
)
{}
LocalConference
(
core
,
Identity
Address
(
op
->
get_to
()),
nullptr
)
{}
int
ServerGroupChatRoom
::
getCapabilities
()
const
{
return
0
;
...
...
@@ -89,11 +89,11 @@ bool ServerGroupChatRoom::canHandleParticipants () const {
return
false
;
}
void
ServerGroupChatRoom
::
addParticipant
(
const
Address
&
,
const
CallSessionParams
*
,
bool
)
{}
void
ServerGroupChatRoom
::
addParticipant
(
const
Identity
Address
&
,
const
CallSessionParams
*
,
bool
)
{}
void
ServerGroupChatRoom
::
addParticipants
(
const
list
<
Address
>
&
,
const
CallSessionParams
*
,
bool
)
{}
void
ServerGroupChatRoom
::
addParticipants
(
const
list
<
Identity
Address
>
&
,
const
CallSessionParams
*
,
bool
)
{}
const
Address
&
ServerGroupChatRoom
::
getConferenceAddress
()
const
{
const
Identity
Address
&
ServerGroupChatRoom
::
getConferenceAddress
()
const
{
return
LocalConference
::
getConferenceAddress
();
}
...
...
@@ -101,7 +101,7 @@ void ServerGroupChatRoom::removeParticipant (const shared_ptr<const Participant>
void
ServerGroupChatRoom
::
removeParticipants
(
const
list
<
shared_ptr
<
Participant
>>
&
)
{}
shared_ptr
<
Participant
>
ServerGroupChatRoom
::
findParticipant
(
const
Address
&
)
const
{
shared_ptr
<
Participant
>
ServerGroupChatRoom
::
findParticipant
(
const
Identity
Address
&
)
const
{
return
nullptr
;
}
...
...
src/chat/chat-room/server-group-chat-room.h
View file @
bb5b22b9
...
...
@@ -41,17 +41,17 @@ public:
CapabilitiesMask
getCapabilities
()
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
const
Identity
Address
&
getConferenceAddress
()
const
override
;
bool
canHandleParticipants
()
const
override
;
void
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipant
(
const
Identity
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Identity
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
removeParticipant
(
const
std
::
shared_ptr
<
const
Participant
>
&
participant
)
override
;
void
removeParticipants
(
const
std
::
list
<
std
::
shared_ptr
<
Participant
>>
&
participants
)
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Identity
Address
&
addr
)
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
...
...
src/conference/conference-interface.h
View file @
bb5b22b9
...
...
@@ -29,7 +29,7 @@
LINPHONE_BEGIN_NAMESPACE
class
Address
;
class
Identity
Address
;
class
CallSessionParams
;
class
Participant
;
...
...
@@ -37,11 +37,11 @@ class LINPHONE_PUBLIC ConferenceInterface {
public:
virtual
~
ConferenceInterface
()
=
default
;
virtual
void
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
=
0
;
virtual
void
addParticipants
(
const
std
::
list
<
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
=
0
;
virtual
void
addParticipant
(
const
Identity
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
=
0
;
virtual
void
addParticipants
(
const
std
::
list
<
Identity
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
=
0
;
virtual
bool
canHandleParticipants
()
const
=
0
;
virtual
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
=
0
;
virtual
const
Address
&
getConferenceAddress
()
const
=
0
;
virtual
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Identity
Address
&
addr
)
const
=
0
;
virtual
const
Identity
Address
&
getConferenceAddress
()
const
=
0
;
virtual
std
::
shared_ptr
<
Participant
>
getMe
()
const
=
0
;
virtual
int
getNbParticipants
()
const
=
0
;
virtual
std
::
list
<
std
::
shared_ptr
<
Participant
>>
getParticipants
()
const
=
0
;
...
...
src/conference/conference-listener.h
View file @
bb5b22b9
...
...
@@ -31,13 +31,13 @@
LINPHONE_BEGIN_NAMESPACE
class
Address
;
class
Identity
Address
;
class
ConferenceListener
{
public:
virtual
void
onConferenceCreated
(
const
Address
&
addr
)
=
0
;
virtual
void
onConferenceTerminated
(
const
Address
&
addr
)
=
0
;
virtual
void
onFirstNotifyReceived
(
const
Address
&
addr
)
=
0
;
virtual
void
onConferenceCreated
(
const
Identity
Address
&
addr
)
=
0
;
virtual
void
onConferenceTerminated
(
const
Identity
Address
&
addr
)
=
0
;
virtual
void
onFirstNotifyReceived
(
const
Identity
Address
&
addr
)
=
0
;
virtual
void
onParticipantAdded
(
const
std
::
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
=
0
;
virtual
void
onParticipantRemoved
(
const
std
::
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
=
0
;
virtual
void
onParticipantSetAdmin
(
const
std
::
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
=
0
;
...
...
src/conference/conference-p.h
View file @
bb5b22b9
...
...
@@ -20,7 +20,7 @@
#ifndef _CONFERENCE_P_H_
#define _CONFERENCE_P_H_
#include "address/address.h"
#include "address/
identity-
address.h"
#include "conference.h"
// =============================================================================
...
...
@@ -32,7 +32,7 @@ class Participant;
class
ConferencePrivate
{
public:
Address
conferenceAddress
;
Identity
Address
conferenceAddress
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
participants
;
protected:
...
...
src/conference/conference.cpp
View file @
bb5b22b9
...
...
@@ -32,7 +32,7 @@ LINPHONE_BEGIN_NAMESPACE
Conference
::
Conference
(
ConferencePrivate
&
p
,
const
shared_ptr
<
Core
>
&
core
,
const
Address
&
myAddress
,
const
Identity
Address
&
myAddress
,
CallListener
*
listener
)
:
CoreAccessor
(
core
),
mPrivate
(
&
p
)
{
L_D
();
...
...
@@ -54,12 +54,12 @@ shared_ptr<Participant> Conference::getActiveParticipant () const {
// -----------------------------------------------------------------------------
void
Conference
::
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
void
Conference
::
addParticipant
(
const
Identity
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
lError
()
<<
"Conference class does not handle addParticipant() generically"
;
}
void
Conference
::
addParticipants
(
const
list
<
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
list
<
Address
>
sortedAddresses
(
addresses
);
void
Conference
::
addParticipants
(
const
list
<
Identity
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
list
<
Identity
Address
>
sortedAddresses
(
addresses
);
sortedAddresses
.
sort
();
sortedAddresses
.
unique
();
for
(
const
auto
&
addr
:
sortedAddresses
)
{
...
...
@@ -73,7 +73,7 @@ bool Conference::canHandleParticipants () const {
return
true
;
}
const
Address
&
Conference
::
getConferenceAddress
()
const
{
const
Identity
Address
&
Conference
::
getConferenceAddress
()
const
{
L_D
();
return
d
->
conferenceAddress
;
}
...
...
@@ -208,12 +208,13 @@ void Conference::onResetFirstVideoFrameDecoded (const shared_ptr<const CallSessi
// -----------------------------------------------------------------------------
shared_ptr
<
Participant
>
Conference
::
findParticipant
(
const
Address
&
addr
)
const
{
shared_ptr
<
Participant
>
Conference
::
findParticipant
(
const
Identity
Address
&
addr
)
const
{
L_D
();
IdentityAddress
simpleAddr
(
addr
);
IdentityAddress
searchedAddr
(
addr
);
searchedAddr
.
setGruu
(
""
);
for
(
const
auto
&
participant
:
d
->
participants
)
{
if
(
participant
->
getAddress
()
==
s
imple
Addr
)
if
(
participant
->
getAddress
()
==
s
earched
Addr
)
return
participant
;
}
...
...
@@ -231,7 +232,7 @@ shared_ptr<Participant> Conference::findParticipant (const shared_ptr<const Call
return
nullptr
;
}
bool
Conference
::
isMe
(
const
Address
&
addr
)
const
{
bool
Conference
::
isMe
(
const
Identity
Address
&
addr
)
const
{
L_D
();
IdentityAddress
simpleAddr
(
addr
);
return
d
->
me
->
getAddress
()
==
simpleAddr
;
...
...
src/conference/conference.h
View file @
bb5b22b9
...
...
@@ -48,11 +48,11 @@ public:
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
const
;
/* ConferenceInterface */
void
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipant
(
const
Identity
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
void
addParticipants
(
const
std
::
list
<
Identity
Address
>
&
addresses
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
override
;
bool
canHandleParticipants
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Address
&
addr
)
const
override
;
const
Address
&
getConferenceAddress
()
const
override
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
Identity
Address
&
addr
)
const
override
;
const
Identity
Address
&
getConferenceAddress
()
const
override
;
std
::
shared_ptr
<
Participant
>
getMe
()
const
override
;
int
getNbParticipants
()
const
override
;
std
::
list
<
std
::
shared_ptr
<
Participant
>>
getParticipants
()
const
override
;
...
...
@@ -85,11 +85,11 @@ protected:
explicit
Conference
(
ConferencePrivate
&
p
,
const
std
::
shared_ptr
<
Core
>
&
core
,
const
Address
&
myAddress
,
const
Identity
Address
&
myAddress
,
CallListener
*
listener
=
nullptr
);
bool
isMe
(
const
Address
&
addr
)
const
;
bool
isMe
(
const
Identity
Address
&
addr
)
const
;
ConferencePrivate
*
mPrivate
=
nullptr
;
...
...
src/conference/handlers/local-conference-event-handler.cpp
View file @
bb5b22b9
...
...
@@ -102,7 +102,7 @@ string LocalConferenceEventHandlerPrivate::createNotify (ConferenceType confInfo
}
string
LocalConferenceEventHandlerPrivate
::
createNotifyFullState
(
int
notifyId
)
{
string
entity
=
conf
->
getConferenceAddress
().
asString
UriOnly
();
string
entity
=
conf
->
getConferenceAddress
().
asString
();
string
subject
=
conf
->
getSubject
();
ConferenceType
confInfo
=
ConferenceType
(
entity
);
UsersType
users
;
...
...
@@ -122,7 +122,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyFullState (int notifyId)
user
.
setState
(
StateType
::
full
);
for
(
const
auto
&
device
:
participant
->
getPrivate
()
->
getDevices
())
{
const
string
&
gruu
=
device
->
get
Gruu
().
asString
();
const
string
&
gruu
=
device
->
get
Address
().
asString
();
EndpointType
endpoint
=
EndpointType
();
endpoint
.
setEntity
(
gruu
);
endpoint
.
setState
(
StateType
::
full
);
...
...
@@ -224,7 +224,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId)
}
string
LocalConferenceEventHandlerPrivate
::
createNotifyParticipantAdded
(
const
Address
&
addr
,
int
notifyId
)
{
string
entity
=
conf
->
getConferenceAddress
().
asString
UriOnly
();
string
entity
=
conf
->
getConferenceAddress
().
asString
();
ConferenceType
confInfo
=
ConferenceType
(
entity
);
UsersType
users
;
confInfo
.
setUsers
(
users
);
...
...
@@ -235,7 +235,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdded (const A
shared_ptr
<
Participant
>
p
=
conf
->
findParticipant
(
addr
);
if
(
p
)
{
for
(
const
auto
&
device
:
p
->
getPrivate
()
->
getDevices
())
{
const
string
&
gruu
=
device
->
get
Gruu
().
asString
();
const
string
&
gruu
=
device
->
get
Address
().
asString
();
EndpointType
endpoint
=
EndpointType
();
endpoint
.
setEntity
(
gruu
);
endpoint
.
setState
(
StateType
::
full
);
...
...
@@ -254,7 +254,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdded (const A
}
string
LocalConferenceEventHandlerPrivate
::
createNotifyParticipantRemoved
(
const
Address
&
addr
,
int
notifyId
)
{
string
entity
=
conf
->
getConferenceAddress
().
asString
UriOnly
();
string
entity
=
conf
->
getConferenceAddress
().
asString
();
ConferenceType
confInfo
=
ConferenceType
(
entity
);
UsersType
users
;
confInfo
.
setUsers
(
users
);
...
...
@@ -268,7 +268,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantRemoved (const
}
string
LocalConferenceEventHandlerPrivate
::
createNotifyParticipantAdmined
(
const
Address
&
addr
,
bool
isAdmin
,
int
notifyId
)
{
string
entity
=
conf
->
getConferenceAddress
().
asString
UriOnly
();
string
entity
=
conf
->
getConferenceAddress
().
asString
();
ConferenceType
confInfo
=
ConferenceType
(
entity
);
UsersType
users
;
confInfo
.
setUsers
(
users
);
...
...
@@ -289,7 +289,7 @@ string LocalConferenceEventHandlerPrivate::createNotifySubjectChanged (int notif
}
string
LocalConferenceEventHandlerPrivate
::
createNotifySubjectChanged
(
const
string
&
subject
,
int
notifyId
)
{
string
entity
=
conf
->
getConferenceAddress
().
asString
UriOnly
();
string
entity
=
conf
->
getConferenceAddress
().
asString
();
ConferenceType
confInfo
=
ConferenceType
(
entity
);
ConferenceDescriptionType
confDescr
=
ConferenceDescriptionType
();
confDescr
.
setSubject
(
subject
);
...
...
@@ -299,7 +299,7 @@ string LocalConferenceEventHandlerPrivate::createNotifySubjectChanged (const str
}
string
LocalConferenceEventHandlerPrivate
::
createNotifyParticipantDeviceAdded
(
const
Address
&
addr
,
const
Address
&
gruu
,
int
notifyId
)
{
string
entity
=
conf
->
getConferenceAddress
().
asString
UriOnly
();
string
entity
=
conf
->
getConferenceAddress
().
asString
();
ConferenceType
confInfo
=
ConferenceType
(
entity
);
UsersType
users
;
confInfo
.
setUsers
(
users
);
...
...
@@ -323,7 +323,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantDeviceAdded (c
}
string
LocalConferenceEventHandlerPrivate
::
createNotifyParticipantDeviceRemoved
(
const
Address
&
addr
,
const
Address
&
gruu
,
int
notifyId
)
{
string
entity
=
conf
->
getConferenceAddress
().
asString
UriOnly
();
string
entity
=
conf
->
getConferenceAddress
().
asString
();
ConferenceType
confInfo
=
ConferenceType
(
entity
);