Commit b44b872e authored by François Grisez's avatar François Grisez
Browse files

Prevents the conference server to be added to the list of participants

parent bd667fb4
......@@ -89,7 +89,7 @@ public:
virtual void onCallTerminating(LinphoneCall *call) {};
protected:
Participant *find_participant(const LinphoneAddress *uri);
const Participant *findParticipant(const LinphoneAddress* uri) const;
LinphoneCore *m_core;
AudioStream *m_localParticipantStream;
......@@ -234,7 +234,7 @@ int Conference::removeParticipant(LinphoneCall *call) {
}
int Conference::removeParticipant(const LinphoneAddress *uri) {
Participant *participant = find_participant(uri);
const Participant *participant = findParticipant(uri);
if(participant == NULL) return -1;
LinphoneCall *call = participant->getCall();
if(call) call->conf_ref = NULL;
......@@ -266,8 +266,8 @@ float Conference::getInputVolume() const {
return LINPHONE_VOLUME_DB_LOWEST;
}
Participant *Conference::find_participant(const LinphoneAddress *uri) {
list<Participant>::iterator it = m_participants.begin();
const Participant *Conference::findParticipant(const LinphoneAddress *uri) const {
list<Participant>::const_iterator it = m_participants.begin();
while(it!=m_participants.end()) {
if(linphone_address_equal(uri, it->getUri())) break;
it++;
......@@ -452,7 +452,7 @@ int LocalConference::removeParticipant(LinphoneCall *call) {
}
int LocalConference::removeParticipant(const LinphoneAddress *uri) {
Participant *participant = find_participant(uri);
const Participant *participant = findParticipant(uri);
if(participant == NULL) return -1;
LinphoneCall *call = participant->getCall();
if(call == NULL) return -1;
......@@ -608,10 +608,10 @@ int RemoteConference::addParticipant(LinphoneCall *call) {
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_focusCall->conf_ref = (LinphoneConference *)this;
m_localParticipantStream = m_focusCall->audiostream;
m_pendingCalls = ms_list_append(m_pendingCalls, linphone_call_ref(call));
m_state = ConnectingToFocus;
call->conf_ref = (LinphoneConference *)this;
LinphoneCallLog *callLog = linphone_call_get_call_log(m_focusCall);
callLog->was_conference = TRUE;
linphone_address_unref(addr);
......
......@@ -7437,7 +7437,9 @@ int linphone_core_add_all_to_conference(LinphoneCore *lc) {
while (calls) {
LinphoneCall *call=(LinphoneCall*)calls->data;
calls=calls->next;
linphone_core_add_to_conference(lc, call);
if(linphone_call_get_conference(call) == NULL) { // Prevent the call to the conference server from being added to the conference
linphone_core_add_to_conference(lc, call);
}
}
if(lc->conf_ctx && linphone_conference_check_class(lc->conf_ctx, LinphoneConferenceClassLocal)) {
linphone_core_enter_conference(lc);
......
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