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