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
22
Merge Requests
22
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
fda31ecc
Commit
fda31ecc
authored
Oct 04, 2017
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a call session automatically when needed in the client group chat room.
parent
6d11f76c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
18 deletions
+44
-18
address.h
src/address/address.h
+1
-0
client-group-chat-room-p.h
src/chat/client-group-chat-room-p.h
+4
-0
client-group-chat-room.cpp
src/chat/client-group-chat-room.cpp
+37
-18
participant.h
src/conference/participant.h
+1
-0
call-session.h
src/conference/session/call-session.h
+1
-0
No files found.
src/address/address.h
View file @
fda31ecc
...
...
@@ -32,6 +32,7 @@ class LINPHONE_PUBLIC Address : public ClonableObject {
// TODO: Remove me later.
friend
class
CallSession
;
friend
class
ClientGroupChatRoom
;
friend
class
ClientGroupChatRoomPrivate
;
public
:
Address
(
const
std
::
string
&
address
=
""
);
...
...
src/chat/client-group-chat-room-p.h
View file @
fda31ecc
...
...
@@ -29,11 +29,15 @@
LINPHONE_BEGIN_NAMESPACE
class
CallSession
;
class
ClientGroupChatRoomPrivate
:
public
ChatRoomPrivate
{
public
:
ClientGroupChatRoomPrivate
(
LinphoneCore
*
core
);
virtual
~
ClientGroupChatRoomPrivate
()
=
default
;
std
::
shared_ptr
<
CallSession
>
createSession
();
private
:
L_DECLARE_PUBLIC
(
ClientGroupChatRoom
);
};
...
...
src/chat/client-group-chat-room.cpp
View file @
fda31ecc
...
...
@@ -34,6 +34,21 @@ LINPHONE_BEGIN_NAMESPACE
ClientGroupChatRoomPrivate
::
ClientGroupChatRoomPrivate
(
LinphoneCore
*
core
)
:
ChatRoomPrivate
(
core
)
{}
// -----------------------------------------------------------------------------
shared_ptr
<
CallSession
>
ClientGroupChatRoomPrivate
::
createSession
()
{
L_Q
();
CallSessionParams
csp
;
csp
.
addCustomHeader
(
"Require"
,
"recipient-list-invite"
);
shared_ptr
<
CallSession
>
session
=
q
->
focus
->
getPrivate
()
->
createSession
(
*
q
,
&
csp
,
false
,
q
);
session
->
configure
(
LinphoneCallOutgoing
,
nullptr
,
nullptr
,
q
->
me
->
getAddress
(),
q
->
focus
->
getAddress
());
session
->
initiateOutgoing
();
Address
addr
=
q
->
me
->
getAddress
();
addr
.
setParam
(
"text"
);
session
->
getPrivate
()
->
getOp
()
->
set_contact_address
(
addr
.
getPrivate
()
->
getInternalAddress
());
return
session
;
}
// =============================================================================
ClientGroupChatRoom
::
ClientGroupChatRoom
(
LinphoneCore
*
core
,
const
Address
&
me
,
const
string
&
subject
)
...
...
@@ -55,28 +70,27 @@ void ClientGroupChatRoom::addParticipants (const list<Address> &addresses, const
L_D
();
if
(
addresses
.
empty
())
return
;
if
((
d
->
state
!=
ChatRoom
::
State
::
Instantiated
)
&&
(
d
->
state
!=
ChatRoom
::
State
::
Created
))
{
lError
()
<<
"Cannot add participants to the ClientGroupChatRoom in a state other than Instantiated or Created"
;
return
;
}
list
<
Address
>
sortedAddresses
(
addresses
);
sortedAddresses
.
sort
();
sortedAddresses
.
unique
();
if
(
d
->
state
==
ChatRoom
::
State
::
Instantiated
)
{
Content
content
;
content
.
setBody
(
getResourceLists
(
sortedAddresses
));
content
.
setContentType
(
"application/resource-lists+xml"
);
content
.
setContentDisposition
(
"recipient-list"
);
CallSessionParams
csp
;
if
(
params
)
csp
=
*
params
;
csp
.
addCustomHeader
(
"Require"
,
"recipient-list-invite"
);
shared_ptr
<
CallSession
>
session
=
focus
->
getPrivate
()
->
createSession
(
*
this
,
&
csp
,
false
,
this
);
session
->
configure
(
LinphoneCallOutgoing
,
nullptr
,
nullptr
,
me
->
getAddress
(),
focus
->
getAddress
());
session
->
initiateOutgoing
();
Address
addr
=
me
->
getAddress
();
addr
.
setParam
(
"text"
);
session
->
getPrivate
()
->
getOp
()
->
set_contact_address
(
addr
.
getPrivate
()
->
getInternalAddress
());
Content
content
;
content
.
setBody
(
getResourceLists
(
sortedAddresses
));
content
.
setContentType
(
"application/resource-lists+xml"
);
content
.
setContentDisposition
(
"recipient-list"
);
shared_ptr
<
CallSession
>
session
=
focus
->
getPrivate
()
->
getSession
();
if
(
session
)
session
->
update
(
nullptr
,
subject
,
&
content
);
else
{
session
=
d
->
createSession
();
session
->
startInvite
(
nullptr
,
subject
,
&
content
);
d
->
setState
(
ChatRoom
::
State
::
CreationPending
);
if
(
d
->
state
==
ChatRoom
::
State
::
Instantiated
)
{
d
->
setState
(
ChatRoom
::
State
::
CreationPending
);
}
}
// TODO
}
bool
ClientGroupChatRoom
::
canHandleParticipants
()
const
{
...
...
@@ -118,7 +132,12 @@ void ClientGroupChatRoom::setSubject (const string &subject) {
return
;
}
shared_ptr
<
CallSession
>
session
=
focus
->
getPrivate
()
->
getSession
();
session
->
update
(
nullptr
,
subject
);
if
(
session
)
session
->
update
(
nullptr
,
subject
);
else
{
session
=
d
->
createSession
();
session
->
startInvite
(
nullptr
,
subject
,
nullptr
);
}
}
// -----------------------------------------------------------------------------
...
...
src/conference/participant.h
View file @
fda31ecc
...
...
@@ -35,6 +35,7 @@ class Participant : public Object {
friend
class
Call
;
friend
class
CallPrivate
;
friend
class
ClientGroupChatRoom
;
friend
class
ClientGroupChatRoomPrivate
;
friend
class
LocalConference
;
friend
class
MediaSessionPrivate
;
friend
class
RemoteConference
;
...
...
src/conference/session/call-session.h
View file @
fda31ecc
...
...
@@ -37,6 +37,7 @@ class Content;
class
LINPHONE_PUBLIC
CallSession
:
public
Object
{
friend
class
CallPrivate
;
friend
class
ClientGroupChatRoom
;
friend
class
ClientGroupChatRoomPrivate
;
public
:
L_OVERRIDE_SHARED_FROM_THIS
(
CallSession
);
...
...
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