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 boolean isNetworkStateReachable(long nativePtr);
50 private native void setPlaybackGain(long nativeptr, float gain);
51 private native float getPlaybackGain(long nativeptr);
52 private native void muteMic(long nativePtr,boolean isMuted);
53 private native long interpretUrl(long nativePtr,String destination);
54 private native Object inviteAddress(long nativePtr,long to);
55 private native Object inviteAddressWithParams(long nativePtrLc,long to, long nativePtrParam);
56 private native void sendDtmf(long nativePtr,char dtmf);
57 private native void clearCallLogs(long nativePtr);
58 private native boolean isMicMuted(long nativePtr);
59 private native long findPayloadType(long nativePtr, String mime, int clockRate, int channels);
60 private native int enablePayloadType(long nativePtr, long payloadType, boolean enable);
61 private native void enableEchoCancellation(long nativePtr,boolean enable);
62 private native boolean isEchoCancellationEnabled(long nativePtr);
63 private native Object getCurrentCall(long nativePtr) ;
64 private native void playDtmf(long nativePtr,char dtmf,int duration);
65 private native void stopDtmf(long nativePtr);
66 private native void setVideoWindowId(long nativePtr, Object wid);
67 private native void setPreviewWindowId(long nativePtr, Object wid);
68 private native void setDeviceRotation(long nativePtr, int rotation);
69 private native void addFriend(long nativePtr,long friend);
70 private native void setPresenceInfo(long nativePtr,int minute_away, String alternative_contact,int status);
71 private native long createChatRoom(long nativePtr,String to);
72 private native void enableVideo(long nativePtr,boolean vcap_enabled,boolean display_enabled);
73 private native boolean isVideoEnabled(long nativePtr);
74 private native void setFirewallPolicy(long nativePtr, int enum_value);
75 private native int getFirewallPolicy(long nativePtr);
76 private native void setStunServer(long nativePtr, String stun_server);
77 private native String getStunServer(long nativePtr);
78 private native long createDefaultCallParams(long nativePtr);
79 private native int updateCall(long ptrLc, long ptrCall, long ptrParams);
80 private native void setUploadBandwidth(long nativePtr, int bw);
81 private native void setDownloadBandwidth(long nativePtr, int bw);
82 private native void setPreferredVideoSize(long nativePtr, int width, int heigth);
83 private native int[] getPreferredVideoSize(long nativePtr);
84 private native void setRing(long nativePtr, String path);
85 private native String getRing(long nativePtr);
86 private native void setRootCA(long nativePtr, String path);
87 private native long[] listVideoPayloadTypes(long nativePtr);
88 private native long[] getProxyConfigList(long nativePtr);
89 private native long[] listAudioPayloadTypes(long nativePtr);
90 private native void enableKeepAlive(long nativePtr,boolean enable);
91 private native boolean isKeepAliveEnabled(long nativePtr);
92 private native int startEchoCalibration(long nativePtr,Object data);
93 private native int getSignalingTransportPort(long nativePtr, int code);
94 private native void setSignalingTransportPorts(long nativePtr, int udp, int tcp, int tls);
95 private native void enableIpv6(long nativePtr,boolean enable);
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 String getVersion(long nativePtr);
113 private native void setAudioPort(long nativePtr, int port);
114 private native void setVideoPort(long nativePtr, int port);
115 private native void setAudioPortRange(long nativePtr, int minPort, int maxPort);
116 private native void setVideoPortRange(long nativePtr, int minPort, int maxPort);
117 private native void setIncomingTimeout(long nativePtr, int timeout);
118 private native void setInCallTimeout(long nativePtr, int timeout);
120 LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
122 nativePtr = newLinphoneCore(listener,userConfig.getCanonicalPath(),factoryConfig.getCanonicalPath(),userdata);
124 LinphoneCoreImpl(LinphoneCoreListener listener) throws IOException {
126 nativePtr = newLinphoneCore(listener,null,null,null);
129 protected void finalize() throws Throwable {
133 public synchronized void addAuthInfo(LinphoneAuthInfo info) {
135 addAuthInfo(nativePtr,((LinphoneAuthInfoImpl)info).nativePtr);
140 public synchronized LinphoneProxyConfig getDefaultProxyConfig() {
142 long lNativePtr = getDefaultProxyConfig(nativePtr);
144 return new LinphoneProxyConfigImpl(lNativePtr);
150 public synchronized LinphoneCall invite(String uri) {
152 return (LinphoneCall)invite(nativePtr,uri);
155 public synchronized void iterate() {
160 public synchronized void setDefaultProxyConfig(LinphoneProxyConfig proxyCfg) {
162 setDefaultProxyConfig(nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr);
164 public synchronized void addProxyConfig(LinphoneProxyConfig proxyCfg) throws LinphoneCoreException{
166 if (addProxyConfig(proxyCfg,nativePtr,((LinphoneProxyConfigImpl)proxyCfg).nativePtr) !=0) {
167 throw new LinphoneCoreException("bad proxy config");
170 public synchronized void clearAuthInfos() {
172 clearAuthInfos(nativePtr);
175 public synchronized void clearProxyConfigs() {
177 clearProxyConfigs(nativePtr);
179 public synchronized void terminateCall(LinphoneCall aCall) {
181 if (aCall!=null)terminateCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr);
183 public synchronized LinphoneAddress getRemoteAddress() {
185 long ptr = getRemoteAddress(nativePtr);
189 return new LinphoneAddressImpl(ptr);
192 public synchronized boolean isIncall() {
194 return isInCall(nativePtr);
196 public synchronized boolean isInComingInvitePending() {
198 return isInComingInvitePending(nativePtr);
200 public synchronized void acceptCall(LinphoneCall aCall) {
202 acceptCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr);
205 public synchronized LinphoneCallLog[] getCallLogs() {
207 LinphoneCallLog[] logs = new LinphoneCallLog[getNumberOfCallLogs(nativePtr)];
208 for (int i=0;i < getNumberOfCallLogs(nativePtr);i++) {
209 logs[i] = new LinphoneCallLogImpl(getCallLog(nativePtr, i));
213 public synchronized void destroy() {
219 private void isValid() {
220 if (nativePtr == 0) {
221 throw new RuntimeException("object already destroyed");
224 public synchronized void setNetworkReachable(boolean isReachable) {
225 setNetworkStateReachable(nativePtr,isReachable);
227 public synchronized void setPlaybackGain(float gain) {
228 setPlaybackGain(nativePtr,gain);
231 public synchronized float getPlaybackGain() {
232 return getPlaybackGain(nativePtr);
234 public synchronized void muteMic(boolean isMuted) {
235 muteMic(nativePtr,isMuted);
237 public synchronized LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException {
238 long lAddress = interpretUrl(nativePtr,destination);
240 return new LinphoneAddressImpl(lAddress,true);
242 throw new LinphoneCoreException("Cannot interpret ["+destination+"]");
245 public synchronized LinphoneCall invite(LinphoneAddress to) throws LinphoneCoreException {
246 LinphoneCall call = (LinphoneCall)inviteAddress(nativePtr,((LinphoneAddressImpl)to).nativePtr);
250 throw new LinphoneCoreException("Unable to invite address " + to.asString());
254 public synchronized void sendDtmf(char number) {
255 sendDtmf(nativePtr,number);
257 public synchronized void clearCallLogs() {
258 clearCallLogs(nativePtr);
260 public synchronized boolean isMicMuted() {
261 return isMicMuted(nativePtr);
263 public synchronized PayloadType findPayloadType(String mime, int clockRate, int channels) {
265 long playLoadType = findPayloadType(nativePtr, mime, clockRate, channels);
266 if (playLoadType == 0) {
269 return new PayloadTypeImpl(playLoadType);
272 public synchronized void enablePayloadType(PayloadType pt, boolean enable)
273 throws LinphoneCoreException {
275 if (enablePayloadType(nativePtr,((PayloadTypeImpl)pt).nativePtr,enable) != 0) {
276 throw new LinphoneCoreException("cannot enable payload type ["+pt+"]");
280 public synchronized void enableEchoCancellation(boolean enable) {
282 enableEchoCancellation(nativePtr, enable);
284 public synchronized boolean isEchoCancellationEnabled() {
286 return isEchoCancellationEnabled(nativePtr);
290 public synchronized LinphoneCall getCurrentCall() {
292 return (LinphoneCall)getCurrentCall(nativePtr);
295 public int getPlayLevel() {
296 // TODO Auto-generated method stub
299 public void setPlayLevel(int level) {
300 // TODO Auto-generated method stub
303 public void enableSpeaker(boolean value) {
304 // TODO Auto-generated method stub
307 public boolean isSpeakerEnabled() {
308 // TODO Auto-generated method stub
311 public synchronized void playDtmf(char number, int duration) {
312 playDtmf(nativePtr,number, duration);
315 public synchronized void stopDtmf() {
319 public synchronized void addFriend(LinphoneFriend lf) throws LinphoneCoreException {
320 addFriend(nativePtr,((LinphoneFriendImpl)lf).nativePtr);
323 public synchronized void setPresenceInfo(int minute_away, String alternative_contact,
324 OnlineStatus status) {
325 setPresenceInfo(nativePtr,minute_away,alternative_contact,status.mValue);
328 public synchronized LinphoneChatRoom createChatRoom(String to) {
329 return new LinphoneChatRoomImpl(createChatRoom(nativePtr,to));
331 public synchronized void setPreviewWindow(Object w) {
332 setPreviewWindowId(nativePtr,w);
334 public synchronized void setVideoWindow(Object w) {
335 setVideoWindowId(nativePtr, w);
337 public synchronized void setDeviceRotation(int rotation) {
338 setDeviceRotation(nativePtr, rotation);
341 public synchronized void enableVideo(boolean vcap_enabled, boolean display_enabled) {
342 enableVideo(nativePtr,vcap_enabled, display_enabled);
344 public synchronized boolean isVideoEnabled() {
345 return isVideoEnabled(nativePtr);
347 public synchronized FirewallPolicy getFirewallPolicy() {
348 return FirewallPolicy.fromInt(getFirewallPolicy(nativePtr));
350 public synchronized String getStunServer() {
351 return getStunServer(nativePtr);
353 public synchronized void setFirewallPolicy(FirewallPolicy pol) {
354 setFirewallPolicy(nativePtr,pol.value());
356 public synchronized void setStunServer(String stunServer) {
357 setStunServer(nativePtr,stunServer);
360 public synchronized LinphoneCallParams createDefaultCallParameters() {
361 return new LinphoneCallParamsImpl(createDefaultCallParams(nativePtr));
364 public synchronized LinphoneCall inviteAddressWithParams(LinphoneAddress to, LinphoneCallParams params) throws LinphoneCoreException {
365 long ptrDestination = ((LinphoneAddressImpl)to).nativePtr;
366 long ptrParams =((LinphoneCallParamsImpl)params).nativePtr;
368 LinphoneCall call = (LinphoneCall)inviteAddressWithParams(nativePtr, ptrDestination, ptrParams);
372 throw new LinphoneCoreException("Unable to invite with params " + to.asString());
376 public synchronized int updateCall(LinphoneCall call, LinphoneCallParams params) {
377 long ptrCall = ((LinphoneCallImpl) call).nativePtr;
378 long ptrParams = params!=null ? ((LinphoneCallParamsImpl)params).nativePtr : 0;
380 return updateCall(nativePtr, ptrCall, ptrParams);
382 public synchronized void setUploadBandwidth(int bw) {
383 setUploadBandwidth(nativePtr, bw);
386 public synchronized void setDownloadBandwidth(int bw) {
387 setDownloadBandwidth(nativePtr, bw);
390 public synchronized void setPreferredVideoSize(VideoSize vSize) {
391 setPreferredVideoSize(nativePtr, vSize.width, vSize.height);
394 public synchronized VideoSize getPreferredVideoSize() {
395 int[] nativeSize = getPreferredVideoSize(nativePtr);
397 VideoSize vSize = new VideoSize();
398 vSize.width = nativeSize[0];
399 vSize.height = nativeSize[1];
402 public synchronized void setRing(String path) {
403 setRing(nativePtr, path);
405 public synchronized String getRing() {
406 return getRing(nativePtr);
409 public synchronized void setRootCA(String path) {
410 setRootCA(nativePtr, path);
413 public synchronized LinphoneProxyConfig[] getProxyConfigList() {
414 long[] typesPtr = getProxyConfigList(nativePtr);
415 if (typesPtr == null) return null;
417 LinphoneProxyConfig[] proxies = new LinphoneProxyConfig[typesPtr.length];
419 for (int i=0; i < proxies.length; i++) {
420 proxies[i] = new LinphoneProxyConfigImpl(typesPtr[i]);
426 public synchronized PayloadType[] getVideoCodecs() {
427 long[] typesPtr = listVideoPayloadTypes(nativePtr);
428 if (typesPtr == null) return null;
430 PayloadType[] codecs = new PayloadType[typesPtr.length];
432 for (int i=0; i < codecs.length; i++) {
433 codecs[i] = new PayloadTypeImpl(typesPtr[i]);
438 public synchronized PayloadType[] getAudioCodecs() {
439 long[] typesPtr = listAudioPayloadTypes(nativePtr);
440 if (typesPtr == null) return null;
442 PayloadType[] codecs = new PayloadType[typesPtr.length];
444 for (int i=0; i < codecs.length; i++) {
445 codecs[i] = new PayloadTypeImpl(typesPtr[i]);
450 public synchronized boolean isNetworkReachable() {
451 return isNetworkStateReachable(nativePtr);
454 public synchronized void enableKeepAlive(boolean enable) {
455 enableKeepAlive(nativePtr,enable);
458 public synchronized boolean isKeepAliveEnabled() {
459 return isKeepAliveEnabled(nativePtr);
461 public synchronized void startEchoCalibration(Object data) throws LinphoneCoreException {
462 startEchoCalibration(nativePtr, data);
465 public synchronized Transports getSignalingTransportPorts() {
466 Transports transports = new Transports();
467 transports.udp = getSignalingTransportPort(nativePtr, 0);
468 transports.tcp = getSignalingTransportPort(nativePtr, 1);
469 transports.tls = getSignalingTransportPort(nativePtr, 3);
470 // See C struct LCSipTransports in linphonecore.h
471 // Code is the index in the structure
474 public synchronized void setSignalingTransportPorts(Transports transports) {
475 setSignalingTransportPorts(nativePtr, transports.udp, transports.tcp, transports.tls);
478 public synchronized void enableIpv6(boolean enable) {
479 enableIpv6(nativePtr,enable);
481 public synchronized void adjustSoftwareVolume(int i) {
482 //deprecated, does the same as setPlaybackGain().
485 public synchronized boolean pauseCall(LinphoneCall call) {
486 return 0 == pauseCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
488 public synchronized boolean resumeCall(LinphoneCall call) {
489 return 0 == resumeCall(nativePtr, ((LinphoneCallImpl) call).nativePtr);
491 public synchronized boolean pauseAllCalls() {
492 return 0 == pauseAllCalls(nativePtr);
494 public synchronized void setDownloadPtime(int ptime) {
495 setDownloadPtime(nativePtr,ptime);
498 public synchronized void setUploadPtime(int ptime) {
499 setUploadPtime(nativePtr,ptime);
502 public synchronized void setZrtpSecretsCache(String file) {
503 setZrtpSecretsCache(nativePtr,file);
505 public synchronized void enableEchoLimiter(boolean val) {
506 enableEchoLimiter(nativePtr,val);
508 public void setVideoDevice(int id) {
509 Log.i("Setting camera id :", id);
510 if (setVideoDevice(nativePtr, id) != 0) {
511 Log.e("Failed to set video device to id:", id);
514 public int getVideoDevice() {
515 return getVideoDevice(nativePtr);
519 private native void leaveConference(long nativePtr);
520 public synchronized void leaveConference() {
521 leaveConference(nativePtr);
524 private native boolean enterConference(long nativePtr);
525 public synchronized boolean enterConference() {
526 return enterConference(nativePtr);
529 private native boolean isInConference(long nativePtr);
530 public synchronized boolean isInConference() {
531 return isInConference(nativePtr);
534 private native void terminateConference(long nativePtr);
535 public synchronized void terminateConference() {
536 terminateConference(nativePtr);
538 private native int getConferenceSize(long nativePtr);
539 public synchronized int getConferenceSize() {
540 return getConferenceSize(nativePtr);
542 private native int getCallsNb(long nativePtr);
543 public synchronized int getCallsNb() {
544 return getCallsNb(nativePtr);
546 private native void terminateAllCalls(long nativePtr);
547 public synchronized void terminateAllCalls() {
548 terminateAllCalls(nativePtr);
550 private native Object getCall(long nativePtr, int position);
551 public synchronized LinphoneCall[] getCalls() {
552 int size = getCallsNb(nativePtr);
553 LinphoneCall[] calls = new LinphoneCall[size];
554 for (int i=0; i < size; i++) {
555 calls[i]=((LinphoneCall)getCall(nativePtr, i));
559 private native void addAllToConference(long nativePtr);
560 public synchronized void addAllToConference() {
561 addAllToConference(nativePtr);
564 private native void addToConference(long nativePtr, long nativePtrLcall);
565 public synchronized void addToConference(LinphoneCall call) {
566 addToConference(nativePtr, getCallPtr(call));
569 private native void removeFromConference(long nativePtr, long nativeCallPtr);
570 public synchronized void removeFromConference(LinphoneCall call) {
571 removeFromConference(nativePtr,getCallPtr(call));
574 private long getCallPtr(LinphoneCall call) {
575 return ((LinphoneCallImpl)call).nativePtr;
578 private long getCallParamsPtr(LinphoneCallParams callParams) {
579 return ((LinphoneCallParamsImpl)callParams).nativePtr;
582 private native int transferCall(long nativePtr, long callPtr, String referTo);
583 public synchronized void transferCall(LinphoneCall call, String referTo) {
584 transferCall(nativePtr, getCallPtr(call), referTo);
587 private native int transferCallToAnother(long nativePtr, long callPtr, long destPtr);
588 public synchronized void transferCallToAnother(LinphoneCall call, LinphoneCall dest) {
589 transferCallToAnother(nativePtr, getCallPtr(call), getCallPtr(dest));
592 private native Object findCallFromUri(long nativePtr, String uri);
594 public synchronized LinphoneCall findCallFromUri(String uri) {
595 return (LinphoneCall) findCallFromUri(nativePtr, uri);
598 public synchronized MediaEncryption getMediaEncryption() {
599 return MediaEncryption.fromInt(getMediaEncryption(nativePtr));
601 public synchronized boolean isMediaEncryptionMandatory() {
602 return isMediaEncryptionMandatory(nativePtr);
604 public synchronized void setMediaEncryption(MediaEncryption menc) {
605 setMediaEncryption(nativePtr, menc.mValue);
607 public synchronized void setMediaEncryptionMandatory(boolean yesno) {
608 setMediaEncryptionMandatory(nativePtr, yesno);
611 private native int getMaxCalls(long nativePtr);
612 public synchronized int getMaxCalls() {
613 return getMaxCalls(nativePtr);
616 public boolean isMyself(String uri) {
617 LinphoneProxyConfig lpc = getDefaultProxyConfig();
618 if (lpc == null) return false;
619 return uri.equals(lpc.getIdentity());
622 private native boolean soundResourcesLocked(long nativePtr);
623 public synchronized boolean soundResourcesLocked() {
624 return soundResourcesLocked(nativePtr);
627 private native void setMaxCalls(long nativePtr, int max);
629 public synchronized void setMaxCalls(int max) {
630 setMaxCalls(nativePtr, max);
632 private native boolean isEchoLimiterEnabled(long nativePtr);
634 public synchronized boolean isEchoLimiterEnabled() {
635 return isEchoLimiterEnabled(nativePtr);
637 private native boolean mediaEncryptionSupported(long nativePtr, int menc);
639 public synchronized boolean mediaEncryptionSupported(MediaEncryption menc) {
640 return mediaEncryptionSupported(nativePtr,menc.mValue);
643 private native void setPlayFile(long nativePtr, String path);
646 public synchronized void setPlayFile(String path) {
647 setPlayFile(nativePtr, path);
651 private native void tunnelAddServerAndMirror(long nativePtr, String host, int port, int mirror, int ms);
653 public synchronized void tunnelAddServerAndMirror(String host, int port, int mirror, int ms) {
654 tunnelAddServerAndMirror(nativePtr, host, port, mirror, ms);
657 private native void tunnelAutoDetect(long nativePtr);
659 public synchronized void tunnelAutoDetect() {
660 tunnelAutoDetect(nativePtr);
663 private native void tunnelCleanServers(long nativePtr);
665 public synchronized void tunnelCleanServers() {
666 tunnelCleanServers(nativePtr);
669 private native void tunnelEnable(long nativePtr, boolean enable);
671 public synchronized void tunnelEnable(boolean enable) {
672 tunnelEnable(nativePtr, enable);
676 public native boolean isTunnelAvailable();
678 private native void acceptCallWithParams(long nativePtr, long aCall,
681 public synchronized void acceptCallWithParams(LinphoneCall aCall,
682 LinphoneCallParams params) throws LinphoneCoreException {
683 acceptCallWithParams(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
686 private native void acceptCallUpdate(long nativePtr, long aCall, long params);
688 public synchronized void acceptCallUpdate(LinphoneCall aCall, LinphoneCallParams params)
689 throws LinphoneCoreException {
690 acceptCallUpdate(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
693 private native void deferCallUpdate(long nativePtr, long aCall);
695 public synchronized void deferCallUpdate(LinphoneCall aCall)
696 throws LinphoneCoreException {
697 deferCallUpdate(nativePtr, getCallPtr(aCall));
700 private native void setVideoPolicy(long nativePtr, boolean autoInitiate, boolean autoAccept);
701 public synchronized void setVideoPolicy(boolean autoInitiate, boolean autoAccept) {
702 setVideoPolicy(nativePtr, autoInitiate, autoAccept);
704 private native void setUserAgent(long nativePtr, String name, String version);
706 public void setUserAgent(String name, String version) {
707 setUserAgent(nativePtr,name,version);
710 private native void setCpuCountNative(int count);
711 public void setCpuCount(int count)
713 setCpuCountNative(count);
716 public int getMissedCallsCount() {
717 return getMissedCallsCount(nativePtr);
720 public void removeCallLog(LinphoneCallLog log) {
721 removeCallLog(nativePtr, ((LinphoneCallLogImpl) log).getNativePtr());
724 public void resetMissedCallsCount() {
725 resetMissedCallsCount(nativePtr);
728 private native void tunnelSetHttpProxy(long nativePtr, String proxy_host, int port,
729 String username, String password);
731 public void tunnelSetHttpProxy(String proxy_host, int port,
732 String username, String password) {
733 tunnelSetHttpProxy(nativePtr, proxy_host, port, username, password);
736 private native void refreshRegisters(long nativePtr);
737 public void refreshRegisters() {
738 refreshRegisters(nativePtr);
742 public String getVersion() {
743 return getVersion(nativePtr);
747 public PayloadType findPayloadType(String mime, int clockRate) {
748 return findPayloadType(mime, clockRate, 1);
751 private native void removeFriend(long ptr, long lf);
753 public void removeFriend(LinphoneFriend lf) {
754 removeFriend(nativePtr, lf.getNativePtr());
757 private native long getFriendByAddress(long ptr, String sipUri);
759 public LinphoneFriend findFriendByAddress(String sipUri) {
760 long ptr = getFriendByAddress(nativePtr, sipUri);
764 return new LinphoneFriendImpl(ptr);
767 public void setAudioPort(int port) {
768 setAudioPort(nativePtr, port);
771 public void setVideoPort(int port) {
772 setVideoPort(nativePtr, port);
775 public void setAudioPortRange(int minPort, int maxPort) {
776 setAudioPortRange(nativePtr, minPort, maxPort);
779 public void setVideoPortRange(int minPort, int maxPort) {
780 setVideoPortRange(nativePtr, minPort, maxPort);
783 public void setIncomingTimeout(int timeout) {
784 setIncomingTimeout(nativePtr, timeout);
787 public void setInCallTimeout(int timeout)
789 setInCallTimeout(nativePtr, timeout);
792 private native void setUploadBandwidth(long ptr, int bandwidth);
793 public void setUploadBandwidth(int bandwidth) {
794 setUploadBandwidth(nativePtr, bandwidth);
797 private native void setDownloadBandwidth(long ptr, int bandwidth);
798 public void setDownloadBandwidth(int bandwidth) {
799 setUploadBandwidth(nativePtr, bandwidth);
802 private native void setMicrophoneGain(long ptr, float gain);
803 public void setMicrophoneGain(float gain) {
804 setUploadBandwidth(nativePtr, gain);