mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-06 21:33:08 +00:00
add traces + more jni implementation
This commit is contained in:
parent
9a17310ffd
commit
01331f08a9
3 changed files with 26 additions and 5 deletions
|
|
@ -36,6 +36,7 @@ LinphoneAddress * linphone_address_new(const char *uri){
|
|||
osip_from_init(&from);
|
||||
if (osip_from_parse(from,uri)!=0){
|
||||
osip_from_free(from);
|
||||
ms_error("Cannot create LinphoneAddress, bad uri [%s]",uri);
|
||||
return NULL;
|
||||
}
|
||||
return from;
|
||||
|
|
|
|||
|
|
@ -1836,7 +1836,7 @@ int linphone_core_invite(LinphoneCore *lc, const char *url)
|
|||
err=eXosip_call_build_initial_invite(&invite,real_url,from,
|
||||
route,"Phone call");
|
||||
if (err<0){
|
||||
ms_warning("Could not build initial invite");
|
||||
ms_warning("Could not build initial invite cause [%i]",err);
|
||||
goto end;
|
||||
}
|
||||
if (lp_config_get_int(lc->config,"sip","use_session_timers",0)==1){
|
||||
|
|
|
|||
|
|
@ -222,9 +222,24 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getRemoteAddress( JNIEn
|
|||
,jlong lc) {
|
||||
return (jlong)linphone_core_get_remote_uri((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInCall( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
|
||||
return linphone_core_in_call((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInComingInvitePending( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
|
||||
return linphone_core_inc_invite_pending((LinphoneCore*)lc);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_acceptCall( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
|
||||
linphone_core_accept_call((LinphoneCore*)lc,NULL);
|
||||
}
|
||||
//ProxyConfig
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneProxyConfigImpl_newLinphoneProxyConfig(JNIEnv* env,jobject thiz) {
|
||||
|
|
@ -256,9 +271,12 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_done(JNIEnv* env,
|
|||
linphone_proxy_config_done((LinphoneProxyConfig*)proxyCfg);
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_normalizePhoneNumber(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jnumber) {
|
||||
if (jnumber == 0) {
|
||||
ms_error("cannot normalized null number");
|
||||
}
|
||||
const char* number = env->GetStringUTFChars(jnumber, NULL);
|
||||
int len = env->GetStringLength(jnumber);
|
||||
char targetBuff[len];
|
||||
char targetBuff[2*len];// returned number can be greater than origin (specially in case of prefix insertion
|
||||
linphone_proxy_config_normalize_number((LinphoneProxyConfig*)proxyCfg,number,targetBuff,sizeof(targetBuff));
|
||||
jstring normalizedNumber = env->NewStringUTF(targetBuff);
|
||||
env->ReleaseStringUTFChars(jnumber, number);
|
||||
|
|
@ -274,9 +292,11 @@ extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getDomain(JNIE
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setDialEscapePlus(JNIEnv* env,jobject thiz,jlong proxyCfg,jboolean value) {
|
||||
linphone_proxy_config_set_dial_escape_plus((LinphoneProxyConfig*)proxyCfg,value);
|
||||
}
|
||||
|
||||
|
||||
void Java_org_linphone_core_LinphoneProxyConfigImpl_setPrefix(JNIEnv* env
|
||||
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setDialPrefix(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong proxyCfg
|
||||
,jstring jprefix) {
|
||||
|
|
@ -318,7 +338,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneAddressImpl_newLinphoneAddressIm
|
|||
,jstring jdisplayName) {
|
||||
const char* uri = env->GetStringUTFChars(juri, NULL);
|
||||
LinphoneAddress* address = linphone_address_new(uri);
|
||||
if (jdisplayName) {
|
||||
if (jdisplayName && address) {
|
||||
const char* displayName = env->GetStringUTFChars(jdisplayName, NULL);
|
||||
linphone_address_set_display_name(address,displayName);
|
||||
env->ReleaseStringUTFChars(jdisplayName, displayName);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue