Commit 6e655d74 authored by François Grisez's avatar François Grisez

Add the ability to remove a participant from a remote conference

That new feature has not been tested yet neither with Telefonica's server nor
in liblinphone tester. That one does not still work because the LinphoneCore
instance simulating the conference server does not handle REFER with BYE requests.
parent 2fcf9d4f
......@@ -40,7 +40,7 @@ static void sal_op_set_referred_by(SalOp* op,belle_sip_header_referred_by_t* ref
int sal_call_refer_to(SalOp *op, belle_sip_header_refer_to_t* refer_to, belle_sip_header_referred_by_t* referred_by){
char* tmp;
belle_sip_request_t* req=op->dialog?belle_sip_dialog_create_request(op->dialog,"REFER"):NULL; /*cannot create request if dialog not set yet*/
belle_sip_request_t* req=op->dialog?belle_sip_dialog_create_request(op->dialog,"REFER"):sal_op_build_request(op, "REFER");
if (!req) {
tmp=belle_sip_uri_to_string(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(refer_to)));
ms_error("Cannot refer to [%s] for op [%p]",tmp,op);
......
This diff is collapsed.
......@@ -39,19 +39,22 @@ LinphoneConference *linphone_local_conference_new(LinphoneCore *core);
LinphoneConference *linphone_remote_conference_new(LinphoneCore *core);
void linphone_conference_free(LinphoneConference *obj);
int linphone_conference_add_call(LinphoneConference *obj, LinphoneCall *call);
int linphone_conference_remove_call(LinphoneConference *obj, LinphoneCall *call);
int linphone_conference_add_participant(LinphoneConference *obj, LinphoneCall *call);
int linphone_conference_remove_participant_with_call(LinphoneConference *obj, LinphoneCall *call);
int linphone_conference_remove_participant(LinphoneConference *obj, const LinphoneAddress *uri);
int linphone_conference_terminate(LinphoneConference *obj);
int linphone_conference_add_local_participant(LinphoneConference *obj);
int linphone_conference_remove_local_participant(LinphoneConference *obj);
bool_t linphone_conference_local_participant_is_in(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_get_participant_count(const LinphoneConference *obj);
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);
......
......@@ -7410,7 +7410,7 @@ int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call) {
return -1;
}
}
return linphone_conference_add_call(lc->conf_ctx, call);
return linphone_conference_add_participant(lc->conf_ctx, call);
}
int linphone_core_add_all_to_conference(LinphoneCore *lc) {
......@@ -7427,7 +7427,7 @@ int linphone_core_add_all_to_conference(LinphoneCore *lc) {
}
int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call) {
if(lc->conf_ctx) return linphone_conference_remove_call(lc->conf_ctx, call);
if(lc->conf_ctx) return linphone_conference_remove_participant_with_call(lc->conf_ctx, call);
else return -1;
}
......@@ -7440,17 +7440,17 @@ int linphone_core_terminate_conference(LinphoneCore *lc) {
}
int linphone_core_enter_conference(LinphoneCore *lc) {
if(lc->conf_ctx) return linphone_conference_add_local_participant(lc->conf_ctx);
if(lc->conf_ctx) return linphone_conference_enter(lc->conf_ctx);
else return -1;
}
int linphone_core_leave_conference(LinphoneCore *lc) {
if(lc->conf_ctx) return linphone_conference_remove_local_participant(lc->conf_ctx);
if(lc->conf_ctx) return linphone_conference_leave(lc->conf_ctx);
else return -1;
}
bool_t linphone_core_is_in_conference(const LinphoneCore *lc) {
if(lc->conf_ctx) return linphone_conference_local_participant_is_in(lc->conf_ctx);
if(lc->conf_ctx) return linphone_conference_is_in(lc->conf_ctx);
else return FALSE;
}
......
......@@ -3858,6 +3858,9 @@ LINPHONE_PUBLIC int linphone_core_add_all_to_conference(LinphoneCore *lc);
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
* conferencet server (focus). If you use such a conference, you should use
* linphone_conference_remove_participant() instead.
* @param lc the linphone core
* @return TRUE if the local participant is in a conference, FALSE otherwise.
*/
......@@ -3909,11 +3912,25 @@ LINPHONE_PUBLIC int linphone_core_start_conference_recording(LinphoneCore *lc, c
*/
LINPHONE_PUBLIC int linphone_core_stop_conference_recording(LinphoneCore *lc);
/**
* Get a pointer on the internal conference object.
* @param lc #LinphoneCore
* @return A pointer on #LinphoneConference or NULL if no conference are going on
*/
* Get a pointer on the internal conference object.
* @param lc #LinphoneCore
* @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
* @param obj A #LinphoneConference
* @return A #MSList containing URIs of all participant. That list must be
* freed after utilisation and each URI must be unref with linphone_address_unref()
*/
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);
/**
* @}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment