mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Add a pre-condition to linphone_conference_remove_participant()
This commit is contained in:
parent
30e504c263
commit
4b91e2b029
2 changed files with 15 additions and 4 deletions
|
|
@ -686,15 +686,25 @@ int RemoteConference::addParticipant(LinphoneCall *call) {
|
|||
}
|
||||
|
||||
int RemoteConference::removeParticipant(const LinphoneAddress *uri) {
|
||||
char *tmp, *refer_to;
|
||||
char *refer_to;
|
||||
LinphoneAddress *refer_to_addr;
|
||||
int res;
|
||||
|
||||
switch(m_state) {
|
||||
case LinphoneConferenceReady:
|
||||
tmp = linphone_address_as_string_uri_only(uri);
|
||||
refer_to = ms_strdup_printf("%s;method=BYE", tmp);
|
||||
if(findParticipant(uri) == NULL) {
|
||||
char *tmp = linphone_address_as_string(uri);
|
||||
ms_error("Conference: could not remove participant '%s': not in the participants list", tmp);
|
||||
ms_free(tmp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// refer_to = ms_strdup_printf("%s;method=BYE", tmp);
|
||||
refer_to_addr = linphone_address_clone(uri);
|
||||
linphone_address_set_method_param(refer_to_addr, "BYE");
|
||||
refer_to = linphone_address_as_string(refer_to_addr);
|
||||
linphone_address_unref(refer_to_addr);
|
||||
res = sal_call_refer(m_focusCall->op, refer_to);
|
||||
ms_free(tmp);
|
||||
ms_free(refer_to);
|
||||
|
||||
if(res == 0) {
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ LINPHONE_PUBLIC bool_t linphone_conference_params_video_requested(const Linphone
|
|||
* Remove a participant from a conference
|
||||
* @param obj A #LinphoneConference
|
||||
* @param uri SIP URI of the participant to remove
|
||||
* @warning The passed SIP URI must be one of the URIs returned by linphone_conference_get_participants()
|
||||
* @return 0 if succeeded, -1 if failed
|
||||
*/
|
||||
LINPHONE_PUBLIC int linphone_conference_remove_participant(LinphoneConference *obj, const LinphoneAddress *uri);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue