From cfaa4721e5bea988e585ee221ec88e97b657925d Mon Sep 17 00:00:00 2001
From: Guillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Date: Thu, 3 Nov 2011 16:11:04 +0100
Subject: [PATCH] Expose setter for max calls. (0 while in GSM call).

---
 coreapi/linphonecore.c                          | 4 +++-
 coreapi/linphonecore.h                          | 2 ++
 coreapi/linphonecore_jni.cc                     | 3 +++
 java/common/org/linphone/core/LinphoneCore.java | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c
index 66334ea0f4..afdcf01b3b 100644
--- a/coreapi/linphonecore.c
+++ b/coreapi/linphonecore.c
@@ -4311,7 +4311,9 @@ void linphone_core_stop_dtmf_stream(LinphoneCore* lc) {
 int linphone_core_get_max_calls(LinphoneCore *lc) {
 	return lc->max_calls;
 }
-
+void linphone_core_set_max_calls(LinphoneCore *lc, int max) {
+	lc->max_calls=max;
+}
 
 typedef struct Hook{
 	LinphoneCoreIterateHook fun;
diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h
index 0f49a4593e..245bd899b1 100644
--- a/coreapi/linphonecore.h
+++ b/coreapi/linphonecore.h
@@ -1031,6 +1031,8 @@ int linphone_core_terminate_conference(LinphoneCore *lc);
 int linphone_core_get_conference_size(LinphoneCore *lc);
 
 int linphone_core_get_max_calls(LinphoneCore *lc);
+void linphone_core_set_max_calls(LinphoneCore *lc, int max);
+
 bool_t linphone_core_sound_resources_locked(LinphoneCore *lc);
 
 #ifdef __cplusplus
diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc
index 6da09ef6b9..fdd035de48 100644
--- a/coreapi/linphonecore_jni.cc
+++ b/coreapi/linphonecore_jni.cc
@@ -1523,3 +1523,6 @@ extern "C" void Java_org_linphone_LinphoneManager_hackSpeakerState(JNIEnv*  env,
 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMaxCalls(JNIEnv *env,jobject thiz,jlong pCore) {
 	return (jint) linphone_core_get_max_calls((LinphoneCore *) pCore);
 }
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setMaxCalls(JNIEnv *env,jobject thiz,jlong pCore, jint max) {
+	linphone_core_set_max_calls((LinphoneCore *) pCore, (int) max);
+}
diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java
index fcd041dc8a..249dff5587 100644
--- a/java/common/org/linphone/core/LinphoneCore.java
+++ b/java/common/org/linphone/core/LinphoneCore.java
@@ -623,6 +623,7 @@ public interface LinphoneCore {
 	LinphoneCall findCallFromUri(String uri);
 
 	int getMaxCalls();
+	void setMaxCalls(int max);
 	boolean isMyself(String uri);
 
 	/**
-- 
GitLab