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
454e9834
Commit
454e9834
authored
Jan 14, 2016
by
François Grisez
Browse files
Merge branch 'dev_conference_rfc4579'
parents
48b5d064
9eced024
Changes
13
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
454e9834
...
...
@@ -216,6 +216,7 @@ endif()
set
(
STRICT_OPTIONS_CPP
)
set
(
STRICT_OPTIONS_C
)
set
(
STRICT_OPTIONS_CXX
"-std=c++11"
)
set
(
STRICT_OPTIONS_OBJC
)
if
(
NOT MSVC
)
list
(
APPEND STRICT_OPTIONS_CPP
"-Wall"
"-Wuninitialized"
"-Wno-error=deprecated-declarations"
)
...
...
coreapi/conference.cc
View file @
454e9834
...
...
@@ -24,7 +24,7 @@
*/
#include "private.h"
#include "conference.h"
#include "conference
_private
.h"
#include <mediastreamer2/msvolume.h>
#include <typeinfo>
#include <list>
...
...
@@ -49,9 +49,21 @@ private:
class
Conference
{
public:
Conference
(
LinphoneCore
*
core
);
class
Params
{
public:
Params
(
const
LinphoneCore
*
core
=
NULL
);
void
enableVideo
(
bool
enable
)
{
m_enableVideo
=
enable
;}
bool
videoRequested
()
const
{
return
m_enableVideo
;}
private:
bool
m_enableVideo
;
};
Conference
(
LinphoneCore
*
core
,
const
Params
*
params
=
NULL
);
virtual
~
Conference
()
{};
const
Params
&
getCurrentParams
()
const
{
return
m_currentParams
;}
virtual
int
addParticipant
(
LinphoneCall
*
call
)
=
0
;
virtual
int
removeParticipant
(
LinphoneCall
*
call
)
=
0
;
virtual
int
removeParticipant
(
const
LinphoneAddress
*
uri
)
=
0
;
...
...
@@ -83,11 +95,12 @@ protected:
AudioStream
*
m_localParticipantStream
;
bool
m_isMuted
;
std
::
list
<
Participant
>
m_participants
;
Params
m_currentParams
;
};
class
LocalConference
:
public
Conference
{
public:
LocalConference
(
LinphoneCore
*
core
);
LocalConference
(
LinphoneCore
*
core
,
const
Params
*
params
=
NULL
);
virtual
~
LocalConference
();
virtual
int
addParticipant
(
LinphoneCall
*
call
);
...
...
@@ -103,9 +116,9 @@ public:
virtual
int
startRecording
(
const
char
*
path
);
virtual
int
stopRecording
();
void
onCallStreamStarting
(
LinphoneCall
*
call
,
bool
isPausedByRemote
);
void
onCallStreamStopping
(
LinphoneCall
*
call
);
void
onCallTerminating
(
LinphoneCall
*
call
);
virtual
void
onCallStreamStarting
(
LinphoneCall
*
call
,
bool
isPausedByRemote
);
virtual
void
onCallStreamStopping
(
LinphoneCall
*
call
);
virtual
void
onCallTerminating
(
LinphoneCall
*
call
);
private:
void
addLocalEndpoint
();
...
...
@@ -124,7 +137,7 @@ private:
class
RemoteConference
:
public
Conference
{
public:
RemoteConference
(
LinphoneCore
*
core
);
RemoteConference
(
LinphoneCore
*
core
,
const
Params
*
params
=
NULL
);
virtual
~
RemoteConference
();
virtual
int
addParticipant
(
LinphoneCall
*
call
);
...
...
@@ -190,10 +203,20 @@ bool Participant::operator==(const Participant &src) const {
Conference
::
Conference
(
LinphoneCore
*
core
)
:
Conference
::
Params
::
Params
(
const
LinphoneCore
*
core
)
:
m_enableVideo
(
false
)
{
if
(
core
)
{
const
LinphoneVideoPolicy
*
policy
=
linphone_core_get_video_policy
(
core
);
if
(
policy
->
automatically_initiate
)
m_enableVideo
=
true
;
}
}
Conference
::
Conference
(
LinphoneCore
*
core
,
const
Conference
::
Params
*
params
)
:
m_core
(
core
),
m_localParticipantStream
(
NULL
),
m_isMuted
(
false
)
{
if
(
params
)
m_currentParams
=
*
params
;
}
int
Conference
::
addParticipant
(
LinphoneCall
*
call
)
{
...
...
@@ -255,15 +278,16 @@ Participant *Conference::find_participant(const LinphoneAddress *uri) {
LocalConference
::
LocalConference
(
LinphoneCore
*
core
)
:
Conference
(
core
),
LocalConference
::
LocalConference
(
LinphoneCore
*
core
,
const
Conference
::
Params
*
params
)
:
Conference
(
core
,
params
),
m_conf
(
NULL
),
m_localEndpoint
(
NULL
),
m_recordEndpoint
(
NULL
),
m_localDummyProfile
(
NULL
),
m_terminated
(
FALSE
)
{
MSAudioConferenceParams
params
;
params
.
samplerate
=
lp_config_get_int
(
m_core
->
config
,
"sound"
,
"conference_rate"
,
16000
);
m_conf
=
ms_audio_conference_new
(
&
params
);
MSAudioConferenceParams
ms_conf_
params
;
ms_conf_
params
.
samplerate
=
lp_config_get_int
(
m_core
->
config
,
"sound"
,
"conference_rate"
,
16000
);
m_conf
=
ms_audio_conference_new
(
&
ms_conf_
params
);
}
LocalConference
::~
LocalConference
()
{
...
...
@@ -548,8 +572,8 @@ void LocalConference::onCallTerminating(LinphoneCall *call) {
RemoteConference
::
RemoteConference
(
LinphoneCore
*
core
)
:
Conference
(
core
),
RemoteConference
::
RemoteConference
(
LinphoneCore
*
core
,
const
Conference
::
Params
*
params
)
:
Conference
(
core
,
params
),
m_focusAddr
(
NULL
),
m_focusContact
(
NULL
),
m_focusCall
(
NULL
),
...
...
@@ -573,6 +597,7 @@ RemoteConference::~RemoteConference() {
int
RemoteConference
::
addParticipant
(
LinphoneCall
*
call
)
{
LinphoneAddress
*
addr
;
LinphoneCallParams
*
params
;
switch
(
m_state
)
{
case
NotConnectedToFocus
:
...
...
@@ -580,12 +605,15 @@ int RemoteConference::addParticipant(LinphoneCall *call) {
ms_message
(
"Calling the conference focus (%s)"
,
m_focusAddr
);
addr
=
linphone_address_new
(
m_focusAddr
);
if
(
addr
)
{
m_focusCall
=
linphone_call_ref
(
linphone_core_invite_address
(
m_core
,
addr
));
params
=
linphone_core_create_call_params
(
m_core
,
NULL
);
linphone_call_params_enable_video
(
params
,
m_currentParams
.
videoRequested
());
m_focusCall
=
linphone_call_ref
(
linphone_core_invite_address_with_params
(
m_core
,
addr
,
params
));
m_localParticipantStream
=
m_focusCall
->
audiostream
;
m_pendingCalls
=
ms_list_append
(
m_pendingCalls
,
linphone_call_ref
(
call
));
m_state
=
ConnectingToFocus
;
linphone_address_unref
(
addr
);
call
->
conf_ref
=
(
LinphoneConference
*
)
this
;
linphone_call_params_unref
(
params
);
return
0
;
}
else
return
-
1
;
...
...
@@ -784,14 +812,44 @@ void RemoteConference::transferStateChanged(LinphoneCore *lc, LinphoneCall *tran
LinphoneConferenceParams
*
linphone_conference_params_new
(
const
LinphoneCore
*
core
)
{
return
(
LinphoneConferenceParams
*
)
new
Conference
::
Params
(
core
);
}
void
linphone_conference_params_free
(
LinphoneConferenceParams
*
params
)
{
delete
(
Conference
::
Params
*
)
params
;
}
LinphoneConferenceParams
*
linphone_conference_params_clone
(
const
LinphoneConferenceParams
*
params
)
{
return
(
LinphoneConferenceParams
*
)
new
Conference
::
Params
(
*
(
Conference
::
Params
*
)
params
);
}
void
linphone_conference_params_enable_video
(
LinphoneConferenceParams
*
params
,
bool_t
enable
)
{
((
Conference
::
Params
*
)
params
)
->
enableVideo
(
enable
);
}
bool_t
linphone_conference_params_video_requested
(
const
LinphoneConferenceParams
*
params
)
{
return
((
Conference
::
Params
*
)
params
)
->
videoRequested
();
}
LinphoneConference
*
linphone_local_conference_new
(
LinphoneCore
*
core
)
{
return
(
LinphoneConference
*
)
new
LocalConference
(
core
);
}
LinphoneConference
*
linphone_local_conference_new_with_params
(
LinphoneCore
*
core
,
const
LinphoneConferenceParams
*
params
)
{
return
(
LinphoneConference
*
)
new
LocalConference
(
core
,
(
Conference
::
Params
*
)
params
);
}
LinphoneConference
*
linphone_remote_conference_new
(
LinphoneCore
*
core
)
{
return
(
LinphoneConference
*
)
new
RemoteConference
(
core
);
}
LinphoneConference
*
linphone_remote_conference_new_with_params
(
LinphoneCore
*
core
,
const
LinphoneConferenceParams
*
params
)
{
return
(
LinphoneConference
*
)
new
RemoteConference
(
core
,
(
Conference
::
Params
*
)
params
);
}
void
linphone_conference_free
(
LinphoneConference
*
obj
)
{
delete
(
Conference
*
)
obj
;
}
...
...
coreapi/conference.h
View file @
454e9834
/*******************************************************************************
* conference.
cc
* conference.
h
*
* Thu Nov 26, 2015
* Copyright 2015 Belledonne Communications
...
...
@@ -25,49 +25,67 @@
#ifndef CONFERENCE_H
#define CONFERENCE_H
#include "linphonecore.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#include "linphonecore.h"
//typedef struct _LinphoneConference LinphoneConference;
/**
* @addtogroup call_control
* @{
*/
typedef
enum
{
LinphoneConferenceClassLocal
,
LinphoneConferenceClassRemote
}
LinphoneConferenceClass
;
/**
* Create a #LinphoneConferenceParams with default parameters set.
* @param core #LinphoneCore to use to find out the default parameters. Can be NULL.
* @return A freshly allocated #LinphoneConferenceParams
*/
LINPHONE_PUBLIC
LinphoneConferenceParams
*
linphone_conference_params_new
(
const
LinphoneCore
*
core
);
/**
* Free a #LinphoneConferenceParams
* @param params #LinphoneConferenceParams to free
*/
LINPHONE_PUBLIC
void
linphone_conference_params_free
(
LinphoneConferenceParams
*
params
);
/**
* Clone a #LinphoneConferenceParams
* @param params The #LinphoneConfrenceParams to clone
* @return An allocated #LinphoneConferenceParams with the same parameters than params
*/
LINPHONE_PUBLIC
LinphoneConferenceParams
*
linphone_conference_params_clone
(
const
LinphoneConferenceParams
*
params
);
/**
* Enable video when starting a conference
* @param params A #LinphoneConnferenceParams
* @param enable If true, video will be enabled during conference
*/
LINPHONE_PUBLIC
void
linphone_conference_params_enable_video
(
LinphoneConferenceParams
*
params
,
bool_t
enable
);
/**
* Check whether video will be enable at conference starting
* @return if true, the video will be enable at conference starting
*/
LINPHONE_PUBLIC
bool_t
linphone_conference_params_video_requested
(
const
LinphoneConferenceParams
*
params
);
LinphoneConference
*
linphone_local_conference_new
(
LinphoneCore
*
core
);
LinphoneConference
*
linphone_remote_conference_new
(
LinphoneCore
*
core
);
void
linphone_conference_free
(
LinphoneConference
*
obj
);
int
linphone_conference_add_participant
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
int
linphone_conference_remove_participant_with_call
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
/**
* Remove a participant from a conference
* @param obj A #LinphoneConference
* @param uri SIP URI of the participant to remove
* @return 0 if succeeded, -1 if failed
*/
LINPHONE_PUBLIC
int
linphone_conference_remove_participant
(
LinphoneConference
*
obj
,
const
LinphoneAddress
*
uri
);
int
linphone_conference_terminate
(
LinphoneConference
*
obj
);
int
linphone_conference_enter
(
LinphoneConference
*
obj
);
int
linphone_conference_leave
(
LinphoneConference
*
obj
);
LINPHONE_PUBLIC
bool_t
linphone_conference_is_in
(
const
LinphoneConference
*
obj
);
AudioStream
*
linphone_conference_get_audio_stream
(
const
LinphoneConference
*
obj
);
int
linphone_conference_mute_microphone
(
LinphoneConference
*
obj
,
bool_t
val
);
bool_t
linphone_conference_microphone_is_muted
(
const
LinphoneConference
*
obj
);
float
linphone_conference_get_input_volume
(
const
LinphoneConference
*
obj
);
LINPHONE_PUBLIC
int
linphone_conference_get_size
(
const
LinphoneConference
*
obj
);
/**
* Get URIs of all participants of one conference
* The returned MSList contains URIs of all participant. That list must be
* freed after use and each URI must be unref with linphone_address_unref()
* @param obj A #LinphoneConference
* @return \mslist{LinphoneAddress}
*/
LINPHONE_PUBLIC
MSList
*
linphone_conference_get_participants
(
const
LinphoneConference
*
obj
);
int
linphone_conference_start_recording
(
LinphoneConference
*
obj
,
const
char
*
path
);
int
linphone_conference_stop_recording
(
LinphoneConference
*
obj
);
void
linphone_conference_on_call_stream_starting
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
,
bool_t
is_paused_by_remote
);
void
linphone_conference_on_call_stream_stopping
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
void
linphone_conference_on_call_terminating
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
bool_t
linphone_conference_check_class
(
LinphoneConference
*
obj
,
LinphoneConferenceClass
_class
);
/**
* @}
*/
#ifdef __cplusplus
}
...
...
coreapi/conference_private.h
0 → 100644
View file @
454e9834
/*******************************************************************************
* conference_private.h
*
* Tue Jan 12, 2015
* Copyright 2015 Belledonne Communications
* Author: Linphone's team
* Email info@belledonne-communications.com
******************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef CONFERENCE_PRIVATE_H
#define CONFERENCE_PRIVATE_H
#include "linphonecore.h"
#include "conference.h"
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
enum
{
LinphoneConferenceClassLocal
,
LinphoneConferenceClassRemote
}
LinphoneConferenceClass
;
LinphoneConference
*
linphone_local_conference_new
(
LinphoneCore
*
core
);
LinphoneConference
*
linphone_local_conference_new_with_params
(
LinphoneCore
*
core
,
const
LinphoneConferenceParams
*
params
);
LinphoneConference
*
linphone_remote_conference_new
(
LinphoneCore
*
core
);
LinphoneConference
*
linphone_remote_conference_new_with_params
(
LinphoneCore
*
core
,
const
LinphoneConferenceParams
*
params
);
void
linphone_conference_free
(
LinphoneConference
*
obj
);
int
linphone_conference_add_participant
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
int
linphone_conference_remove_participant_with_call
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
int
linphone_conference_terminate
(
LinphoneConference
*
obj
);
int
linphone_conference_get_size
(
const
LinphoneConference
*
obj
);
int
linphone_conference_enter
(
LinphoneConference
*
obj
);
int
linphone_conference_leave
(
LinphoneConference
*
obj
);
bool_t
linphone_conference_is_in
(
const
LinphoneConference
*
obj
);
AudioStream
*
linphone_conference_get_audio_stream
(
const
LinphoneConference
*
obj
);
int
linphone_conference_mute_microphone
(
LinphoneConference
*
obj
,
bool_t
val
);
bool_t
linphone_conference_microphone_is_muted
(
const
LinphoneConference
*
obj
);
float
linphone_conference_get_input_volume
(
const
LinphoneConference
*
obj
);
int
linphone_conference_start_recording
(
LinphoneConference
*
obj
,
const
char
*
path
);
int
linphone_conference_stop_recording
(
LinphoneConference
*
obj
);
void
linphone_conference_on_call_stream_starting
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
,
bool_t
is_paused_by_remote
);
void
linphone_conference_on_call_stream_stopping
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
void
linphone_conference_on_call_terminating
(
LinphoneConference
*
obj
,
LinphoneCall
*
call
);
LINPHONE_PUBLIC
bool_t
linphone_conference_check_class
(
LinphoneConference
*
obj
,
LinphoneConferenceClass
_class
);
#ifdef __cplusplus
}
#endif
#endif //CONFERENCE_PRIVATE_H
coreapi/linphonecall.c
View file @
454e9834
...
...
@@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "sipsetup.h"
#include "lpconfig.h"
#include "private.h"
#include "conference_private.h"
#include <ortp/event.h>
#include <ortp/b64.h>
#include <math.h>
...
...
coreapi/linphonecore.c
View file @
454e9834
...
...
@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "private.h"
#include "quality_reporting.h"
#include "lime.h"
#include "conference_private.h"
#include <math.h>
#include <sys/types.h>
...
...
@@ -5350,7 +5351,7 @@ void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPolicy
* See linphone_core_set_video_policy() for more details.
* @ingroup media_parameters
**/
const
LinphoneVideoPolicy
*
linphone_core_get_video_policy
(
LinphoneCore
*
lc
){
const
LinphoneVideoPolicy
*
linphone_core_get_video_policy
(
const
LinphoneCore
*
lc
){
return
&
lc
->
video_policy
;
}
...
...
@@ -7433,20 +7434,30 @@ LinphoneRingtonePlayer *linphone_core_get_ringtoneplayer(LinphoneCore *lc) {
return
lc
->
ringtoneplayer
;
}
in
t
linphone_core_
add_to
_conference
(
LinphoneCore
*
lc
,
LinphoneC
all
*
call
)
{
L
in
phoneConference
*
linphone_core_
create
_conference
_with_params
(
LinphoneCore
*
lc
,
const
LinphoneC
onferenceParams
*
params
)
{
const
char
*
conf_method_name
;
if
(
lc
->
conf_ctx
==
NULL
)
{
conf_method_name
=
lp_config_get_string
(
lc
->
config
,
"misc"
,
"conference_type"
,
"local"
);
if
(
strcasecmp
(
conf_method_name
,
"local"
)
==
0
)
{
lc
->
conf_ctx
=
linphone_local_conference_new
(
lc
);
lc
->
conf_ctx
=
linphone_local_conference_new
_with_params
(
lc
,
params
);
}
else
if
(
strcasecmp
(
conf_method_name
,
"remote"
)
==
0
)
{
lc
->
conf_ctx
=
linphone_remote_conference_new
(
lc
);
lc
->
conf_ctx
=
linphone_remote_conference_new
_with_params
(
lc
,
params
);
}
else
{
ms_error
(
"'%s' is not a valid conference method"
,
conf_method_name
);
return
-
1
;
return
NULL
;
}
}
else
{
ms_error
(
"Could not create a conference: a conference instance already exists"
);
return
NULL
;
}
return
linphone_conference_add_participant
(
lc
->
conf_ctx
,
call
);
return
lc
->
conf_ctx
;
}
int
linphone_core_add_to_conference
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
)
{
LinphoneConference
*
conference
=
linphone_core_get_conference
(
lc
);
if
(
conference
==
NULL
)
conference
=
linphone_core_create_conference_with_params
(
lc
,
NULL
);
if
(
conference
)
return
linphone_conference_add_participant
(
lc
->
conf_ctx
,
call
);
else
return
-
1
;
}
int
linphone_core_add_all_to_conference
(
LinphoneCore
*
lc
)
{
...
...
coreapi/linphonecore.h
View file @
454e9834
...
...
@@ -66,6 +66,18 @@ struct _LinphoneInfoMessage;
*/
typedef
struct
_LinphoneCore
LinphoneCore
;
/**
* Internal object of LinphoneCore representing a conference
* @ingroup call_control
*/
typedef
struct
_LinphoneConference
LinphoneConference
;
/**
* Parameters for initialization of conferences
* @ingroup call_control
*/
typedef
struct
_LinphoneCorferenceParams
LinphoneConferenceParams
;
/**
* Disable a sip transport
...
...
@@ -140,12 +152,6 @@ enum _LinphoneStreamType {
**/
typedef
enum
_LinphoneStreamType
LinphoneStreamType
;
/**
* Internal object of LinphoneCore representing a conference
* @ingroup call_control
*/
typedef
struct
_LinphoneConference
LinphoneConference
;
/**
* Function returning a human readable value for LinphoneStreamType.
* @ingroup initializing
...
...
@@ -3443,7 +3449,7 @@ LINPHONE_PUBLIC bool_t linphone_core_video_capture_enabled(LinphoneCore *lc);
LINPHONE_PUBLIC
bool_t
linphone_core_video_display_enabled
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
void
linphone_core_set_video_policy
(
LinphoneCore
*
lc
,
const
LinphoneVideoPolicy
*
policy
);
LINPHONE_PUBLIC
const
LinphoneVideoPolicy
*
linphone_core_get_video_policy
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
const
LinphoneVideoPolicy
*
linphone_core_get_video_policy
(
const
LinphoneCore
*
lc
);
typedef
struct
MSVideoSizeDef
{
MSVideoSize
vsize
;
...
...
@@ -3828,6 +3834,14 @@ LINPHONE_PUBLIC LinphoneCall* linphone_core_find_call_from_uri(const LinphoneCor
* @{
*/
/**
* Create a conference
* @param lc The #LinphoneCore instance where the conference will be created inside.
* @param params Parameters of the conference. See #LinphoneConferenceParms.
* @return A pointer on the freshly created conference. That object will be automatically
* freed by the core after calling linphone_core_terminate_conference().
*/
LINPHONE_PUBLIC
LinphoneConference
*
linphone_core_create_conference_with_params
(
LinphoneCore
*
lc
,
const
LinphoneConferenceParams
*
params
);
/**
* Add a participant to the conference. If no conference is going on
* a new internal conference context is created and the participant is
...
...
@@ -3836,7 +3850,7 @@ LINPHONE_PUBLIC LinphoneCall* linphone_core_find_call_from_uri(const LinphoneCor
* @param call The current call with the participant to add
* @return 0 if succeeded. Negative number if failed
*/
LINPHONE_PUBLIC
int
linphone_core_add_to_conference
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
);
LINPHONE_PUBLIC
int
linphone_core_add_to_conference
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
);
/**
* Add all current calls into the conference. If no conference is running
* a new internal conference context is created and all current calls
...
...
@@ -3844,7 +3858,7 @@ LINPHONE_PUBLIC int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCa
* @param lc #LinphoneCore
* @return 0 if succeeded. Negative number if failed
*/
LINPHONE_PUBLIC
int
linphone_core_add_all_to_conference
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
int
linphone_core_add_all_to_conference
(
LinphoneCore
*
lc
);
/**
* Remove a call from the conference.
* @param lc the linphone core
...
...
@@ -3860,7 +3874,7 @@ LINPHONE_PUBLIC int linphone_core_add_all_to_conference(LinphoneCore *lc);
*
* @return 0 if successful, -1 otherwise.
**/
LINPHONE_PUBLIC
int
linphone_core_remove_from_conference
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
);
LINPHONE_PUBLIC
int
linphone_core_remove_from_conference
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
);
/**
* Indicates whether the local participant is part of a conference.
* @warning That function automatically fails in the case of conferences using a
...
...
@@ -3869,25 +3883,25 @@ LINPHONE_PUBLIC int linphone_core_add_all_to_conference(LinphoneCore *lc);
* @param lc the linphone core
* @return TRUE if the local participant is in a conference, FALSE otherwise.
*/
LINPHONE_PUBLIC
bool_t
linphone_core_is_in_conference
(
const
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
bool_t
linphone_core_is_in_conference
(
const
LinphoneCore
*
lc
);
/**
* Join the local participant to the running conference
* @param lc #LinphoneCore
* @return 0 if succeeded. Negative number if failed
*/
LINPHONE_PUBLIC
int
linphone_core_enter_conference
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
int
linphone_core_enter_conference
(
LinphoneCore
*
lc
);
/**
* Make the local participant leave the running conference
* @param lc #LinphoneCore
* @return 0 if succeeded. Negative number if failed
*/
LINPHONE_PUBLIC
int
linphone_core_leave_conference
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
int
linphone_core_leave_conference
(
LinphoneCore
*
lc
);
/**
* Get the set input volume of the local participant
* @param lc #LinphoneCore
* @return A value inside [0.0 ; 1.0]
*/
LINPHONE_PUBLIC
float
linphone_core_get_conference_local_input_volume
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
float
linphone_core_get_conference_local_input_volume
(
LinphoneCore
*
lc
);
/**
* Terminate the running conference. If it is a local conference, all calls
* inside it will become back separate calls and will be put in #LinphoneCallPaused state.
...
...
@@ -3896,14 +3910,14 @@ LINPHONE_PUBLIC float linphone_core_get_conference_local_input_volume(LinphoneCo
* @param lc #LinphoneCore
* @return 0 if succeeded. Negative number if failed
*/
LINPHONE_PUBLIC
int
linphone_core_terminate_conference
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
int
linphone_core_terminate_conference
(
LinphoneCore
*
lc
);
/**
* Get the number of participant in the running conference. The local
* participant is included in the count only if it is in the conference.
* @param lc #LinphoneCore
* @return The number of participant
*/
LINPHONE_PUBLIC
int
linphone_core_get_conference_size
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
int
linphone_core_get_conference_size
(
LinphoneCore
*
lc
);
/**
* Start recording the running conference
* @param lc #LinphoneCore
...
...
@@ -3923,21 +3937,7 @@ LINPHONE_PUBLIC int linphone_core_stop_conference_recording(LinphoneCore *lc);
* @return A pointer on #LinphoneConference or NULL if no conference are going on
*/
LINPHONE_PUBLIC
LinphoneConference
*
linphone_core_get_conference
(
LinphoneCore
*
lc
);
/**
* Get URIs of all participants of one conference
* The returned MSList contains URIs of all participant. That list must be
* freed after use and each URI must be unref with linphone_address_unref()
* @param obj A #LinphoneConference
* @return \mslist{LinphoneAddress}
*/
LINPHONE_PUBLIC
MSList
*
linphone_conference_get_participants
(
const
LinphoneConference
*
obj
);
/**
* Remove a participant from a conference
* @param obj A #LinphoneConference
* @param uri SIP URI of the participant to remove
* @return 0 if succeeded, -1 if failed
*/
LINPHONE_PUBLIC
int
linphone_conference_remove_participant
(
LinphoneConference
*
obj
,
const
LinphoneAddress
*
uri
);
/**
* @}
...
...
coreapi/linphonecore_jni.cc
View file @
454e9834
...
...
@@ -4315,6 +4315,21 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv
return
(
jint
)
linphone_core_get_conference_size
((
LinphoneCore
*
)
pCore
);
}
extern
"C"
jobject
Java_org_linphone_core_LinphoneCoreImpl_createConference
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
corePtr
,
jobject
jparams
)
{
jclass
params_class
=
env
->
FindClass
(
"org/linphone/core/LinphoneConferenceParamsImpl"
);
jclass
conference_class
=
env
->
FindClass
(
"org/linphone/core/LinphoneConferenceImpl"
);
jfieldID
params_native_ptr_attr
=
env
->
GetFieldID
(
params_class
,
"nativePtr"
,
"J"
);
jmethodID
conference_constructor
=
env
->
GetMethodID
(
conference_class
,
"<init>"
,
"(J)V"
);
LinphoneConferenceParams
*
params
=
NULL
;
LinphoneConference
*
conference
;
jobject
jconference
;
if
(
jparams
)
params
=
(
LinphoneConferenceParams
*
)
env
->
GetLongField
(
params_class
,
params_native_ptr_attr
);
conference
=
linphone_core_create_conference_with_params
((
LinphoneCore
*
)
corePtr
,
params
);
if
(
conference
)
return
env
->
NewObject
(
conference_class
,
conference_constructor
,
(
jlong
)
conference
);
else
return
NULL
;
}
extern
"C"
jobject
Java_org_linphone_core_LinphoneCoreImpl_getConference
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
pCore
)
{
jclass
conference_class
=
env
->
FindClass
(
"org/linphone/core/LinphoneConferenceImpl"
);
jmethodID
conference_constructor
=
env
->
GetMethodID
(
conference_class
,
"<init>"
,
"(J)V"
);
...
...
@@ -6746,6 +6761,32 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getNortpTimeout(J
extern
"C"
jlong
Java_org_linphone_core_LinphoneConferenceParamsImpl_createInstance
(
JNIEnv
*
env
,
jobject
thiz
,
jobject
jcore
)
{
jclass
core_class
=
env
->
FindClass
(
"org/linphone/core/LinphoneCoreImpl"
);
jfieldID
native_ptr_attr
=
env
->
GetFieldID
(
core_class
,
"nativePtr"
,
"J"
);
LinphoneCore
*
core
=
NULL
;
if
(
jcore
)
core
=
(
LinphoneCore
*
)
env
->
GetLongField
(
jcore
,
native_ptr_attr
);