]> sjero.net Git - linphone/blob - java/common/org/linphone/core/LinphoneCore.java
Merge branch 'master' of git.linphone.org:linphone
[linphone] / java / common / org / linphone / core / LinphoneCore.java
1 /*
2 LinphoneCore.java
3 Copyright (C) 2010  Belledonne Communications, Grenoble, France
4
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.
9
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.
14
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.
18 */
19 package org.linphone.core;
20
21 import java.util.Vector;
22
23 /**
24  * Linphone core main object created by method {@link LinphoneCoreFactory#createLinphoneCore(LinphoneCoreListener, String, String, Object)}.    
25  *
26  */
27
28 public interface LinphoneCore {
29         /**
30          * linphone core states
31          */
32         static public class GlobalState {
33                 
34                 static private Vector<GlobalState> values = new Vector<GlobalState>();
35                 /**
36                  * Off
37                  */
38                 static public GlobalState GlobalOff = new GlobalState(0,"GlobalOff");       
39                 /**
40                  * Startup
41                  */
42                 static public GlobalState GlobalStartup = new GlobalState(1,"GlobalStartup");
43                 /**
44                  * On
45                  */
46                 static public GlobalState GlobalOn = new GlobalState(2,"GlobalOn");
47                 /**
48                  * Shutdown
49                  */
50                 static public GlobalState GlobalShutdown = new GlobalState(3,"GlobalShutdown");
51
52                 private final int mValue;
53                 private final String mStringValue;
54
55                 
56                 private GlobalState(int value,String stringValue) {
57                         mValue = value;
58                         values.addElement(this);
59                         mStringValue=stringValue;
60                 }
61                 public static GlobalState fromInt(int value) {
62
63                         for (int i=0; i<values.size();i++) {
64                                 GlobalState state = (GlobalState) values.elementAt(i);
65                                 if (state.mValue == value) return state;
66                         }
67                         throw new RuntimeException("state not found ["+value+"]");
68                 }
69                 public String toString() {
70                         return mStringValue;
71                 }
72         }
73         /**
74          * Describes proxy registration states.
75          *
76          */
77         static public class RegistrationState {
78                 
79                 private static Vector<RegistrationState> values = new Vector<RegistrationState>();
80                 /**
81                  * None
82                  */
83                 public static RegistrationState RegistrationNone = new RegistrationState(0,"RegistrationNone");       
84                 /**
85                  * In Progress
86                  */
87                 public static RegistrationState RegistrationProgress  = new RegistrationState(1,"RegistrationProgress");
88                 /**
89                  * Ok
90                  */
91                 public static RegistrationState RegistrationOk = new RegistrationState(2,"RegistrationOk");
92                 /**
93                  * Cleared
94                  */
95                 public static RegistrationState RegistrationCleared = new RegistrationState(3,"RegistrationCleared");
96                 /**
97                  * Failed
98                  */
99                 public static RegistrationState RegistrationFailed = new RegistrationState(4,"RegistrationFailed");
100                 private final int mValue;
101                 private final String mStringValue;
102
103                 
104                 private RegistrationState(int value,String stringValue) {
105                         mValue = value;
106                         values.addElement(this);
107                         mStringValue=stringValue;
108                 }
109                 public static RegistrationState fromInt(int value) {
110
111                         for (int i=0; i<values.size();i++) {
112                                 RegistrationState state = (RegistrationState) values.elementAt(i);
113                                 if (state.mValue == value) return state;
114                         }
115                         throw new RuntimeException("state not found ["+value+"]");
116                 }
117                 public String toString() {
118                         return mStringValue;
119                 }
120         }
121         /**
122          * Describes firewall policy.
123          *
124          */
125         static public class FirewallPolicy {
126                 
127                 static private Vector<FirewallPolicy> values = new Vector<FirewallPolicy>();
128                 /**
129                  * No firewall is assumed.
130                  */
131                 static public FirewallPolicy NoFirewall = new FirewallPolicy(0,"NoFirewall");       
132                 /**
133                  * Use NAT address (discouraged)
134                  */
135                 static public FirewallPolicy UseNatAddress  = new FirewallPolicy(1,"UseNatAddress");
136                 /**
137                  * Use stun server to discover RTP addresses and ports.
138                  */
139                 static public FirewallPolicy UseStun = new FirewallPolicy(2,"UseStun");
140                 /**
141                  * Use ICE.
142                  */
143                 static public FirewallPolicy UseIce = new FirewallPolicy(3,"UseIce");
144                 
145                 private final int mValue;
146                 private final String mStringValue;
147
148                 
149                 private FirewallPolicy(int value,String stringValue) {
150                         mValue = value;
151                         values.addElement(this);
152                         mStringValue=stringValue;
153                 }
154                 public static FirewallPolicy fromInt(int value) {
155
156                         for (int i=0; i<values.size();i++) {
157                                 FirewallPolicy state = (FirewallPolicy) values.elementAt(i);
158                                 if (state.mValue == value) return state;
159                         }
160                         throw new RuntimeException("state not found ["+value+"]");
161                 }
162                 public String toString() {
163                         return mStringValue;
164                 }
165                 public int value(){
166                         return mValue;
167                 }
168         }
169         
170         /**
171          * Signaling transports ports.
172          */
173         static public class Transports {
174                 public int udp;
175                 public int tcp;
176                 public int tls;
177                 
178                 public Transports() {};
179                 public Transports(Transports t) {
180                         this.udp = t.udp;
181                         this.tcp = t.tcp;
182                         this.tls = t.tls;
183                 }
184                 public String toString() {
185                         return "udp["+udp+"] tcp["+tcp+"] tls["+tls+"]";
186                 }
187         }
188         /**
189          * Media (RTP) encryption enum-like.
190          *
191          */
192         static public final class MediaEncryption {
193                 
194                 static private Vector<MediaEncryption> values = new Vector<MediaEncryption>();
195                 /**
196                  * None
197                  */
198                 static public final MediaEncryption None = new MediaEncryption(0,"None");       
199                 /**
200                  * SRTP
201                  */
202                 static public final MediaEncryption SRTP = new MediaEncryption(1,"SRTP");
203                 /**
204                  * ZRTP
205                  */
206                 static public final MediaEncryption ZRTP = new MediaEncryption(2,"ZRTP");
207                 protected final int mValue;
208                 private final String mStringValue;
209
210                 
211                 private MediaEncryption(int value,String stringValue) {
212                         mValue = value;
213                         values.addElement(this);
214                         mStringValue=stringValue;
215                 }
216                 public static MediaEncryption fromInt(int value) {
217
218                         for (int i=0; i<values.size();i++) {
219                                 MediaEncryption menc = (MediaEncryption) values.elementAt(i);
220                                 if (menc.mValue == value) return menc;
221                         }
222                         throw new RuntimeException("MediaEncryption not found ["+value+"]");
223                 }
224                 public String toString() {
225                         return mStringValue;
226                 }
227         }
228         /**
229          *      EC Calibrator Status
230          */
231         static public class EcCalibratorStatus {
232                 
233                 static private Vector<EcCalibratorStatus> values = new Vector<EcCalibratorStatus>();
234                 /* Do not change the values of these constants or the strings associated with them to prevent breaking
235                    the collection of echo canceller calibration results during the wizard! */
236                 public static final int IN_PROGRESS_STATUS=0;
237                 public static final int DONE_STATUS=1;
238                 public static final int FAILED_STATUS=2;
239                 public static final int DONE_NO_ECHO_STATUS=3;
240                 /**
241                  * Calibration in progress
242                  */
243                 static public EcCalibratorStatus InProgress = new EcCalibratorStatus(IN_PROGRESS_STATUS,"InProgress");
244                 /**
245                  * Calibration done that produced an echo delay measure
246                  */
247                 static public EcCalibratorStatus Done = new EcCalibratorStatus(DONE_STATUS,"Done");
248                 /**
249                  * Calibration failed
250                  */
251                 static public EcCalibratorStatus Failed = new EcCalibratorStatus(FAILED_STATUS,"Failed");
252                 /**
253                  * Calibration done with no echo detected
254                  */
255                 static public EcCalibratorStatus DoneNoEcho = new EcCalibratorStatus(DONE_NO_ECHO_STATUS, "DoneNoEcho");
256
257                 private final int mValue;
258                 private final String mStringValue;
259
260                 
261                 private EcCalibratorStatus(int value,String stringValue) {
262                         mValue = value;
263                         values.addElement(this);
264                         mStringValue=stringValue;
265                 }
266                 public static EcCalibratorStatus fromInt(int value) {
267
268                         for (int i=0; i<values.size();i++) {
269                                 EcCalibratorStatus status = (EcCalibratorStatus) values.elementAt(i);
270                                 if (status.mValue == value) return status;
271                         }
272                         throw new RuntimeException("status not found ["+value+"]");
273                 }
274                 public String toString() {
275                         return mStringValue;
276                 }
277                 public int value(){
278                         return mValue;
279                 }
280         }
281         
282         static public class UpnpState {
283                 static private Vector<UpnpState> values = new Vector<UpnpState>();
284                 /**
285                  * Idle 
286                  */
287                 static public UpnpState Idle = new UpnpState(0, "Idle");
288                 /**
289                  * Pending
290                  */
291                 static public UpnpState Pending = new UpnpState(1, "Pending");
292                 /**
293                  * Adding
294                  */
295                 static public UpnpState Adding = new UpnpState(2, "Adding");
296                 /**
297                  * Removing
298                  */
299                 static public UpnpState Removing = new UpnpState(3, "Removing");
300                 /**
301                  * Not Available
302                  */
303                 static public UpnpState NotAvailable = new UpnpState(4, "Not available");
304                 /**
305                  * Ok
306                  */
307                 static public UpnpState Ok = new UpnpState(5, "Ok");
308                 /**
309                  * Ko 
310                  */
311                 static public UpnpState Ko = new UpnpState(6, "Ko");
312                 protected final int mValue;
313                 private final String mStringValue;
314
315                 private UpnpState(int value, String stringValue) {
316                         mValue = value;
317                         values.addElement(this);
318                         mStringValue = stringValue;
319                 }
320                 public static UpnpState fromInt(int value) {
321                         for (int i = 0; i < values.size(); i++) {
322                                 UpnpState mstate = (UpnpState) values.elementAt(i);
323                                 if (mstate.mValue == value) return mstate;
324                         }
325                         throw new RuntimeException("UpnpState not found [" + value + "]");
326                 }
327                 public String toString() {
328                         return mStringValue;
329                 }
330         }
331
332         /**
333          * Set the context of creation of the LinphoneCore.
334          */
335         public void setContext(Object context);
336
337         /**
338          * clear all added proxy configs
339          */
340         public void clearProxyConfigs();
341         /**
342          * Add a proxy configuration. This will start registration on the proxy, if registration is enabled.
343          * @param proxyCfg
344          * @throws LinphoneCoreException
345          */
346         public void addProxyConfig(LinphoneProxyConfig proxyCfg) throws LinphoneCoreException;
347         /**
348          * Sets the default proxy.
349          *<br>
350          * This default proxy must be part of the list of already entered {@link LinphoneProxyConfig}. 
351          * Toggling it as default will make LinphoneCore use the identity associated with the proxy configuration in all incoming and outgoing calls.
352          * @param proxyCfg 
353          */
354         public void setDefaultProxyConfig(LinphoneProxyConfig proxyCfg);
355         
356         /**
357          * get he default proxy configuration, that is the one used to determine the current identity.
358          * @return null if no default proxy config 
359          */
360         public LinphoneProxyConfig getDefaultProxyConfig() ;
361         
362         /**
363          * clear all the added auth info
364          */
365         void clearAuthInfos();
366         /**
367          * Adds authentication information to the LinphoneCore.
368          * <br>This information will be used during all SIP transacations that require authentication.
369          * @param info
370          */
371         void addAuthInfo(LinphoneAuthInfo info);
372         
373         /**
374          * Build an address according to the current proxy config. In case destination is not a sip address, the default proxy domain is automatically appended
375          * @param destination
376          * @return
377          * @throws If no LinphoneAddress can be built from destination
378          */
379         public LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException;
380         
381         /**
382          * Starts a call given a destination. Internally calls {@link #interpretUrl(String)} then {@link #invite(LinphoneAddress)}.
383          * @param uri
384          */
385         public LinphoneCall invite(String destination)throws LinphoneCoreException;
386         /**
387          * Initiates an outgoing call given a destination LinphoneAddress
388          *<br>The LinphoneAddress can be constructed directly using linphone_address_new(), or created by linphone_core_interpret_url(). The application doesn't own a reference to the returned LinphoneCall object. Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application.
389          * @param to the destination of the call (sip address).
390          * @return LinphoneCall
391          * @throws LinphoneCoreException
392          */
393         public LinphoneCall invite(LinphoneAddress to)throws LinphoneCoreException;
394         /**
395          * Terminates a call.
396          * @param aCall to be terminated
397          */
398         public void terminateCall(LinphoneCall aCall);
399         /**
400          * Declines an incoming call, providing a reason for declining it.
401          */
402         public void declineCall(LinphoneCall aCall, Reason reason);
403         /**
404          * Returns The LinphoneCall the current call if one is in call
405          *
406         **/
407         public LinphoneCall getCurrentCall(); 
408         
409         /**
410          * get current call remote address in case of in/out call
411          * @return null if no call engaged yet
412          */
413         public LinphoneAddress getRemoteAddress();
414         /**
415          *  
416          * @return  TRUE if there is a call running or pending.
417          */
418         public boolean isIncall();
419         /**
420          * 
421          * @return Returns true if in incoming call is pending, ie waiting for being answered or declined.
422          */
423         public boolean isInComingInvitePending();
424         /**
425          * Main loop function. It is crucial that your application call it periodically.
426          *
427          *      #iterate() performs various backgrounds tasks:
428          * <li>receiving of SIP messages
429          * <li> handles timers and timeout
430          * <li> performs registration to proxies
431          * <li> authentication retries The application MUST call this function from periodically, in its main loop. 
432          * <br> Be careful that this function must be call from the same thread as other liblinphone methods. In not the case make sure all liblinphone calls are serialized with a mutex.
433
434          */
435         public void iterate();
436         /**
437          * Accept an incoming call.
438          *
439          * Basically the application is notified of incoming calls within the
440          * {@link LinphoneCoreListener#callState} listener method.
441          * The application can later respond positively to the call using
442          * this method.
443          * @throws LinphoneCoreException 
444          */
445         public void acceptCall(LinphoneCall aCall) throws LinphoneCoreException;
446         
447         /**
448          * Accept an incoming call.
449          *
450          * Basically the application is notified of incoming calls within the
451          * {@link LinphoneCoreListener#callState} listener method.
452          * The application can later respond positively to the call using
453          * this method.
454          * @throws LinphoneCoreException 
455          */
456         public void acceptCallWithParams(LinphoneCall aCall, LinphoneCallParams params) throws LinphoneCoreException;
457         
458         /**
459          * Accept call modifications initiated by other end.
460          *
461          * Basically the application is notified of incoming calls within the
462          * {@link LinphoneCoreListener#callState} listener method.
463          * The application can later respond positively to the call using
464          * this method.
465          * @throws LinphoneCoreException 
466          */
467         public void acceptCallUpdate(LinphoneCall aCall, LinphoneCallParams params) throws LinphoneCoreException;
468         
469         
470         /**
471          * Prevent LinphoneCore from performing an automatic answer
472          *
473          * Basically the application is notified of incoming calls within the
474          * {@link LinphoneCoreListener#callState} listener method.
475          * The application can later respond positively to the call using
476          * this method.
477          * @throws LinphoneCoreException 
478          */
479         public void deferCallUpdate(LinphoneCall aCall) throws LinphoneCoreException;
480
481         public void startRinging();
482
483         /**
484          * @return a list of LinphoneCallLog 
485          */
486         public LinphoneCallLog[] getCallLogs();
487         
488         /**
489          * This method is called by the application to notify the Linphone core library when network is reachable.
490          * Calling this method with true trigger Linphone to initiate a registration process for all proxy
491          * configuration with parameter register set to enable.
492          * This method disable the automatic registration mode. It means you must call this method after each network state changes
493          * @param network state  
494          *
495          */
496         public void setNetworkReachable(boolean isReachable);
497         /**
498          * 
499          * @return if false, there is no network connection.
500          */
501         public boolean isNetworkReachable();
502         /**
503          * destroy linphone core and free all underlying resources
504          */
505         public void destroy();
506         /**
507          * Allow to control play level before entering  sound card:  
508          * @param level in db
509          */
510         public void setPlaybackGain(float gain);
511         /**
512          * get play level before entering  sound card:  
513          * @return level in db
514          */
515         public float getPlaybackGain();
516         /**
517          * set play level
518          * @param level [0..100]
519          */
520         public void setPlayLevel(int level);
521         /**
522          * get playback level [0..100];
523          * -1 if not cannot be determined
524          * @return
525          */
526         public int getPlayLevel();
527         /**
528          *  Mutes or unmutes the local microphone.
529          * @param isMuted
530          */
531         void muteMic(boolean isMuted);
532         /**
533          * 
534          * @return true is mic is muted
535          */
536         boolean isMicMuted();
537
538         /**
539          * Initiate a dtmf signal if in call
540          * @param number
541          */
542         void sendDtmf(char number);
543         /**
544          * Initiate a dtmf signal to the speaker if not in call.
545          * Sending of the DTMF is done in another function.
546          * @param number
547          * @param duration in ms , -1 for unlimited
548          */
549         void playDtmf(char number,int duration);
550         /**
551          * stop current dtmf
552          */
553         void stopDtmf();
554         
555         /**
556          * remove all call logs
557          */
558         void clearCallLogs();
559         /***
560          * get payload type  from mime type, clock rate, and number of channels.-
561          * 
562          * return null if not found
563          */
564         PayloadType findPayloadType(String mime, int clockRate, int channels); 
565         /***
566          * get payload type  from mime type and clock rate..
567          * 
568          * return null if not found
569          */
570         PayloadType findPayloadType(String mime, int clockRate); 
571         /**
572          * not implemented yet
573          * @param pt
574          * @param enable
575          * @throws LinphoneCoreException
576          */
577         void enablePayloadType(PayloadType pt, boolean enable) throws LinphoneCoreException;
578         /**
579          * Enables or disable echo cancellation.
580          * @param enable
581          */
582         void enableEchoCancellation(boolean enable);
583         /**
584          * get EC status 
585          * @return true if echo cancellation is enabled.
586          */
587         boolean isEchoCancellationEnabled();
588         /**
589          * Get echo limiter status (another method of doing echo suppression, more brute force)
590          * @return true if echo limiter is enabled
591          */
592         boolean isEchoLimiterEnabled();
593         /**
594          * @param transports used for signaling (TCP, UDP and TLS)
595          */
596         void setSignalingTransportPorts(Transports transports);
597         /**
598          * @return transports used for signaling (TCP, UDP, TLS)
599          */
600         Transports getSignalingTransportPorts();
601         /**
602          * Activates or deactivates the speaker.
603          * @param value
604          */
605         void enableSpeaker(boolean value);
606         /**
607          * Tells whether the speaker is activated.
608          * @return true if speaker enabled, false otherwise
609          */
610         boolean isSpeakerEnabled();
611         /**
612          * add a friend to the current buddy list, if subscription attribute is set, a SIP SUBSCRIBE message is sent.
613          * @param lf LinphoenFriend to add
614          * @throws LinphoneCoreException
615          */
616         void addFriend(LinphoneFriend lf) throws LinphoneCoreException;
617
618         /**
619          * Set my presence status
620          * @param minute_away how long in away
621          * @param status sip uri used to redirect call in state LinphoneStatusMoved
622          */
623         void setPresenceInfo(int minute_away,String alternative_contact, OnlineStatus status);
624         /**
625          * Create a new chat room for messaging from a sip uri like sip:joe@sip.linphone.org
626          * @param to    destination address for messages 
627          *
628          * @return {@link LinphoneChatRoom} where messaging can take place.
629          */
630         LinphoneChatRoom createChatRoom(String to);
631         
632         void setVideoWindow(Object w);
633         void setPreviewWindow(Object w);
634         void setDeviceRotation(int rotation);
635         
636         void setVideoDevice(int id);
637         int getVideoDevice();
638         
639         /**
640          * Enables video globally.
641          *
642          * 
643          * This function does not have any effect during calls. It just indicates #LinphoneCore to
644          * initiate future calls with video or not. The two boolean parameters indicate in which
645          * direction video is enabled. Setting both to false disables video entirely.
646          *
647          * @param vcap_enabled indicates whether video capture is enabled
648          * @param display_enabled indicates whether video display should be shown
649          *
650         **/
651         void enableVideo(boolean vcap_enabled, boolean display_enabled);
652         /**
653          * Returns TRUE if video is enabled, FALSE otherwise.
654          *      
655          ***/
656         boolean isVideoEnabled();
657         
658         /**
659          * Specify a STUN server to help firewall traversal.
660          * @param stun_server Stun server address and port, such as stun.linphone.org or stun.linphone.org:3478
661          */
662         void setStunServer(String stun_server);
663         /**
664          * @return stun server address if previously set.
665          */
666         String getStunServer();
667         
668         /**
669          * Sets policy regarding workarounding NATs
670          * @param pol one of the FirewallPolicy members.
671         **/
672         void setFirewallPolicy(FirewallPolicy pol);
673         /**
674          * @return previously set firewall policy.
675          */
676         FirewallPolicy getFirewallPolicy();
677
678         LinphoneCall inviteAddressWithParams(LinphoneAddress destination, LinphoneCallParams params) throws LinphoneCoreException ;
679         
680         int updateCall(LinphoneCall call, LinphoneCallParams params);
681
682         LinphoneCallParams createDefaultCallParameters();
683
684         /**
685          * Sets the path to a wav file used for ringing.
686          *
687          * @param path The file must be a wav 16bit linear. Local ring is disabled if null
688          */
689         void setRing(String path);
690         /**
691          * gets the path to a wav file used for ringing.
692          *
693          * @param null if not set
694          */
695         String getRing();
696         
697         /**
698          * Sets file or folder containing trusted root CAs
699          *
700          * @param path path to file with multiple PEM certif or to folder with multiple PEM files
701          */     
702         void setRootCA(String path);
703         
704         void setUploadBandwidth(int bw);
705
706         void setDownloadBandwidth(int bw);
707         
708         /**
709          * Sets audio packetization interval suggested for remote end.
710          * @param ptime packetization interval in milliseconds
711          */
712         void setDownloadPtime(int ptime);
713         
714         /**
715          * Sets audio packetization interval sent to remote end.
716          * @param ptime packetization interval in milliseconds
717          */
718         void setUploadPtime(int ptime);
719
720         void setPreferredVideoSize(VideoSize vSize);
721         
722         VideoSize getPreferredVideoSize();
723         
724         /**
725          * Returns the currently supported audio codecs, as PayloadType elements
726          * @return
727          */
728         PayloadType[] getAudioCodecs();
729         /**
730          * Returns the currently supported video codecs, as PayloadType elements
731          * @return
732          */
733         PayloadType[] getVideoCodecs();
734         /**
735          * enable signaling keep alive. small udp packet sent periodically to keep udp NAT association
736          */
737         void enableKeepAlive(boolean enable);
738         /**
739          * get keep elive mode
740          * @return true if enable
741          */
742         boolean isKeepAliveEnabled();
743         /**
744          * Start an echo calibration of the sound devices, in order to find adequate settings for the echo canceler automatically.
745          * status is notified to {@link LinphoneCoreListener#ecCalibrationStatus(EcCalibratorStatus, int, Object)}
746          * @param User object
747          * @throws LinphoneCoreException if operation is still in progress;
748         **/
749         void startEchoCalibration(Object data) throws LinphoneCoreException;
750
751         /**
752          * Returns true if echo calibration is recommended.
753          * If the device has a builtin echo canceller or calibration value is already known, it will return false.
754          */
755         boolean needsEchoCalibration();
756         
757         void enableIpv6(boolean enable);
758         /**
759          * @deprecated
760          * @param i
761          */
762         void adjustSoftwareVolume(int i);
763         
764         /**
765          * Pause a call.
766         **/
767         boolean pauseCall(LinphoneCall call);
768         /**
769          * Resume a call.
770         **/
771         boolean resumeCall(LinphoneCall call);
772         boolean pauseAllCalls();
773         
774         void setZrtpSecretsCache(String file);
775         void enableEchoLimiter(boolean val);
776
777         /**
778          * Indicates whether the local user is part of the conference.
779         **/
780         boolean isInConference();
781         /**
782          * Connect the local user to the conference.
783         **/
784         boolean enterConference();
785         /**
786          * Disconnect the local user from the conference.
787         **/
788         void leaveConference();
789
790         /**
791          * Add an established call to the conference. The LinphoneCore is able to manage one client based conference.
792         **/
793         void addToConference(LinphoneCall call);
794         /**
795          * Remove an established call from the conference.
796         **/
797         void removeFromConference(LinphoneCall call);
798         void addAllToConference();
799         
800         /**
801          * Terminate the conference, all users are disconnected.
802         **/
803         void terminateConference();
804         int getConferenceSize();
805
806         /**
807          * Request recording of the conference into a supplied file path.
808          * The format is wav.
809         **/
810         void startConferenceRecording(String path);
811         
812         /**
813          * Stop recording of the conference.
814         **/
815         void stopConferenceRecording();
816
817         void terminateAllCalls();
818         /**
819          * Returns all calls.
820         **/
821         LinphoneCall[] getCalls();
822         int getCallsNb();
823
824
825         void transferCall(LinphoneCall call, String referTo);
826         void transferCallToAnother(LinphoneCall callToTransfer, LinphoneCall destination);
827
828         LinphoneCall findCallFromUri(String uri);
829
830         int getMaxCalls();
831         void setMaxCalls(int max);
832         boolean isMyself(String uri);
833
834         /**
835          * Use this method to check the calls state and forbid proposing actions
836          * which could result in an active call.
837          * Eg: don't start a new call if one is in outgoing ringing.
838          * Eg: don't merge to conference either as it could result
839          *     in two active calls (conference and accepted call). 
840          * @return
841          */
842         boolean soundResourcesLocked();
843         /**
844          * Returns whether given media encryption is supported by liblinphone.
845          */
846         boolean mediaEncryptionSupported(MediaEncryption menc);
847         /**
848          * set media encryption (rtp) to use
849          * @params menc: MediaEncryption.None, MediaEncryption.SRTP or MediaEncryption.ZRTP
850          */
851         void setMediaEncryption(MediaEncryption menc);
852         /**
853          * return selected media encryption
854          * @return MediaEncryption.None, MediaEncryption.SRTP or MediaEncryption.ZRTP
855          */
856         MediaEncryption getMediaEncryption();
857 /**
858          * Set media encryption required for outgoing calls
859          */
860         void setMediaEncryptionMandatory(boolean yesno);
861         /**
862          * @return if media encryption is required for outgoing calls
863          */
864         boolean isMediaEncryptionMandatory();
865
866         /**
867          * @param path path to music file played to remote side when on hold.
868          */
869         void setPlayFile(String path);
870         void tunnelEnable(boolean enable);
871         void tunnelAutoDetect();
872         void tunnelCleanServers();
873         void tunnelSetHttpProxy(String proxy_host, int port, String username, String password);
874         /**
875          * @param host tunnel server ip address
876          * @param port tunnel server tls port, recommended value is 443
877          * @param udpMirrorPort remote port on the tunnel server side  used to test udp reachability
878          * @param roundTripDelay udp packet round trip delay in ms considered as acceptable. recommended value is 1000 ms
879          */
880         void tunnelAddServerAndMirror(String host, int port, int udpMirrorPort, int roundTripDelay);
881
882         boolean isTunnelAvailable();
883         
884         LinphoneProxyConfig[] getProxyConfigList();
885         
886         void setVideoPolicy(boolean autoInitiate, boolean autoAccept);
887
888         void setStaticPicture(String path);
889
890         void setUserAgent(String name, String version);
891         
892         void setCpuCount(int count);
893         
894         /**
895          * remove a call log
896          */
897         public void removeCallLog(LinphoneCallLog log);
898         
899         /**
900          * @return count of missed calls
901          */
902         public int getMissedCallsCount();
903         
904         /**
905          * Set missed calls count to zero
906          */
907         public void resetMissedCallsCount();
908         /**
909          * re-initiates registration if network is up.
910          */
911         public void refreshRegisters();
912
913         /**
914          * return the version code of linphone core
915          */
916         public String getVersion();
917         
918         /**
919          * remove a linphone friend from linphone core and linphonerc
920          */
921         void removeFriend(LinphoneFriend lf);
922         
923         /**
924          * return a linphone friend (if exists) that matches the sip address
925          */
926         LinphoneFriend findFriendByAddress(String sipUri);
927         
928         /**
929          * Sets the UDP port used for audio streaming.
930         **/
931         void setAudioPort(int port);
932         
933         /**
934          * Sets the UDP port range from which to randomly select the port used for audio streaming.
935          */
936         void setAudioPortRange(int minPort, int maxPort);
937         
938         /**
939          * Sets the UDP port used for video streaming.
940         **/
941         void setVideoPort(int port);
942         
943         /**
944          * Sets the UDP port range from which to randomly select the port used for video streaming.
945          */
946         void setVideoPortRange(int minPort, int maxPort);
947         
948         /**
949          * Set the incoming call timeout in seconds.
950          * If an incoming call isn't answered for this timeout period, it is
951          * automatically declined.
952         **/
953         void setIncomingTimeout(int timeout);
954         
955         /**
956          * Set the call timeout in seconds.
957          * Once this time is elapsed (ringing included), the call is automatically hung up.
958         **/
959         void setInCallTimeout(int timeout);
960         
961         void setMicrophoneGain(float gain);
962         
963         /**
964          * Set username and display name to use if no LinphoneProxyConfig configured
965          */
966         void setPrimaryContact(String displayName, String username);
967         
968         /**
969          * Enable/Disable the use of SIP INFO for DTMFs
970          */
971         void setUseSipInfoForDtmfs(boolean use);
972         
973         /**
974          * Enable/Disable the use of inband DTMFs
975          */
976         void setUseRfc2833ForDtmfs(boolean use);
977
978         /**
979          * @return returns LpConfig object to read/write to the config file: usefull if you wish to extend
980          * the config file with your own sections
981          */
982         LpConfig getConfig();
983
984
985         /**
986          * Return the availability of uPnP.
987          *
988          * @return true if uPnP is available otherwise return false. 
989          */
990         public boolean upnpAvailable();
991
992         /**
993          * Return the internal state of uPnP. 
994          *
995          * @return an UpnpState. 
996          */
997         public UpnpState getUpnpState();
998
999         /**
1000          * Return the external ip address of router. 
1001          * In some cases the uPnP can have an external ip address but not a usable uPnP
1002          * (state different of Ok). 
1003          *
1004          * @return a null terminated string containing the external ip address. If the
1005          * the external ip address is not available return null. 
1006          */
1007         public String getUpnpExternalIpaddress();
1008
1009 }