3 Copyright (C) 2010 Belledonne Communications, Grenoble, France
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include "linphonecore_utils.h"
22 #include "mediastreamer2/msjava.h"
25 #include <android/log.h>
26 extern "C" void libmsilbc_init();
28 extern "C" void libmsx264_init();
35 static void linphone_android_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){
38 case ORTP_DEBUG: prio = ANDROID_LOG_DEBUG; break;
39 case ORTP_MESSAGE: prio = ANDROID_LOG_INFO; break;
40 case ORTP_WARNING: prio = ANDROID_LOG_WARN; break;
41 case ORTP_ERROR: prio = ANDROID_LOG_ERROR; break;
42 case ORTP_FATAL: prio = ANDROID_LOG_FATAL; break;
43 default: prio = ANDROID_LOG_DEFAULT; break;
45 __android_log_vprint(prio, LOG_DOMAIN, fmt, args);
49 JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *ajvm, void *reserved)
55 return JNI_VERSION_1_2;
60 extern "C" void Java_org_linphone_core_LinphoneCoreFactoryImpl_setDebugMode(JNIEnv* env
64 linphone_core_enable_logs_with_cb(linphone_android_log_handler);
66 linphone_core_disable_logs();
71 class LinphoneCoreData {
73 LinphoneCoreData(JNIEnv* env, jobject lc,jobject alistener, jobject auserdata) {
75 core = env->NewGlobalRef(lc);
76 listener = env->NewGlobalRef(alistener);
77 userdata = auserdata?env->NewGlobalRef(auserdata):0;
78 memset(&vTable,0,sizeof(vTable));
79 vTable.show = showInterfaceCb;
80 vTable.auth_info_requested = authInfoRequested;
81 vTable.display_status = displayStatusCb;
82 vTable.display_message = displayMessageCb;
83 vTable.display_warning = displayMessageCb;
84 vTable.global_state_changed = globalStateChange;
85 vTable.registration_state_changed = registrationStateChange;
86 vTable.call_state_changed = callStateChange;
87 vTable.text_received = text_received;
88 vTable.new_subscription_request = new_subscription_request;
89 vTable.notify_presence_recv = notify_presence_recv;
91 listernerClass = (jclass)env->NewGlobalRef(env->GetObjectClass( alistener));
92 /*displayStatus(LinphoneCore lc,String message);*/
93 displayStatusId = env->GetMethodID(listernerClass,"displayStatus","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;)V");
94 /*void generalState(LinphoneCore lc,int state); */
95 globalStateId = env->GetMethodID(listernerClass,"globalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GlobalState;Ljava/lang/String;)V");
96 globalStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$GlobalState"));
97 globalStateFromIntId = env->GetStaticMethodID(globalStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$GlobalState;");
98 /*registrationState(LinphoneCore lc, LinphoneProxyConfig cfg, LinphoneCore.RegistrationState cstate, String smessage);*/
99 registrationStateId = env->GetMethodID(listernerClass,"registrationState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneProxyConfig;Lorg/linphone/core/LinphoneCore$RegistrationState;Ljava/lang/String;)V");
100 registrationStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$RegistrationState"));
101 registrationStateFromIntId = env->GetStaticMethodID(registrationStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$RegistrationState;");
102 /*callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State cstate,String message);*/
103 callStateId = env->GetMethodID(listernerClass,"callState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCall;Lorg/linphone/core/LinphoneCall$State;Ljava/lang/String;)V");
104 callStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCall$State"));
105 callStateFromIntId = env->GetStaticMethodID(callStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCall$State;");
106 /*void ecCalibrationStatus(LinphoneCore.EcCalibratorStatus status, int delay_ms, Object data);*/
107 ecCalibrationStatusId = env->GetMethodID(listernerClass,"ecCalibrationStatus","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$EcCalibratorStatus;ILjava/lang/Object;)V");
108 ecCalibratorStatusClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$EcCalibratorStatus"));
109 ecCalibratorStatusFromIntId = env->GetStaticMethodID(ecCalibratorStatusClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$EcCalibratorStatus;");
110 /*void newSubscriptionRequest(LinphoneCore lc, LinphoneFriend lf, String url)*/
111 newSubscriptionRequestId = env->GetMethodID(listernerClass,"newSubscriptionRequest","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneFriend;Ljava/lang/String;)V");
113 /*void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf);*/
114 notifyPresenceReceivedId = env->GetMethodID(listernerClass,"notifyPresenceReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneFriend;)V");
116 /*void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from,String message);*/
117 textReceivedId = env->GetMethodID(listernerClass,"textReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneAddress;Ljava/lang/String;)V");
119 proxyClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneProxyConfigImpl"));
120 proxyCtrId = env->GetMethodID(proxyClass,"<init>", "(J)V");
122 callClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCallImpl"));
123 callCtrId = env->GetMethodID(callClass,"<init>", "(J)V");
125 chatRoomClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneChatRoomImpl"));
126 chatRoomCtrId = env->GetMethodID(chatRoomClass,"<init>", "(J)V");
128 friendClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneFriendImpl"));;
129 friendCtrId =env->GetMethodID(friendClass,"<init>", "(J)V");
131 addressClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneAddressImpl"));
132 addressCtrId =env->GetMethodID(addressClass,"<init>", "(J)V");
136 ~LinphoneCoreData() {
138 jvm->AttachCurrentThread(&env,NULL);
139 env->DeleteGlobalRef(core);
140 env->DeleteGlobalRef(listener);
141 if (userdata) env->DeleteGlobalRef(userdata);
142 env->DeleteGlobalRef(listernerClass);
143 env->DeleteGlobalRef(globalStateClass);
144 env->DeleteGlobalRef(registrationStateClass);
145 env->DeleteGlobalRef(callStateClass);
146 env->DeleteGlobalRef(proxyClass);
147 env->DeleteGlobalRef(callClass);
148 env->DeleteGlobalRef(chatRoomClass);
149 env->DeleteGlobalRef(friendClass);
156 jclass listernerClass;
157 jmethodID displayStatusId;
158 jmethodID newSubscriptionRequestId;
159 jmethodID notifyPresenceReceivedId;
160 jmethodID textReceivedId;
162 jclass globalStateClass;
163 jmethodID globalStateId;
164 jmethodID globalStateFromIntId;
166 jclass registrationStateClass;
167 jmethodID registrationStateId;
168 jmethodID registrationStateFromIntId;
170 jclass callStateClass;
171 jmethodID callStateId;
172 jmethodID callStateFromIntId;
174 jclass ecCalibratorStatusClass;
175 jmethodID ecCalibrationStatusId;
176 jmethodID ecCalibratorStatusFromIntId;
179 jmethodID proxyCtrId;
184 jclass chatRoomClass;
185 jmethodID chatRoomCtrId;
188 jmethodID friendCtrId;
191 jmethodID addressCtrId;
193 LinphoneCoreVTable vTable;
195 static void showInterfaceCb(LinphoneCore *lc) {
198 static void byeReceivedCb(LinphoneCore *lc, const char *from) {
201 static void displayStatusCb(LinphoneCore *lc, const char *message) {
203 jint result = jvm->AttachCurrentThread(&env,NULL);
205 ms_error("cannot attach VM\n");
208 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
209 env->CallVoidMethod(lcData->listener,lcData->displayStatusId,lcData->core,env->NewStringUTF(message));
211 static void displayMessageCb(LinphoneCore *lc, const char *message) {
214 static void authInfoRequested(LinphoneCore *lc, const char *realm, const char *username) {
217 static void globalStateChange(LinphoneCore *lc, LinphoneGlobalState gstate,const char* message) {
219 jint result = jvm->AttachCurrentThread(&env,NULL);
221 ms_error("cannot attach VM\n");
224 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
225 env->CallVoidMethod(lcData->listener
226 ,lcData->globalStateId
228 ,env->CallStaticObjectMethod(lcData->globalStateClass,lcData->globalStateFromIntId,(jint)gstate),
229 message ? env->NewStringUTF(message) : NULL);
231 static void registrationStateChange(LinphoneCore *lc, LinphoneProxyConfig* proxy,LinphoneRegistrationState state,const char* message) {
233 jint result = jvm->AttachCurrentThread(&env,NULL);
235 ms_error("cannot attach VM\n");
238 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
239 env->CallVoidMethod(lcData->listener
240 ,lcData->registrationStateId
242 ,env->NewObject(lcData->proxyClass,lcData->proxyCtrId,(jlong)proxy)
243 ,env->CallStaticObjectMethod(lcData->registrationStateClass,lcData->registrationStateFromIntId,(jint)state),
244 message ? env->NewStringUTF(message) : NULL);
246 static void callStateChange(LinphoneCore *lc, LinphoneCall* call,LinphoneCallState state,const char* message) {
248 jint result = jvm->AttachCurrentThread(&env,NULL);
250 ms_error("cannot attach VM\n");
253 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
254 env->CallVoidMethod(lcData->listener
257 ,env->NewObject(lcData->callClass,lcData->callCtrId,(jlong)call)
258 ,env->CallStaticObjectMethod(lcData->callStateClass,lcData->callStateFromIntId,(jint)state),
259 message ? env->NewStringUTF(message) : NULL);
261 static void notify_presence_recv (LinphoneCore *lc, LinphoneFriend *my_friend) {
263 jint result = jvm->AttachCurrentThread(&env,NULL);
265 ms_error("cannot attach VM\n");
268 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
269 env->CallVoidMethod(lcData->listener
270 ,lcData->notifyPresenceReceivedId
272 ,env->NewObject(lcData->friendClass,lcData->friendCtrId,(jlong)my_friend));
274 static void new_subscription_request (LinphoneCore *lc, LinphoneFriend *my_friend, const char* url) {
276 jint result = jvm->AttachCurrentThread(&env,NULL);
278 ms_error("cannot attach VM\n");
281 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
282 env->CallVoidMethod(lcData->listener
283 ,lcData->newSubscriptionRequestId
285 ,env->NewObject(lcData->friendClass,lcData->friendCtrId,(jlong)my_friend)
286 ,url ? env->NewStringUTF(url) : NULL);
288 static void text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) {
290 jint result = jvm->AttachCurrentThread(&env,NULL);
292 ms_error("cannot attach VM\n");
295 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
296 env->CallVoidMethod(lcData->listener
297 ,lcData->textReceivedId
299 ,env->NewObject(lcData->chatRoomClass,lcData->chatRoomCtrId,(jlong)room)
300 ,env->NewObject(lcData->addressClass,lcData->addressCtrId,(jlong)from)
301 ,message ? env->NewStringUTF(message) : NULL);
303 static void ecCalibrationStatus(LinphoneCore *lc, LinphoneEcCalibratorStatus status, int delay_ms, void *data) {
305 jint result = jvm->AttachCurrentThread(&env,NULL);
307 ms_error("cannot attach VM\n");
310 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data(lc);
311 env->CallVoidMethod(lcData->listener
312 ,lcData->ecCalibrationStatusId
314 ,env->CallStaticObjectMethod(lcData->ecCalibratorStatusClass,lcData->ecCalibratorStatusFromIntId,(jint)status)
316 ,data ? data : NULL);
317 if (data != NULL &&status !=LinphoneEcCalibratorInProgress ) {
318 //final state, releasing global ref
319 env->DeleteGlobalRef((jobject)data);
326 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv* env
330 ,jstring jfactoryConfig
333 const char* userConfig = juserConfig?env->GetStringUTFChars(juserConfig, NULL):NULL;
334 const char* factoryConfig = jfactoryConfig?env->GetStringUTFChars(jfactoryConfig, NULL):NULL;
335 LinphoneCoreData* ldata = new LinphoneCoreData(env,thiz,jlistener,juserdata);
338 libmsilbc_init(); // requires an fpu
343 jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable
347 //clear auth info list
348 linphone_core_clear_all_auth_info((LinphoneCore*) nativePtr);
349 //clear existing proxy config
350 linphone_core_clear_proxy_config((LinphoneCore*) nativePtr);
352 if (userConfig) env->ReleaseStringUTFChars(juserConfig, userConfig);
353 if (factoryConfig) env->ReleaseStringUTFChars(jfactoryConfig, factoryConfig);
356 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_delete(JNIEnv* env
359 LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)lc);
360 linphone_core_destroy((LinphoneCore*)lc);
364 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_clearProxyConfigs(JNIEnv* env, jobject thiz,jlong lc) {
365 linphone_core_clear_proxy_config((LinphoneCore*)lc);
368 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDefaultProxyConfig( JNIEnv* env
372 linphone_core_set_default_proxy((LinphoneCore*)lc,(LinphoneProxyConfig*)pc);
374 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getDefaultProxyConfig( JNIEnv* env
377 LinphoneProxyConfig *config=0;
378 linphone_core_get_default_proxy((LinphoneCore*)lc,&config);
379 return (jlong)config;
382 extern "C" int Java_org_linphone_core_LinphoneCoreImpl_addProxyConfig( JNIEnv* env
387 LinphoneProxyConfig* proxy = (LinphoneProxyConfig*)pc;
388 linphone_proxy_config_set_user_data(proxy, env->NewGlobalRef(jproxyCfg));
390 return linphone_core_add_proxy_config((LinphoneCore*)lc,(LinphoneProxyConfig*)pc);
393 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_clearAuthInfos(JNIEnv* env, jobject thiz,jlong lc) {
394 linphone_core_clear_all_auth_info((LinphoneCore*)lc);
397 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addAuthInfo( JNIEnv* env
401 linphone_core_add_auth_info((LinphoneCore*)lc,(LinphoneAuthInfo*)pc);
403 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_iterate( JNIEnv* env
406 linphone_core_iterate((LinphoneCore*)lc);
408 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_invite( JNIEnv* env
412 const char* uri = env->GetStringUTFChars(juri, NULL);
413 LinphoneCall* lCall = linphone_core_invite((LinphoneCore*)lc,uri);
414 env->ReleaseStringUTFChars(juri, uri);
417 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_inviteAddress( JNIEnv* env
421 return (jlong) linphone_core_invite_address((LinphoneCore*)lc,(LinphoneAddress*)to);
424 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateCall( JNIEnv* env
428 linphone_core_terminate_call((LinphoneCore*)lc,(LinphoneCall*)call);
431 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getRemoteAddress( JNIEnv* env
434 return (jlong)linphone_core_get_current_call_remote_address((LinphoneCore*)lc);
436 extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInCall( JNIEnv* env
440 return linphone_core_in_call((LinphoneCore*)lc);
442 extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInComingInvitePending( JNIEnv* env
446 return linphone_core_inc_invite_pending((LinphoneCore*)lc);
448 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_acceptCall( JNIEnv* env
453 linphone_core_accept_call((LinphoneCore*)lc,(LinphoneCall*)call);
456 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCallLog( JNIEnv* env
460 return (jlong)ms_list_nth_data(linphone_core_get_call_logs((LinphoneCore*)lc),position);
462 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getNumberOfCallLogs( JNIEnv* env
465 return ms_list_size(linphone_core_get_call_logs((LinphoneCore*)lc));
467 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setNetworkStateReachable( JNIEnv* env
470 ,jboolean isReachable) {
471 linphone_core_set_network_reachable((LinphoneCore*)lc,isReachable);
474 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlaybackGain( JNIEnv* env
478 linphone_core_set_playback_gain_db((LinphoneCore*)lc,gain);
481 extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getPlaybackGain( JNIEnv* env
484 return linphone_core_get_playback_gain_db((LinphoneCore*)lc);
487 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_muteMic( JNIEnv* env
491 linphone_core_mute_mic((LinphoneCore*)lc,isMuted);
494 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_interpretUrl( JNIEnv* env
498 const char* url = env->GetStringUTFChars(jurl, NULL);
499 jlong result = (jlong)linphone_core_interpret_url((LinphoneCore*)lc,url);
500 env->ReleaseStringUTFChars(jurl, url);
503 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_sendDtmf( JNIEnv* env
507 linphone_core_send_dtmf((LinphoneCore*)lc,dtmf);
509 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_playDtmf( JNIEnv* env
514 linphone_core_play_dtmf((LinphoneCore*)lc,dtmf,duration);
516 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_stopDtmf( JNIEnv* env
519 linphone_core_stop_dtmf((LinphoneCore*)lc);
522 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearCallLogs(JNIEnv* env
525 linphone_core_clear_call_logs((LinphoneCore*)lc);
527 extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isMicMuted( JNIEnv* env
530 return linphone_core_is_mic_muted((LinphoneCore*)lc);
532 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findPayloadType(JNIEnv* env
537 const char* mime = env->GetStringUTFChars(jmime, NULL);
538 jlong result = (jlong)linphone_core_find_payload_type((LinphoneCore*)lc,mime,rate);
539 env->ReleaseStringUTFChars(jmime, mime);
542 extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_listVideoPayloadTypes(JNIEnv* env
545 const MSList* codecs = linphone_core_get_video_codecs((LinphoneCore*)lc);
546 int codecsCount = ms_list_size(codecs);
547 jlongArray jCodecs = env->NewLongArray(codecsCount);
548 jlong *jInternalArray = env->GetLongArrayElements(jCodecs, NULL);
550 for (int i = 0; i < codecsCount; i++ ) {
551 jInternalArray[i] = (unsigned long) (codecs->data);
552 codecs = codecs->next;
555 env->ReleaseLongArrayElements(jCodecs, jInternalArray, 0);
560 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEnv* env
565 return linphone_core_enable_payload_type((LinphoneCore*)lc,(PayloadType*)pt,enable);
567 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env
571 linphone_core_enable_echo_cancellation((LinphoneCore*)lc,enable);
573 extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isEchoCancellationEnabled(JNIEnv* env
577 return linphone_core_echo_cancellation_enabled((LinphoneCore*)lc);
580 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCurrentCall(JNIEnv* env
584 return (jlong)linphone_core_get_current_call((LinphoneCore*)lc);
586 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addFriend(JNIEnv* env
591 linphone_core_add_friend((LinphoneCore*)lc,(LinphoneFriend*)aFriend);
593 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPresenceInfo(JNIEnv* env
597 ,jstring jalternative_contact
599 const char* alternative_contact = jalternative_contact?env->GetStringUTFChars(jalternative_contact, NULL):NULL;
600 linphone_core_set_presence_info((LinphoneCore*)lc,minute_away,alternative_contact,(LinphoneOnlineStatus)status);
601 if (alternative_contact) env->ReleaseStringUTFChars(jalternative_contact, alternative_contact);
604 extern "C" long Java_org_linphone_core_LinphoneCoreImpl_createChatRoom(JNIEnv* env
609 const char* to = env->GetStringUTFChars(jto, NULL);
610 LinphoneChatRoom* lResult = linphone_core_create_chat_room((LinphoneCore*)lc,to);
611 env->ReleaseStringUTFChars(jto, to);
612 return (long)lResult;
615 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableVideo(JNIEnv* env
618 ,jboolean vcap_enabled
619 ,jboolean display_enabled) {
620 linphone_core_enable_video((LinphoneCore*)lc, vcap_enabled,display_enabled);
623 extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isVideoEnabled(JNIEnv* env
626 return linphone_core_video_enabled((LinphoneCore*)lc);
628 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setRing(JNIEnv* env
632 const char* path = jpath?env->GetStringUTFChars(jpath, NULL):NULL;
633 linphone_core_set_ring((LinphoneCore*)lc,path);
634 if (path) env->ReleaseStringUTFChars(jpath, path);
636 extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getRing(JNIEnv* env
640 const char* path = linphone_core_get_ring((LinphoneCore*)lc);
642 return env->NewStringUTF(path);
647 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableKeepAlive(JNIEnv* env
651 linphone_core_enable_keep_alive((LinphoneCore*)lc,enable);
654 extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isKeepAliveEnabled(JNIEnv* env
657 return linphone_core_keep_alive_enabled((LinphoneCore*)lc);
660 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNIEnv* env
664 return linphone_core_start_echo_calibration((LinphoneCore*)lc
665 , LinphoneCoreData::ecCalibrationStatus
666 , data?env->NewGlobalRef(data):NULL);
674 extern "C" jlong Java_org_linphone_core_LinphoneProxyConfigImpl_newLinphoneProxyConfig(JNIEnv* env,jobject thiz) {
675 LinphoneProxyConfig* proxy = linphone_proxy_config_new();
676 return (jlong) proxy;
679 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_delete(JNIEnv* env,jobject thiz,jlong ptr) {
680 linphone_proxy_config_destroy((LinphoneProxyConfig*)ptr);
682 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setIdentity(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jidentity) {
683 const char* identity = env->GetStringUTFChars(jidentity, NULL);
684 linphone_proxy_config_set_identity((LinphoneProxyConfig*)proxyCfg,identity);
685 env->ReleaseStringUTFChars(jidentity, identity);
687 extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getIdentity(JNIEnv* env,jobject thiz,jlong proxyCfg) {
688 const char* identity = linphone_proxy_config_get_identity((LinphoneProxyConfig*)proxyCfg);
690 return env->NewStringUTF(identity);
695 extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setProxy(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jproxy) {
696 const char* proxy = env->GetStringUTFChars(jproxy, NULL);
697 int err=linphone_proxy_config_set_server_addr((LinphoneProxyConfig*)proxyCfg,proxy);
698 env->ReleaseStringUTFChars(jproxy, proxy);
701 extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getProxy(JNIEnv* env,jobject thiz,jlong proxyCfg) {
702 const char* proxy = linphone_proxy_config_get_addr((LinphoneProxyConfig*)proxyCfg);
704 return env->NewStringUTF(proxy);
709 extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setRoute(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jroute) {
710 if (jroute != NULL) {
711 const char* route = env->GetStringUTFChars(jroute, NULL);
712 int err=linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,route);
713 env->ReleaseStringUTFChars(jroute, route);
716 return linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,NULL);
719 extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getRoute(JNIEnv* env,jobject thiz,jlong proxyCfg) {
720 const char* route = linphone_proxy_config_get_route((LinphoneProxyConfig*)proxyCfg);
722 return env->NewStringUTF(route);
728 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableRegister(JNIEnv* env,jobject thiz,jlong proxyCfg,jboolean enableRegister) {
729 linphone_proxy_config_enable_register((LinphoneProxyConfig*)proxyCfg,enableRegister);
731 extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegistered(JNIEnv* env,jobject thiz,jlong proxyCfg) {
732 return linphone_proxy_config_is_registered((LinphoneProxyConfig*)proxyCfg);
734 extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_isRegisterEnabled(JNIEnv* env,jobject thiz,jlong proxyCfg) {
735 return linphone_proxy_config_register_enabled((LinphoneProxyConfig*)proxyCfg);
737 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_edit(JNIEnv* env,jobject thiz,jlong proxyCfg) {
738 linphone_proxy_config_edit((LinphoneProxyConfig*)proxyCfg);
740 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_done(JNIEnv* env,jobject thiz,jlong proxyCfg) {
741 linphone_proxy_config_done((LinphoneProxyConfig*)proxyCfg);
743 extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_normalizePhoneNumber(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jnumber) {
745 ms_error("cannot normalized null number");
747 const char* number = env->GetStringUTFChars(jnumber, NULL);
748 int len = env->GetStringLength(jnumber);
750 ms_warning("cannot normalize empty number");
753 char targetBuff[2*len];// returned number can be greater than origin (specially in case of prefix insertion
754 linphone_proxy_config_normalize_number((LinphoneProxyConfig*)proxyCfg,number,targetBuff,sizeof(targetBuff));
755 jstring normalizedNumber = env->NewStringUTF(targetBuff);
756 env->ReleaseStringUTFChars(jnumber, number);
757 return normalizedNumber;
759 extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getDomain(JNIEnv* env
762 const char* domain = linphone_proxy_config_get_domain((LinphoneProxyConfig*)proxyCfg);
764 return env->NewStringUTF(domain);
769 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setDialEscapePlus(JNIEnv* env,jobject thiz,jlong proxyCfg,jboolean value) {
770 linphone_proxy_config_set_dial_escape_plus((LinphoneProxyConfig*)proxyCfg,value);
773 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setDialPrefix(JNIEnv* env
777 const char* prefix = env->GetStringUTFChars(jprefix, NULL);
778 linphone_proxy_config_set_dial_prefix((LinphoneProxyConfig*)proxyCfg,prefix);
779 env->ReleaseStringUTFChars(jprefix, prefix);
781 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enablePublish(JNIEnv* env
785 linphone_proxy_config_enable_publish((LinphoneProxyConfig*)proxyCfg,val);
787 extern "C" jboolean Java_org_linphone_core_LinphoneProxyConfigImpl_publishEnabled(JNIEnv* env,jobject thiz,jlong proxyCfg) {
788 return linphone_proxy_config_publish_enabled((LinphoneProxyConfig*)proxyCfg);
793 extern "C" jlong Java_org_linphone_core_LinphoneAuthInfoImpl_newLinphoneAuthInfo(JNIEnv* env
801 const char* username = env->GetStringUTFChars(jusername, NULL);
802 const char* password = env->GetStringUTFChars(jpassword, NULL);
803 jlong auth = (jlong)linphone_auth_info_new(username,NULL,password,NULL,NULL);
805 env->ReleaseStringUTFChars(jusername, username);
806 env->ReleaseStringUTFChars(jpassword, password);
810 extern "C" void Java_org_linphone_core_LinphoneAuthInfoImpl_delete(JNIEnv* env
813 linphone_auth_info_destroy((LinphoneAuthInfo*)ptr);
818 extern "C" jlong Java_org_linphone_core_LinphoneAddressImpl_newLinphoneAddressImpl(JNIEnv* env
821 ,jstring jdisplayName) {
822 const char* uri = env->GetStringUTFChars(juri, NULL);
823 LinphoneAddress* address = linphone_address_new(uri);
824 if (jdisplayName && address) {
825 const char* displayName = env->GetStringUTFChars(jdisplayName, NULL);
826 linphone_address_set_display_name(address,displayName);
827 env->ReleaseStringUTFChars(jdisplayName, displayName);
829 env->ReleaseStringUTFChars(juri, uri);
831 return (jlong) address;
833 extern "C" void Java_org_linphone_core_LinphoneAddressImpl_delete(JNIEnv* env
836 linphone_address_destroy((LinphoneAddress*)ptr);
839 extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getDisplayName(JNIEnv* env
842 const char* displayName = linphone_address_get_display_name((LinphoneAddress*)ptr);
844 return env->NewStringUTF(displayName);
849 extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getUserName(JNIEnv* env
852 const char* userName = linphone_address_get_username((LinphoneAddress*)ptr);
854 return env->NewStringUTF(userName);
859 extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_getDomain(JNIEnv* env
862 const char* domain = linphone_address_get_domain((LinphoneAddress*)ptr);
864 return env->NewStringUTF(domain);
870 extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_toString(JNIEnv* env
873 char* uri = linphone_address_as_string((LinphoneAddress*)ptr);
874 jstring juri =env->NewStringUTF(uri);
878 extern "C" jstring Java_org_linphone_core_LinphoneAddressImpl_toUri(JNIEnv* env
881 char* uri = linphone_address_as_string_uri_only((LinphoneAddress*)ptr);
882 jstring juri =env->NewStringUTF(uri);
886 extern "C" void Java_org_linphone_core_LinphoneAddressImpl_setDisplayName(JNIEnv* env
889 ,jstring jdisplayName) {
890 const char* displayName = jdisplayName!= NULL?env->GetStringUTFChars(jdisplayName, NULL):NULL;
891 linphone_address_set_display_name((LinphoneAddress*)address,displayName);
892 if (displayName != NULL) env->ReleaseStringUTFChars(jdisplayName, displayName);
897 extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getFrom(JNIEnv* env
900 return (jlong)((LinphoneCallLog*)ptr)->from;
902 extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getTo(JNIEnv* env
905 return (jlong)((LinphoneCallLog*)ptr)->to;
907 extern "C" jboolean Java_org_linphone_core_LinphoneCallLogImpl_isIncoming(JNIEnv* env
910 return ((LinphoneCallLog*)ptr)->dir==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE;
914 extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env,jobject thiz,jlong ptr) {
915 PayloadType* pt = (PayloadType*)ptr;
916 char* value = ms_strdup_printf("[%s] clock [%i], bitrate [%i]"
917 ,payload_type_get_mime(pt)
918 ,payload_type_get_rate(pt)
919 ,payload_type_get_bitrate(pt));
920 jstring jvalue =env->NewStringUTF(value);
924 extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_getMime(JNIEnv* env,jobject thiz,jlong ptr) {
925 PayloadType* pt = (PayloadType*)ptr;
926 jstring jvalue =env->NewStringUTF(payload_type_get_mime(pt));
929 extern "C" jint Java_org_linphone_core_PayloadTypeImpl_getRate(JNIEnv* env,jobject thiz, jlong ptr) {
930 PayloadType* pt = (PayloadType*)ptr;
931 return payload_type_get_rate(pt);
935 extern "C" void Java_org_linphone_core_LinphoneCallImpl_ref(JNIEnv* env
938 linphone_call_ref((LinphoneCall*)ptr);
941 extern "C" void Java_org_linphone_core_LinphoneCallImpl_unref(JNIEnv* env
944 linphone_call_unref((LinphoneCall*)ptr);
947 extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCallLog( JNIEnv* env
950 return (jlong)linphone_call_get_call_log((LinphoneCall*)ptr);
953 extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isIncoming( JNIEnv* env
956 return linphone_call_get_dir((LinphoneCall*)ptr)==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE;
959 extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getRemoteAddress( JNIEnv* env
962 return (jlong)linphone_call_get_remote_address((LinphoneCall*)ptr);
965 extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getState( JNIEnv* env
968 return (jint)linphone_call_get_state((LinphoneCall*)ptr);
970 extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoCancellation( JNIEnv* env
974 linphone_call_enable_echo_cancellation((LinphoneCall*)ptr,value);
976 extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isEchoCancellationEnabled( JNIEnv* env
979 return linphone_call_echo_cancellation_enabled((LinphoneCall*)ptr);
982 extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoLimiter( JNIEnv* env
986 linphone_call_enable_echo_limiter((LinphoneCall*)ptr,value);
988 extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_isEchoLimiterEnabled( JNIEnv* env
991 return linphone_call_echo_limiter_enabled((LinphoneCall*)ptr);
994 extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getReplacedCall( JNIEnv* env
997 return (jlong)linphone_call_get_replaced_call((LinphoneCall*)ptr);
1002 extern "C" long Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env
1004 ,jstring jFriendUri) {
1005 LinphoneFriend* lResult;
1008 const char* friendUri = env->GetStringUTFChars(jFriendUri, NULL);
1009 lResult= linphone_friend_new_with_addr(friendUri);
1010 env->ReleaseStringUTFChars(jFriendUri, friendUri);
1012 lResult = linphone_friend_new();
1014 return (long)lResult;
1016 extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setAddress(JNIEnv* env
1019 ,jlong linphoneAddress) {
1020 linphone_friend_set_addr((LinphoneFriend*)ptr,(LinphoneAddress*)linphoneAddress);
1022 extern "C" long Java_org_linphone_core_LinphoneFriendImpl_getAddress(JNIEnv* env
1025 return (long)linphone_friend_get_address((LinphoneFriend*)ptr);
1027 extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setIncSubscribePolicy(JNIEnv* env
1031 linphone_friend_set_inc_subscribe_policy((LinphoneFriend*)ptr,(LinphoneSubscribePolicy)policy);
1033 extern "C" jint Java_org_linphone_core_LinphoneFriendImpl_getIncSubscribePolicy(JNIEnv* env
1036 return linphone_friend_get_inc_subscribe_policy((LinphoneFriend*)ptr);
1038 extern "C" void Java_org_linphone_core_LinphoneFriendImpl_enableSubscribes(JNIEnv* env
1042 linphone_friend_enable_subscribes((LinphoneFriend*)ptr,value);
1044 extern "C" jboolean Java_org_linphone_core_LinphoneFriendImpl_isSubscribesEnabled(JNIEnv* env
1047 return linphone_friend_subscribes_enabled((LinphoneFriend*)ptr);
1049 extern "C" jboolean Java_org_linphone_core_LinphoneFriendImpl_getStatus(JNIEnv* env
1052 return linphone_friend_get_status((LinphoneFriend*)ptr);
1054 extern "C" void Java_org_linphone_core_LinphoneFriendImpl_edit(JNIEnv* env
1057 return linphone_friend_edit((LinphoneFriend*)ptr);
1059 extern "C" void Java_org_linphone_core_LinphoneFriendImpl_done(JNIEnv* env
1062 linphone_friend_done((LinphoneFriend*)ptr);
1065 extern "C" long Java_org_linphone_core_LinphoneChatRoomImpl_getPeerAddress(JNIEnv* env
1068 return (long) linphone_chat_room_get_peer_address((LinphoneChatRoom*)ptr);
1070 extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendMessage(JNIEnv* env
1073 ,jstring jmessage) {
1074 const char* message = env->GetStringUTFChars(jmessage, NULL);
1075 linphone_chat_room_send_message((LinphoneChatRoom*)ptr,message);
1076 env->ReleaseStringUTFChars(jmessage, message);
1080 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoWindowId(JNIEnv* env
1084 linphone_core_set_native_video_window_id((LinphoneCore*)lc,(unsigned long)obj);
1088 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc, int enum_value){
1089 linphone_core_set_firewall_policy((LinphoneCore*)lc,(LinphoneFirewallPolicy)enum_value);
1092 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc){
1093 return linphone_core_get_firewall_policy((LinphoneCore*)lc);
1096 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setStunServer(JNIEnv *env, jobject thiz, jlong lc, jstring jserver){
1097 const char* server = NULL;
1098 if (jserver) server=env->GetStringUTFChars(jserver, NULL);
1099 linphone_core_set_stun_server((LinphoneCore*)lc,server);
1100 if (server) env->ReleaseStringUTFChars(jserver,server);
1103 extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getStunServer(JNIEnv *env, jobject thiz, jlong lc){
1104 const char *ret= linphone_core_get_stun_server((LinphoneCore*)lc);
1105 if (ret==NULL) return NULL;
1106 jstring jvalue =env->NewStringUTF(ret);
1110 extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_audioBandwidth(JNIEnv *env, jobject thiz, jlong lcp, jint bw){
1111 linphone_call_params_set_audio_bandwidth_limit((LinphoneCallParams*)lcp, bw);
1114 extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableVideo(JNIEnv *env, jobject thiz, jlong lcp, jboolean b){
1115 linphone_call_params_enable_video((LinphoneCallParams*)lcp, b);
1118 extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_getVideoEnabled(JNIEnv *env, jobject thiz, jlong lcp){
1119 return linphone_call_params_video_enabled((LinphoneCallParams*)lcp);
1121 extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_destroy(JNIEnv *env, jobject thiz, jlong lc){
1122 return linphone_call_params_destroy((LinphoneCallParams*)lc);
1124 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createDefaultCallParams(JNIEnv *env, jobject thiz, jlong lc){
1125 return (jlong) linphone_core_create_default_call_parameters((LinphoneCore*)lc);
1128 extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCurrentParamsCopy(JNIEnv *env, jobject thiz, jlong lc){
1129 return (jlong) linphone_call_params_copy(linphone_call_get_current_params((LinphoneCall*)lc));
1132 extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *env, jobject thiz, jlong lc, jboolean b){
1133 linphone_call_enable_camera((LinphoneCall *)lc, (bool_t) b);
1136 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong addr, jlong params){
1137 return (jlong) linphone_core_invite_address_with_params((LinphoneCore *)lc, (const LinphoneAddress *)addr, (const LinphoneCallParams *)params);
1140 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateAddressWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong call, jlong params){
1141 return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (LinphoneCallParams *)params);
1144 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateCall(JNIEnv *env, jobject thiz, jlong lc, jlong call, jlong params){
1145 return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (const LinphoneCallParams *)params);
1149 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreferredVideoSize(JNIEnv *env, jobject thiz, jlong lc, jint width, jint height){
1151 vsize.width = (int)width;
1152 vsize.height = (int)height;
1153 linphone_core_set_preferred_video_size((LinphoneCore *)lc, vsize);
1156 extern "C" jintArray Java_org_linphone_core_LinphoneCoreImpl_getPreferredVideoSize(JNIEnv *env, jobject thiz, jlong lc){
1157 MSVideoSize vsize = linphone_core_get_preferred_video_size((LinphoneCore *)lc);
1158 jintArray arr = env->NewIntArray(2);
1159 int tVsize [2]= {vsize.width,vsize.height};
1160 env->SetIntArrayRegion(arr, 0, 2, tVsize);
1164 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDownloadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){
1165 linphone_core_set_download_bandwidth((LinphoneCore *)lc, (int) bw);
1168 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUploadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){
1169 linphone_core_set_upload_bandwidth((LinphoneCore *)lc, (int) bw);
1171 extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_getState(JNIEnv* env,jobject thiz,jlong ptr) {
1172 return (int) linphone_proxy_config_get_state((const LinphoneProxyConfig *) ptr);
1174 extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setExpires(JNIEnv* env,jobject thiz,jlong ptr,jint delay) {
1175 linphone_proxy_config_expires((LinphoneProxyConfig *) ptr, (int) delay);
1178 extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv* env,jobject thiz,jlong ptr) {
1179 linphone_call_get_duration((LinphoneCall *) ptr);
1182 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSignalingTransportPort(JNIEnv* env,jobject thiz,jlong ptr, jint code) {
1184 linphone_core_get_sip_transports((LinphoneCore *) ptr, &tr);
1197 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSignalingTransportPorts(JNIEnv* env,jobject thiz,jlong ptr,jint udp, jint tcp, jint tls) {
1198 LinphoneCore *lc = (LinphoneCore *) ptr;
1204 linphone_core_set_sip_transports(lc, &tr); // tr will be copied
1207 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableIpv6(JNIEnv* env,jobject thiz
1208 ,jlong lc, jboolean enable) {
1209 linphone_core_enable_ipv6((LinphoneCore*)lc,enable);