int linphone_core_enter_conference(LinphoneCore *lc){
+ if (linphone_core_sound_resources_locked) {
+ return -1;
+ }
LinphoneConference *conf=&lc->conf_ctx;
if (conf->local_participant==NULL) add_local_endpoint(conf,lc);
return 0;
}
return NULL;
}
+
+
+/**
+ * Check if a call will need the sound resources.
+ *
+ * @ingroup call_control
+ * @param lc The LinphoneCore
+**/
+bool_t linphone_core_sound_resources_locked(LinphoneCore *lc){
+ MSList *calls=lc->calls;
+ while(calls) {
+ LinphoneCall *c=(LinphoneCall*)calls->data;
+ calls=calls->next;
+ switch (c->state) {
+ case LinphoneCallOutgoingInit:
+ case LinphoneCallOutgoingProgress:
+ case LinphoneCallOutgoingRinging:
+ case LinphoneCallOutgoingEarlyMedia:
+ case LinphoneCallConnected:
+ case LinphoneCallRefered:
+ case LinphoneCallIncomingEarlyMedia:
+ case LinphoneCallUpdated:
+ return TRUE;
+ default:
+ break;
+ }
+ }
+ return FALSE;
+}
int linphone_core_get_conference_size(LinphoneCore *lc);
int linphone_core_get_max_calls(LinphoneCore *lc);
+bool_t linphone_core_sound_resources_locked(LinphoneCore *lc);
#ifdef __cplusplus
}
return linphone_call_are_all_streams_encrypted((LinphoneCall *) ptr);
}
+extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_soundResourcesLocked(JNIEnv* env,jobject thiz,jlong ptr){
+ return linphone_core_sound_resources_locked((LinphoneCore *) ptr);
+}
+
// Needed by Galaxy S (can't switch to/from speaker while playing and still keep mic working)
// Implemented directly in msandroid.cpp (sound filters for Android).
extern "C" void msandroid_hack_speaker_state(bool speakerOn);
int getMaxCalls();
boolean isMyself(String uri);
+ /**
+ * Use this method to check the calls state and forbid proposing actions
+ * which could result in an active call.
+ * Eg: don't start a new call if one is in outgoing ringing.
+ * Eg: don't merge to conference either as it could result
+ * in two active calls (conference and accepted call).
+ * @return
+ */
+ boolean soundResourcesLocked();
}