]> sjero.net Git - linphone/commitdiff
Max calls limit (config, C, exposed to java)
authorGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Tue, 18 Oct 2011 13:41:04 +0000 (15:41 +0200)
committerGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Tue, 18 Oct 2011 13:41:04 +0000 (15:41 +0200)
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/linphonecore_jni.cc
coreapi/private.h
java/common/org/linphone/core/LinphoneCore.java

index 3a21ae70135241ed9bf815d0012ea3ca8dc492fb..a85a4f622936a70219c9c3ef9de704ea4ec021bd 100644 (file)
@@ -973,6 +973,7 @@ void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const
 static void misc_config_read (LinphoneCore *lc) {
        LpConfig *config=lc->config;
     lc->max_call_logs=lp_config_get_int(config,"misc","history_max_size",15);
+    lc->max_calls=lp_config_get_int(config,"misc","max_calls",NB_MAX_CALLS);
 }
 
 static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, const char *config_path,
@@ -4300,6 +4301,11 @@ void linphone_core_stop_dtmf_stream(LinphoneCore* lc) {
        lc->ringstream=NULL;
 }
 
+int linphone_core_get_max_calls(LinphoneCore *lc) {
+       return lc->max_calls;
+}
+
+
 typedef struct Hook{
        LinphoneCoreIterateHook fun;
        void *data;
index 65683870aea21808c513f78ff351fa415f39eca2..a85855def0f0722f793f2c98e46086f5cca7e1b9 100644 (file)
@@ -1030,6 +1030,8 @@ float linphone_core_get_conference_local_input_volume(LinphoneCore *lc);
 int linphone_core_terminate_conference(LinphoneCore *lc);
 int linphone_core_get_conference_size(LinphoneCore *lc);
 
+int linphone_core_get_max_calls(LinphoneCore *lc);
+
 #ifdef __cplusplus
 }
 #endif
index e2dfd5db6f216cb7bee2d868cbd91fe260659524..8713e86d20a04c8a8745def708b126b900d09c37 100644 (file)
@@ -1506,5 +1506,10 @@ extern "C" void msandroid_hack_speaker_state(bool speakerOn);
 
 extern "C" void Java_org_linphone_LinphoneManager_hackSpeakerState(JNIEnv*  env,jobject thiz,jboolean speakerOn){
        msandroid_hack_speaker_state(speakerOn);
+}
 // End Galaxy S hack functions
+
+
+extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMaxCalls(JNIEnv *env,jobject thiz,jlong pCore) {
+       return (jint) linphone_core_get_max_calls((LinphoneCore *) pCore);
 }
index d2b78942ea4bbc17f249ad56547decb90e2eec52..49c7c4016703525e135b778cb41df1e99fe58464 100644 (file)
@@ -467,6 +467,7 @@ struct _LinphoneCore
        bool_t use_preview_window;
        int device_rotation;
        bool_t ringstream_autorelease;
+       int max_calls;
 };
 
 bool_t linphone_core_can_we_add_call(LinphoneCore *lc);
index aef993ea055ca9d2c9f501582851c6094d3a99ff..88f1be6fff35ac58ccfdf000f2b4766f62d65549 100644 (file)
@@ -621,4 +621,7 @@ public interface LinphoneCore {
        void transferCallToAnother(LinphoneCall callToTransfer, LinphoneCall destination);
 
        LinphoneCall findCallFromUri(String uri);
+
+       int getMaxCalls();
+
 }