sprintf(key,"auth_info_%i",pos);
lp_config_clean_section(config,key);
- if (obj==NULL){
+ if (obj==NULL || lp_config_get_int(config, "sip", "store_auth_info", 1) == 0){
return;
}
if (obj->username!=NULL){
#include "linphonecore_utils.h"
#include <ortp/zrtp.h>
-#ifdef TUNNEL_ENABLED
-#include "linphone_tunnel.h"
-#endif
extern "C" {
#include "mediastreamer2/mediastream.h"
#include "private.h"
#include <cpu-features.h>
+#include "lpconfig.h"
+
#ifdef ANDROID
#include <android/log.h>
extern "C" void libmsilbc_init();
jstring jvalue =env->NewStringUTF(linphone_core_get_version());
return jvalue;
}
+
+extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getConfig(JNIEnv *env, jobject thiz, jlong lc) {
+ return (jlong) linphone_core_get_config((LinphoneCore *)lc);
+}
+
+extern "C" void Java_org_linphone_core_LpConfigImpl_setInt(JNIEnv *env, jobject thiz, jlong lpc,
+ jstring section, jstring key, jint value) {
+ const char *csection = env->GetStringUTFChars(section, NULL);
+ const char *ckey = env->GetStringUTFChars(key, NULL);
+ lp_config_set_int((LpConfig *)lpc, csection, ckey, (int) value);
+ env->ReleaseStringUTFChars(section, csection);
+ env->ReleaseStringUTFChars(key, ckey);
+}
+
vtable.transfer_state_changed=linphone_gtk_transfer_state_changed;
the_core=linphone_core_new(&vtable,config_file,factory_config_file,NULL);
+ //lp_config_set_int(linphone_core_get_config(the_core), "sip", "store_auth_info", 0);
linphone_core_set_user_agent(the_core,"Linphone", LINPHONE_VERSION);
linphone_core_set_waiting_callback(the_core,linphone_gtk_wait,NULL);
linphone_core_set_zrtp_secrets_file(the_core,secrets_file);
* Enable/Disable the use of inband DTMFs
*/
void setUseRfc2833ForDtmfs(boolean use);
+
+ /**
+ * @return returns LpConfig object to read/write to the config file: usefull if you wish to extend
+ * the config file with your own sections
+ */
+ LpConfig getConfig();
}
--- /dev/null
+/*
+LPConfig.java
+Copyright (C) 2013 Belledonne Communications, Grenoble, France
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+package org.linphone.core;
+
+
+/**
+ * The LpConfig object is used to manipulate a configuration file.
+ *
+ * <pre>
+ * The format of the configuration file is a .ini like format:
+ * - sections are defined in []
+ * - each section contains a sequence of key=value pairs.
+ *
+ * Example:
+ * [sound]
+ * echocanceler=1
+ * playback_dev=ALSA: Default device
+ *
+ * [video]
+ * enabled=1
+ * </pre>
+ * }
+ * @author Guillaume Beraudo
+ */
+public interface LpConfig {
+
+ /**
+ * Sets an integer config item
+ * @param key
+ */
+ void setInt(String section, String key, int value);
+}
public void setUseRfc2833ForDtmfs(boolean use) {
setUseRfc2833ForDtmfs(nativePtr, use);
}
+
+ private native long getConfig(long ptr);
+ public LpConfig getConfig() {
+ long configPtr=getConfig(nativePtr);
+ return new LpConfigImpl(configPtr);
+ }
}
--- /dev/null
+/*
+LPConfigImpl.java
+Copyright (C) 2013 Belledonne Communications, Grenoble, France
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+package org.linphone.core;
+
+
+
+class LpConfigImpl implements LpConfig {
+
+ private final long nativePtr;
+
+ public LpConfigImpl(long ptr) {
+ nativePtr=ptr;
+ }
+
+ private native void setInt(long ptr, String section, String key, int value);
+ public void setInt(String section, String key, int value) {
+ setInt(nativePtr, section, key, value);
+ }
+
+}