Commit faaaa22f authored by jehan's avatar jehan

add user data in proxy config

parent 27d10bbe
......@@ -238,6 +238,14 @@ SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg);
* normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222
*/
int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len);
/*
* attached a user data to a proxy config
*/
void linphone_proxy_config_set_user_data(LinphoneProxyConfig *cr, void * ud);
/*
* get user data to a proxy config. return null if any
*/
void * linphone_proxy_config_get_user_data(LinphoneProxyConfig *cr);
/**
* @}
......
......@@ -193,6 +193,10 @@ extern "C" int Java_org_linphone_core_LinphoneCoreImpl_addProxyConfig( JNIEnv*
,jobject thiz
,jlong lc
,jlong pc) {
LinphoneProxyConfig* proxy = (LinphoneProxyConfig*)pc;
linphone_proxy_config_set_user_data(proxy
,env->NewGlobalRef((jobject)linphone_proxy_config_get_user_data(proxy)));
return linphone_core_add_proxy_config((LinphoneCore*)lc,(LinphoneProxyConfig*)pc);
}
......@@ -281,10 +285,18 @@ extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getSoftPlayLevel( JNIEn
return linphone_core_get_soft_play_level((LinphoneCore*)lc);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_muteMic( JNIEnv* env
,jobject thiz
,jlong lc
,jboolean isMuted) {
linphone_core_mute_mic((LinphoneCore*)lc,isMuted);
}
//ProxyConfig
extern "C" jlong Java_org_linphone_core_LinphoneProxyConfigImpl_newLinphoneProxyConfig(JNIEnv* env,jobject thiz) {
return (jlong) linphone_proxy_config_new();
LinphoneProxyConfig* proxy = linphone_proxy_config_new();
linphone_proxy_config_set_user_data(proxy,thiz);
return (jlong) proxy;
}
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_delete(JNIEnv* env,jobject thiz,jlong ptr) {
......
......@@ -203,6 +203,7 @@ struct _LinphoneProxyConfig
bool_t registered;
bool_t publish;
bool_t dial_escape_plus;
void* user_data;
};
struct _LinphoneAuthInfo
......
......@@ -737,5 +737,13 @@ void linphone_account_creator_destroy(LinphoneAccountCreator *obj){
}
}
void linphone_proxy_config_set_user_data(LinphoneProxyConfig *cr, void * ud) {
cr->user_data=ud;
}
void * linphone_proxy_config_get_user_data(LinphoneProxyConfig *cr) {
return cr->user_data;
}
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