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.
19 package org.linphone.core;
22 import java.io.IOException;
25 class LinphoneCoreImpl implements LinphoneCore {
27 private final LinphoneCoreListener mListener; //to make sure to keep a reference on this object
28 private long nativePtr = 0;
29 private native long newLinphoneCore(LinphoneCoreListener listener,String userConfig,String factoryConfig,Object userdata);
30 private native void iterate(long nativePtr);
31 private native long getDefaultProxyConfig(long nativePtr);
33 private native void setDefaultProxyConfig(long nativePtr,long proxyCfgNativePtr);
34 private native int addProxyConfig(LinphoneProxyConfig jprtoxyCfg,long nativePtr,long proxyCfgNativePtr);
35 private native void clearAuthInfos(long nativePtr);
37 private native void clearProxyConfigs(long nativePtr);
38 private native void addAuthInfo(long nativePtr,long authInfoNativePtr);
39 private native Object invite(long nativePtr,String uri);
40 private native void terminateCall(long nativePtr, long call);
41 private native long getRemoteAddress(long nativePtr);
42 private native boolean isInCall(long nativePtr);
43 private native boolean isInComingInvitePending(long nativePtr);
44 private native void acceptCall(long nativePtr, long call);
45 private native long getCallLog(long nativePtr,int position);
46 private native int getNumberOfCallLogs(long nativePtr);
47 private native void delete(long nativePtr);
48 private native void setNetworkStateReachable(long nativePtr,boolean isReachable);
49 private native void setPlaybackGain(long nativeptr, float gain);
50 private native float getPlaybackGain(long nativeptr);
51 private native void muteMic(long nativePtr,boolean isMuted);
52 private native long interpretUrl(long nativePtr,String destination);
53 private native Object inviteAddress(long nativePtr,long to);
54 private native Object inviteAddressWithParams(long nativePtrLc,long to, long nativePtrParam);
55 private native void sendDtmf(long nativePtr,char dtmf);
56 private native void clearCallLogs(long nativePtr);
57 private native boolean isMicMuted(long nativePtr);
58 private native long findPayloadType(long nativePtr, String mime, int clockRate);
59 private native int enablePayloadType(long nativePtr, long payloadType, boolean enable);
60 private native void enableEchoCancellation(long nativePtr,boolean enable);
61 private native boolean isEchoCancellationEnabled(long nativePtr);
62 private native Object getCurrentCall(long nativePtr) ;
63 private native void playDtmf(long nativePtr,char dtmf,int duration);
64 private native void stopDtmf(long nativePtr);
65 private native void setVideoWindowId(long nativePtr, Object wid);
66 private native void setPreviewWindowId(long nativePtr, Object wid);
67 private native void setDeviceRotation(long nativePtr, int rotation);
68 private native void addFriend(long nativePtr,long friend);
69 private native void setPresenceInfo(long nativePtr,int minute_away, String alternative_contact,int status);
70 private native long createChatRoom(long nativePtr,String to);
71 private native void enableVideo(long nativePtr,boolean vcap_enabled,boolean display_enabled);
72 private native boolean isVideoEnabled(long nativePtr);
73 private native void setFirewallPolicy(long nativePtr, int enum_value);
74 private native int getFirewallPolicy(long nativePtr);
75 private native void setStunServer(long nativePtr, String stun_server);
76 private native String getStunServer(long nativePtr);
77 private native long createDefaultCallParams(long nativePtr);
78 private native int updateCall(long ptrLc, long ptrCall, long ptrParams);
79 private native void setUploadBandwidth(long nativePtr, int bw);
80 private native void setDownloadBandwidth(long nativePtr, int bw);
81 private native void setPreferredVideoSize(long nativePtr, int width, int heigth);
82 private native int[] getPreferredVideoSize(long nativePtr);
83 private native void setRing(long nativePtr, String path);
84 private native String getRing(long nativePtr);
85 private native void setRootCA(long nativePtr, String path);
86 private native long[] listVideoPayloadTypes(long nativePtr);
87 private native long[] getProxyConfigList(long nativePtr);
88 private native long[] listAudioPayloadTypes(long nativePtr);
89 private native void enableKeepAlive(long nativePtr,boolean enable);
90 private native boolean isKeepAliveEnabled(long nativePtr);
91 private native int startEchoCalibration(long nativePtr,Object data);
92 private native int getSignalingTransportPort(long nativePtr, int code);
93 private native void setSignalingTransportPorts(long nativePtr, int udp, int tcp, int tls);
94 private native void enableIpv6(long nativePtr,boolean enable);
95 private native void adjustSoftwareVolume(long nativePtr,int db);
96 private native int pauseCall(long nativePtr, long callPtr);
97 private native int pauseAllCalls(long nativePtr);
98 private native int resumeCall(long nativePtr, long callPtr);
99 private native void setUploadPtime(long nativePtr, int ptime);
100 private native void setDownloadPtime(long nativePtr, int ptime);
101 private native void setZrtpSecretsCache(long nativePtr, String file);
102 private native void enableEchoLimiter(long nativePtr2, boolean val);
103 private native int setVideoDevice(long nativePtr2, int id);
104 private native int getVideoDevice(long nativePtr2);
105 private native int getMediaEncryption(long nativePtr);
106 private native void setMediaEncryption(long nativePtr, int menc);
107 private native boolean isMediaEncryptionMandatory(long nativePtr);
108 private native void setMediaEncryptionMandatory(long nativePtr, boolean yesno);
109 private native void removeCallLog(long nativePtr, long callLogPtr);
110 private native int getMissedCallsCount(long nativePtr);
111 private native void resetMissedCallsCount(long nativePtr);
112 private native boolean isNetworkReachable(long nativePtr);
114 LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
116 nativePtr = newLinphoneCore(listener,userConfig.getCanonicalPath(),factoryConfig.getCanonicalPath(),userdata);
118 LinphoneCoreImpl(LinphoneCoreListener listener) throws IOException {
120 nativePtr = newLinphoneCore(listener,null,null,null);
123 protected void finalize() throws Throwable {
127 public synchronized void addAuthInfo(LinphoneAuthInfo info) {
129 addAuthInfo(nativePtr,((LinphoneAuthInfoImpl)info).nativePtr);
134 public synchronized LinphoneProxyConfig getDefaultProxyConfig() {
136 long lNativePtr = getDefaultProxyConfig(nativePtr);
138 return new LinphoneProxyConfigImpl(lNativePtr);
144 public synchronized LinphoneCall invite(String uri) {
146 return (LinphoneCall)invite(nativePtr,uri);
149 public synchronized void iterate() {
154 public synchronized void setDefaultProxyConfig(LinphoneProxyConfig proxyCfg) {
156 setDefaultProxyConfig(nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr);
158 public synchronized void addProxyConfig(LinphoneProxyConfig proxyCfg) throws LinphoneCoreException{
160 if (addProxyConfig(proxyCfg,nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr) !=0) {
161 throw new LinphoneCoreException("bad proxy config");
164 public synchronized void clearAuthInfos() {
166 clearAuthInfos(nativePtr);
169 public synchronized void clearProxyConfigs() {
171 clearProxyConfigs(nativePtr);
173 public synchronized void terminateCall(LinphoneCall aCall) {
175 if (aCall!=null)terminateCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr);
177 public synchronized LinphoneAddress getRemoteAddress() {
179 long ptr = getRemoteAddress(nativePtr);
183 return new LinphoneAddressImpl(ptr);
186 public synchronized boolean isIncall() {
188 return isInCall(nativePtr);
190 public synchronized boolean isInComingInvitePending() {
192 return isInComingInvitePending(nativePtr);
194 public synchronized void acceptCall(LinphoneCall aCall) {
196 acceptCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr);
199 public synchronized LinphoneCallLog[] getCallLogs() {
201 LinphoneCallLog[] logs = new LinphoneCallLog[getNumberOfCallLogs(nativePtr)];
202 for (int i=0;i < getNumberOfCallLogs(nativePtr);i++) {
203 logs[i] = new LinphoneCallLogImpl(getCallLog(nativePtr, i));
207 public synchronized void destroy() {
213 private void isValid() {
214 if (nativePtr == 0) {
215 throw new RuntimeException("object already destroyed");
218 public synchronized void setNetworkReachable(boolean isReachable) {
219 setNetworkStateReachable(nativePtr,isReachable);
221 public synchronized void setPlaybackGain(float gain) {
222 setPlaybackGain(nativePtr,gain);
225 public synchronized float getPlaybackGain() {
226 return getPlaybackGain(nativePtr);
228 public synchronized void muteMic(boolean isMuted) {
229 muteMic(nativePtr,isMuted);
231 public synchronized LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException {
232 long lAddress = interpretUrl(nativePtr,destination);
234 return new LinphoneAddressImpl(lAddress,true);
236 throw new LinphoneCoreException("Cannot interpret ["+destination+"]");
239 public synchronized LinphoneCall invite(LinphoneAddress to) throws LinphoneCoreException {
240 LinphoneCall call = (LinphoneCall)inviteAddress(nativePtr,((LinphoneAddressImpl)to).nativePtr);
244 throw new LinphoneCoreException("Unable to invite address " + to.asString());
248 public synchronized void sendDtmf(char number) {
249 sendDtmf(nativePtr,number);
251 public synchronized void clearCallLogs() {
252 clearCallLogs(nativePtr);
254 public synchronized boolean isMicMuted() {
255 return isMicMuted(nativePtr);
257 public synchronized PayloadType findPayloadType(String mime, int clockRate) {
259 long playLoadType = findPayloadType(nativePtr, mime, clockRate);
260 if (playLoadType == 0) {
263 return new PayloadTypeImpl(playLoadType);
266 public synchronized void enablePayloadType(PayloadType pt, boolean enable)
267 throws LinphoneCoreException {
269 if (enablePayloadType(nativePtr,((PayloadTypeImpl)pt).nativePtr,enable) != 0) {
270 throw new LinphoneCoreException("cannot enable payload type ["+pt+"]");
274 public synchronized void enableEchoCancellation(boolean enable) {
276 enableEchoCancellation(nativePtr, enable);
278 public synchronized boolean isEchoCancellationEnabled() {
280 return isEchoCancellationEnabled(nativePtr);
284 public synchronized LinphoneCall getCurrentCall() {
286 return (LinphoneCall)getCurrentCall(nativePtr);
289 public int getPlayLevel() {
290 // TODO Auto-generated method stub
293 public void setPlayLevel(int level) {
294 // TODO Auto-generated method stub
297 public void enableSpeaker(boolean value) {
298 // TODO Auto-generated method stub
301 public boolean isSpeakerEnabled() {
302 // TODO Auto-generated method stub
305 public synchronized void playDtmf(char number, int duration) {
306 playDtmf(nativePtr,number, duration);
309 public synchronized void stopDtmf() {
313 public synchronized void addFriend(LinphoneFriend lf) throws LinphoneCoreException {
314 addFriend(nativePtr,((LinphoneFriendImpl)lf).nativePtr);
317 public synchronized void setPresenceInfo(int minute_away, String alternative_contact,
318 OnlineStatus status) {
319 setPresenceInfo(nativePtr,minute_away,alternative_contact,status.mValue);
322 public synchronized LinphoneChatRoom createChatRoom(String to) {
323 return new LinphoneChatRoomImpl(createChatRoom(nativePtr,to));
325 public synchronized void setPreviewWindow(Object w) {
326 setPreviewWindowId(nativePtr,w);
328 public synchronized void setVideoWindow(Object w) {
329 setVideoWindowId(nativePtr, w);
331 public synchronized void setDeviceRotation(int rotation) {
332 setDeviceRotation(nativePtr, rotation);
335 public synchronized void enableVideo(boolean vcap_enabled, boolean display_enabled) {
336 enableVideo(nativePtr,vcap_enabled, display_enabled);
338 public synchronized boolean isVideoEnabled() {
339 return isVideoEnabled(nativePtr);
341 public synchronized FirewallPolicy getFirewallPolicy() {
342 return FirewallPolicy.fromInt(getFirewallPolicy(nativePtr));
344 public synchronized String getStunServer() {
345 return getStunServer(nativePtr);
347 public synchronized void setFirewallPolicy(FirewallPolicy pol) {
348 setFirewallPolicy(nativePtr,pol.value());
350 public synchronized void setStunServer(String stunServer) {
351 setStunServer(nativePtr,stunServer);
354 public synchronized LinphoneCallParams createDefaultCallParameters() {
355 return new LinphoneCallParamsImpl(createDefaultCallParams(nativePtr));
358 public synchronized LinphoneCall inviteAddressWithParams(LinphoneAddress to, LinphoneCallParams params) throws LinphoneCoreException {
359 long ptrDestination = ((LinphoneAddressImpl)to).nativePtr;
360 long ptrParams =((LinphoneCallParamsImpl)params).nativePtr;
362 LinphoneCall call = (LinphoneCall)inviteAddressWithParams(nativePtr, ptrDestination, ptrParams);
366 throw new LinphoneCoreException("Unable to invite with params " + to.asString());
370 public synchronized int updateCall(LinphoneCall call, LinphoneCallParams params) {
371 long ptrCall = ((LinphoneCallImpl) call).nativePtr;
372 long ptrParams = params!=null ? ((LinphoneCallParamsImpl)params).nativePtr : 0;
374 return updateCall(nativePtr, ptrCall, ptrParams);
376 public synchronized void setUploadBandwidth(int bw) {
377 setUploadBandwidth(nativePtr, bw);
380 public synchronized void setDownloadBandwidth(int bw) {
381 setDownloadBandwidth(nativePtr, bw);
384 public synchronized void setPreferredVideoSize(VideoSize vSize) {
385 setPreferredVideoSize(nativePtr, vSize.width, vSize.height);
388 public synchronized VideoSize getPreferredVideoSize() {
389 int[] nativeSize = getPreferredVideoSize(nativePtr);
391 VideoSize vSize = new VideoSize();
392 vSize.width = nativeSize[0];
393 vSize.height = nativeSize[1];
396 public synchronized void setRing(String path) {
397 setRing(nativePtr, path);
399 public synchronized String getRing() {
400 return getRing(nativePtr);
403 public synchronized void setRootCA(String path) {
404 setRootCA(nativePtr, path);
407 public synchronized LinphoneProxyConfig[] getProxyConfigList() {
408 long[] typesPtr = getProxyConfigList(nativePtr);
409 if (typesPtr == null) return null;
411 LinphoneProxyConfig[] proxies = new LinphoneProxyConfig[typesPtr.length];
413 for (int i=0; i < proxies.length; i++) {
414 proxies[i] = new LinphoneProxyConfigImpl(typesPtr[i]);
420 public synchronized PayloadType[] getVideoCodecs() {
421 long[] typesPtr = listVideoPayloadTypes(nativePtr);
422 if (typesPtr == null) return null;
424 PayloadType[] codecs = new PayloadType[typesPtr.length];
426 for (int i=0; i < codecs.length; i++) {
427 codecs[i] = new PayloadTypeImpl(typesPtr[i]);
432 public synchronized PayloadType[] getAudioCodecs() {
433 long[] typesPtr = listAudioPayloadTypes(nativePtr);
434 if (typesPtr == null) return null;
436 PayloadType[] codecs = new PayloadType[typesPtr.length];
438 for (int i=0; i < codecs.length; i++) {
439 codecs[i] = new PayloadTypeImpl(typesPtr[i]);
444 public synchronized boolean isNetworkReachable() {
445 return isNetworkReachable(nativePtr);
447 public synchronized void enableKeepAlive(boolean enable) {
448 enableKeepAlive(nativePtr,enable);
451 public synchronized boolean isKeepAliveEnabled() {
452 return isKeepAliveEnabled(nativePtr);
454 public synchronized void startEchoCalibration(Object data) throws LinphoneCoreException {
455 startEchoCalibration(nativePtr, data);
458 public synchronized Transports getSignalingTransportPorts() {
459 Transports transports = new Transports();
460 transports.udp = getSignalingTransportPort(nativePtr, 0);
461 transports.tcp = getSignalingTransportPort(nativePtr, 1);
462 transports.tls = getSignalingTransportPort(nativePtr, 3);
463 // See C struct LCSipTransports in linphonecore.h
464 // Code is the index in the structure
467 public synchronized void setSignalingTransportPorts(Transports transports) {
468 setSignalingTransportPorts(nativePtr, transports.udp, transports.tcp, transports.tls);
471 public synchronized void enableIpv6(boolean enable) {
472 enableIpv6(nativePtr,enable);
474 public synchronized void adjustSoftwareVolume(int i) {
475 adjustSoftwareVolume(nativePtr, i);
478 public synchronized boolean pauseCall(LinphoneCall call) {
479 return 0 == pauseCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
481 public synchronized boolean resumeCall(LinphoneCall call) {
482 return 0 == resumeCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
484 public synchronized boolean pauseAllCalls() {
485 return 0 == pauseAllCalls(nativePtr);
487 public synchronized void setDownloadPtime(int ptime) {
488 setDownloadPtime(nativePtr,ptime);
491 public synchronized void setUploadPtime(int ptime) {
492 setUploadPtime(nativePtr,ptime);
495 public synchronized void setZrtpSecretsCache(String file) {
496 setZrtpSecretsCache(nativePtr,file);
498 public synchronized void enableEchoLimiter(boolean val) {
499 enableEchoLimiter(nativePtr,val);
501 public void setVideoDevice(int id) {
502 Log.i("Setting camera id :", id);
503 if (setVideoDevice(nativePtr, id) != 0) {
504 Log.e("Failed to set video device to id:", id);
507 public int getVideoDevice() {
508 return getVideoDevice(nativePtr);
512 private native void leaveConference(long nativePtr);
513 public synchronized void leaveConference() {
514 leaveConference(nativePtr);
517 private native boolean enterConference(long nativePtr);
518 public synchronized boolean enterConference() {
519 return enterConference(nativePtr);
522 private native boolean isInConference(long nativePtr);
523 public synchronized boolean isInConference() {
524 return isInConference(nativePtr);
527 private native void terminateConference(long nativePtr);
528 public synchronized void terminateConference() {
529 terminateConference(nativePtr);
531 private native int getConferenceSize(long nativePtr);
532 public synchronized int getConferenceSize() {
533 return getConferenceSize(nativePtr);
535 private native int getCallsNb(long nativePtr);
536 public synchronized int getCallsNb() {
537 return getCallsNb(nativePtr);
539 private native void terminateAllCalls(long nativePtr);
540 public synchronized void terminateAllCalls() {
541 terminateAllCalls(nativePtr);
543 private native Object getCall(long nativePtr, int position);
544 public synchronized LinphoneCall[] getCalls() {
545 int size = getCallsNb(nativePtr);
546 LinphoneCall[] calls = new LinphoneCall[size];
547 for (int i=0; i < size; i++) {
548 calls[i]=((LinphoneCall)getCall(nativePtr, i));
552 private native void addAllToConference(long nativePtr);
553 public synchronized void addAllToConference() {
554 addAllToConference(nativePtr);
557 private native void addToConference(long nativePtr, long nativePtrLcall);
558 public synchronized void addToConference(LinphoneCall call) {
559 addToConference(nativePtr, getCallPtr(call));
562 private native void removeFromConference(long nativePtr, long nativeCallPtr);
563 public synchronized void removeFromConference(LinphoneCall call) {
564 removeFromConference(nativePtr,getCallPtr(call));
567 private long getCallPtr(LinphoneCall call) {
568 return ((LinphoneCallImpl)call).nativePtr;
571 private long getCallParamsPtr(LinphoneCallParams callParams) {
572 return ((LinphoneCallParamsImpl)callParams).nativePtr;
575 private native int transferCall(long nativePtr, long callPtr, String referTo);
576 public synchronized void transferCall(LinphoneCall call, String referTo) {
577 transferCall(nativePtr, getCallPtr(call), referTo);
580 private native int transferCallToAnother(long nativePtr, long callPtr, long destPtr);
581 public synchronized void transferCallToAnother(LinphoneCall call, LinphoneCall dest) {
582 transferCallToAnother(nativePtr, getCallPtr(call), getCallPtr(dest));
585 private native Object findCallFromUri(long nativePtr, String uri);
587 public synchronized LinphoneCall findCallFromUri(String uri) {
588 return (LinphoneCall) findCallFromUri(nativePtr, uri);
591 public synchronized MediaEncryption getMediaEncryption() {
592 return MediaEncryption.fromInt(getMediaEncryption(nativePtr));
594 public synchronized boolean isMediaEncryptionMandatory() {
595 return isMediaEncryptionMandatory(nativePtr);
597 public synchronized void setMediaEncryption(MediaEncryption menc) {
598 setMediaEncryption(nativePtr, menc.mValue);
600 public synchronized void setMediaEncryptionMandatory(boolean yesno) {
601 setMediaEncryptionMandatory(nativePtr, yesno);
604 private native int getMaxCalls(long nativePtr);
605 public synchronized int getMaxCalls() {
606 return getMaxCalls(nativePtr);
609 public boolean isMyself(String uri) {
610 LinphoneProxyConfig lpc = getDefaultProxyConfig();
611 if (lpc == null) return false;
612 return uri.equals(lpc.getIdentity());
615 private native boolean soundResourcesLocked(long nativePtr);
616 public synchronized boolean soundResourcesLocked() {
617 return soundResourcesLocked(nativePtr);
620 private native void setMaxCalls(long nativePtr, int max);
622 public synchronized void setMaxCalls(int max) {
623 setMaxCalls(nativePtr, max);
625 private native boolean isEchoLimiterEnabled(long nativePtr);
627 public synchronized boolean isEchoLimiterEnabled() {
628 return isEchoLimiterEnabled(nativePtr);
630 private native boolean mediaEncryptionSupported(long nativePtr, int menc);
632 public synchronized boolean mediaEncryptionSupported(MediaEncryption menc) {
633 return mediaEncryptionSupported(nativePtr,menc.mValue);
636 private native void setPlayFile(long nativePtr, String path);
639 public synchronized void setPlayFile(String path) {
640 setPlayFile(nativePtr, path);
644 private native void tunnelAddServerAndMirror(long nativePtr, String host, int port, int mirror, int ms);
646 public synchronized void tunnelAddServerAndMirror(String host, int port, int mirror, int ms) {
647 tunnelAddServerAndMirror(nativePtr, host, port, mirror, ms);
650 private native void tunnelAutoDetect(long nativePtr);
652 public synchronized void tunnelAutoDetect() {
653 tunnelAutoDetect(nativePtr);
656 private native void tunnelCleanServers(long nativePtr);
658 public synchronized void tunnelCleanServers() {
659 tunnelCleanServers(nativePtr);
662 private native void tunnelEnable(long nativePtr, boolean enable);
664 public synchronized void tunnelEnable(boolean enable) {
665 tunnelEnable(nativePtr, enable);
669 public native boolean isTunnelAvailable();
671 private native void acceptCallWithParams(long nativePtr, long aCall,
674 public synchronized void acceptCallWithParams(LinphoneCall aCall,
675 LinphoneCallParams params) throws LinphoneCoreException {
676 acceptCallWithParams(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
679 private native void acceptCallUpdate(long nativePtr, long aCall, long params);
681 public synchronized void acceptCallUpdate(LinphoneCall aCall, LinphoneCallParams params)
682 throws LinphoneCoreException {
683 acceptCallUpdate(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
686 private native void deferCallUpdate(long nativePtr, long aCall);
688 public synchronized void deferCallUpdate(LinphoneCall aCall)
689 throws LinphoneCoreException {
690 deferCallUpdate(nativePtr, getCallPtr(aCall));
693 private native void setVideoPolicy(long nativePtr, boolean autoInitiate, boolean autoAccept);
694 public synchronized void setVideoPolicy(boolean autoInitiate, boolean autoAccept) {
695 setVideoPolicy(nativePtr, autoInitiate, autoAccept);
697 private native void setUserAgent(long nativePtr, String name, String version);
699 public void setUserAgent(String name, String version) {
700 setUserAgent(nativePtr,name,version);
703 private native void setCpuCountNative(int count);
704 public void setCpuCount(int count)
706 setCpuCountNative(count);
709 public int getMissedCallsCount() {
710 return getMissedCallsCount(nativePtr);
713 public void removeCallLog(LinphoneCallLog log) {
714 removeCallLog(nativePtr, ((LinphoneCallLogImpl) log).getNativePtr());
717 public void resetMissedCallsCount() {
718 resetMissedCallsCount(nativePtr);
721 private native void tunnelSetHttpProxy(long nativePtr, String proxy_host, int port,
722 String username, String password);
724 public void tunnelSetHttpProxy(String proxy_host, int port,
725 String username, String password) {
726 tunnelSetHttpProxy(nativePtr, proxy_host, port, username, password);
729 private native void refreshRegisters(long nativePtr);
730 public void refreshRegisters() {
731 refreshRegisters(nativePtr);