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;
21 import java.util.Vector;
23 import org.linphone.core.LinphoneCall.State;
24 import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
27 * Linphone core main object created by method {@link LinphoneCoreFactory#createLinphoneCore(LinphoneCoreListener, String, String, Object)}.
31 public interface LinphoneCore {
33 * linphone core states
35 static public class GlobalState {
37 static private Vector<GlobalState> values = new Vector<GlobalState>();
41 static public GlobalState GlobalOff = new GlobalState(0,"GlobalOff");
45 static public GlobalState GlobalStartup = new GlobalState(1,"GlobalStartup");
49 static public GlobalState GlobalOn = new GlobalState(2,"GlobalOn");
53 static public GlobalState GlobalShutdown = new GlobalState(3,"GlobalShutdown");
55 private final int mValue;
56 private final String mStringValue;
59 private GlobalState(int value,String stringValue) {
61 values.addElement(this);
62 mStringValue=stringValue;
64 public static GlobalState fromInt(int value) {
66 for (int i=0; i<values.size();i++) {
67 GlobalState state = (GlobalState) values.elementAt(i);
68 if (state.mValue == value) return state;
70 throw new RuntimeException("state not found ["+value+"]");
72 public String toString() {
77 * Describes proxy registration states.
80 static public class RegistrationState {
82 private static Vector<RegistrationState> values = new Vector<RegistrationState>();
86 public static RegistrationState RegistrationNone = new RegistrationState(0,"RegistrationNone");
90 public static RegistrationState RegistrationProgress = new RegistrationState(1,"RegistrationProgress");
94 public static RegistrationState RegistrationOk = new RegistrationState(2,"RegistrationOk");
98 public static RegistrationState RegistrationCleared = new RegistrationState(3,"RegistrationCleared");
102 public static RegistrationState RegistrationFailed = new RegistrationState(4,"RegistrationFailed");
103 private final int mValue;
104 private final String mStringValue;
107 private RegistrationState(int value,String stringValue) {
109 values.addElement(this);
110 mStringValue=stringValue;
112 public static RegistrationState fromInt(int value) {
114 for (int i=0; i<values.size();i++) {
115 RegistrationState state = (RegistrationState) values.elementAt(i);
116 if (state.mValue == value) return state;
118 throw new RuntimeException("state not found ["+value+"]");
120 public String toString() {
125 * Describes firewall policy.
128 static public class FirewallPolicy {
130 static private Vector<FirewallPolicy> values = new Vector<FirewallPolicy>();
132 * No firewall is assumed.
134 static public FirewallPolicy NoFirewall = new FirewallPolicy(0,"NoFirewall");
136 * Use NAT address (discouraged)
138 static public FirewallPolicy UseNatAddress = new FirewallPolicy(1,"UseNatAddress");
140 * Use stun server to discover RTP addresses and ports.
142 static public FirewallPolicy UseStun = new FirewallPolicy(2,"UseStun");
146 static public FirewallPolicy UseIce = new FirewallPolicy(3,"UseIce");
150 static public FirewallPolicy UseUpnp = new FirewallPolicy(4,"UseUpnp");
152 private final int mValue;
153 private final String mStringValue;
156 private FirewallPolicy(int value,String stringValue) {
158 values.addElement(this);
159 mStringValue=stringValue;
161 public static FirewallPolicy fromInt(int value) {
163 for (int i=0; i<values.size();i++) {
164 FirewallPolicy state = (FirewallPolicy) values.elementAt(i);
165 if (state.mValue == value) return state;
167 throw new RuntimeException("state not found ["+value+"]");
169 public String toString() {
178 * Linphone core SIP transport ports.
179 * Use with {@link LinphoneCore#setSignalingTransportPorts(Transports)}
180 * @ingroup initializing
182 static public class Transports {
184 * udp port to listening on, negative value if not set
188 * tcp port to listening on, negative value if not set
192 * tls port to listening on, negative value if not set
196 public Transports() {};
197 public Transports(Transports t) {
202 public String toString() {
203 return "udp["+udp+"] tcp["+tcp+"] tls["+tls+"]";
207 * Media (RTP) encryption enum-like.
210 static public final class MediaEncryption {
212 static private Vector<MediaEncryption> values = new Vector<MediaEncryption>();
216 static public final MediaEncryption None = new MediaEncryption(0,"None");
220 static public final MediaEncryption SRTP = new MediaEncryption(1,"SRTP");
224 static public final MediaEncryption ZRTP = new MediaEncryption(2,"ZRTP");
225 protected final int mValue;
226 private final String mStringValue;
229 private MediaEncryption(int value,String stringValue) {
231 values.addElement(this);
232 mStringValue=stringValue;
234 public static MediaEncryption fromInt(int value) {
236 for (int i=0; i<values.size();i++) {
237 MediaEncryption menc = (MediaEncryption) values.elementAt(i);
238 if (menc.mValue == value) return menc;
240 throw new RuntimeException("MediaEncryption not found ["+value+"]");
242 public String toString() {
247 * EC Calibrator Status
249 static public class EcCalibratorStatus {
251 static private Vector<EcCalibratorStatus> values = new Vector<EcCalibratorStatus>();
252 /* Do not change the values of these constants or the strings associated with them to prevent breaking
253 the collection of echo canceller calibration results during the wizard! */
254 public static final int IN_PROGRESS_STATUS=0;
255 public static final int DONE_STATUS=1;
256 public static final int FAILED_STATUS=2;
257 public static final int DONE_NO_ECHO_STATUS=3;
259 * Calibration in progress
261 static public EcCalibratorStatus InProgress = new EcCalibratorStatus(IN_PROGRESS_STATUS,"InProgress");
263 * Calibration done that produced an echo delay measure
265 static public EcCalibratorStatus Done = new EcCalibratorStatus(DONE_STATUS,"Done");
269 static public EcCalibratorStatus Failed = new EcCalibratorStatus(FAILED_STATUS,"Failed");
271 * Calibration done with no echo detected
273 static public EcCalibratorStatus DoneNoEcho = new EcCalibratorStatus(DONE_NO_ECHO_STATUS, "DoneNoEcho");
275 private final int mValue;
276 private final String mStringValue;
279 private EcCalibratorStatus(int value,String stringValue) {
281 values.addElement(this);
282 mStringValue=stringValue;
284 public static EcCalibratorStatus fromInt(int value) {
286 for (int i=0; i<values.size();i++) {
287 EcCalibratorStatus status = (EcCalibratorStatus) values.elementAt(i);
288 if (status.mValue == value) return status;
290 throw new RuntimeException("status not found ["+value+"]");
292 public String toString() {
300 static public class UpnpState {
301 static private Vector<UpnpState> values = new Vector<UpnpState>();
305 static public UpnpState Idle = new UpnpState(0, "Idle");
309 static public UpnpState Pending = new UpnpState(1, "Pending");
313 static public UpnpState Adding = new UpnpState(2, "Adding");
317 static public UpnpState Removing = new UpnpState(3, "Removing");
321 static public UpnpState NotAvailable = new UpnpState(4, "Not available");
325 static public UpnpState Ok = new UpnpState(5, "Ok");
329 static public UpnpState Ko = new UpnpState(6, "Ko");
330 protected final int mValue;
331 private final String mStringValue;
333 private UpnpState(int value, String stringValue) {
335 values.addElement(this);
336 mStringValue = stringValue;
338 public static UpnpState fromInt(int value) {
339 for (int i = 0; i < values.size(); i++) {
340 UpnpState mstate = (UpnpState) values.elementAt(i);
341 if (mstate.mValue == value) return mstate;
343 throw new RuntimeException("UpnpState not found [" + value + "]");
345 public String toString() {
351 * Set the context of creation of the LinphoneCore.
353 public void setContext(Object context);
356 * clear all added proxy configs
358 public void clearProxyConfigs();
360 * Add a proxy configuration. This will start registration on the proxy, if registration is enabled.
362 * @throws LinphoneCoreException
364 public void addProxyConfig(LinphoneProxyConfig proxyCfg) throws LinphoneCoreException;
366 * Sets the default proxy.
368 * This default proxy must be part of the list of already entered {@link LinphoneProxyConfig}.
369 * Toggling it as default will make LinphoneCore use the identity associated with the proxy configuration in all incoming and outgoing calls.
372 public void setDefaultProxyConfig(LinphoneProxyConfig proxyCfg);
375 * get he default proxy configuration, that is the one used to determine the current identity.
376 * @return null if no default proxy config
378 public LinphoneProxyConfig getDefaultProxyConfig() ;
381 * clear all the added auth info
383 void clearAuthInfos();
385 * Adds authentication information to the LinphoneCore.
386 * <br>This information will be used during all SIP transacations that require authentication.
389 void addAuthInfo(LinphoneAuthInfo info);
392 * Build an address according to the current proxy config. In case destination is not a sip address, the default proxy domain is automatically appended
395 * @throws If no LinphoneAddress can be built from destination
397 public LinphoneAddress interpretUrl(String destination) throws LinphoneCoreException;
400 * Starts a call given a destination. Internally calls {@link #interpretUrl(String)} then {@link #invite(LinphoneAddress)}.
403 public LinphoneCall invite(String destination)throws LinphoneCoreException;
405 * Initiates an outgoing call given a destination LinphoneAddress
406 *<br>The LinphoneAddress can be constructed directly using {@link LinphoneCoreFactory#createLinphoneAddress} , or created {@link LinphoneCore#interpretUrl(String)}. .
407 * @param to the destination of the call (sip address).
408 * @return linphone call
409 * @throws LinphoneCoreException if linphone call cannot be created
411 public LinphoneCall invite(LinphoneAddress to)throws LinphoneCoreException;
414 * @param aCall to be terminated
416 public void terminateCall(LinphoneCall aCall);
418 * Declines an incoming call, providing a reason for declining it.
419 * @param call the LinphoneCall, must be in the {@link LinphoneCall.State#IncomingReceived} state.
420 * @param reason the reason for rejecting the call: {@link Reason#Declined} or {@link Reason#Busy}
422 public void declineCall(LinphoneCall aCall, Reason reason);
424 * Returns The LinphoneCall the current call if one is in call
427 public LinphoneCall getCurrentCall();
430 * get current call remote address in case of in/out call
431 * @return null if no call engaged yet
433 public LinphoneAddress getRemoteAddress();
436 * @return true if there is a call running or pending.
438 public boolean isIncall();
441 * @return Returns true if in incoming call is pending, ie waiting for being answered or declined.
443 public boolean isInComingInvitePending();
445 * Main loop function. It is crucial that your application call it periodically.
447 * #iterate() performs various backgrounds tasks:
448 * <li>receiving of SIP messages
449 * <li> handles timers and timeout
450 * <li> performs registration to proxies
451 * <li> authentication retries The application MUST call this function from periodically, in its main loop.
452 * <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.
455 public void iterate();
457 * Accept an incoming call.
459 * Basically the application is notified of incoming calls within the
460 * {@link LinphoneCoreListener#callState} listener method.
461 * The application can later respond positively to the call using
463 * @throws LinphoneCoreException
465 public void acceptCall(LinphoneCall aCall) throws LinphoneCoreException;
468 * Accept an incoming call.
470 * Basically the application is notified of incoming calls within the
471 * {@link LinphoneCoreListener#callState} listener method.
472 * The application can later respond positively to the call using
474 * @throws LinphoneCoreException
476 public void acceptCallWithParams(LinphoneCall aCall, LinphoneCallParams params) throws LinphoneCoreException;
479 * Accept call modifications initiated by other end.
481 * Basically the application is notified of incoming calls within the
482 * {@link LinphoneCoreListener#callState} listener method.
483 * The application can later respond positively to the call using
485 * @throws LinphoneCoreException
487 public void acceptCallUpdate(LinphoneCall aCall, LinphoneCallParams params) throws LinphoneCoreException;
491 * Prevent LinphoneCore from performing an automatic answer
493 * Basically the application is notified of incoming calls within the
494 * {@link LinphoneCoreListener#callState} listener method.
495 * The application can later respond positively to the call using
497 * @throws LinphoneCoreException
499 public void deferCallUpdate(LinphoneCall aCall) throws LinphoneCoreException;
502 * @return a list of LinphoneCallLog
504 public LinphoneCallLog[] getCallLogs();
507 * This method is called by the application to notify the Linphone core library when network is reachable.
508 * Calling this method with true trigger Linphone to initiate a registration process for all proxy
509 * configuration with parameter register set to enable.
510 * This method disable the automatic registration mode. It means you must call this method after each network state changes
511 * @param network state
514 public void setNetworkReachable(boolean isReachable);
516 * Get network state has known by {@link LinphoneCore}
517 * @return if false, there is no network connection.
519 public boolean isNetworkReachable();
521 * destroy linphone core and free all underlying resources
523 public void destroy();
525 * Allow to control play level before entering sound card:
528 public void setPlaybackGain(float gain);
530 * get play level before entering sound card:
531 * @return level in db
533 public float getPlaybackGain();
536 * @param level [0..100]
538 public void setPlayLevel(int level);
540 * get playback level [0..100];
541 * -1 if not cannot be determined
544 public int getPlayLevel();
546 * Mutes or unmutes the local microphone.
549 void muteMic(boolean isMuted);
552 * @return true is mic is muted
554 boolean isMicMuted();
557 * Initiate a dtmf signal if in call
558 * @param send dtmf ['0'..'9'] | '#', '*'
560 void sendDtmf(char number);
562 * Initiate a dtmf signal to the speaker if not in call.
563 * Sending of the DTMF is done in another function.
564 * @param dtmf ['0'..'9'] | '#', '*'
565 * @param duration in ms , -1 for unlimited
567 void playDtmf(char dtmf,int duration);
574 * remove all call logs
576 void clearCallLogs();
582 * Get payload type from mime type and clock rate
584 * This function searches in audio and video codecs for the given payload type name and clockrate.
585 * @param mime payload mime type (I.E SPEEX, PCMU, VP8)
586 * @param clockRate (I.E 8000, 16000, 90000, ...)
587 * @param channels number of channels
588 * @return Returns null if not found.
590 PayloadType findPayloadType(String mime, int clockRate, int channels);
592 * get payload type from mime type and clock rate..
593 * Same as @{link {@link #findPayloadType(String, int, int)} but ignoring channels params
594 * @param mime payload mime type (I.E SPEEX, PCMU, VP8)
595 * @param clockRate (I.E 8000, 16000, 90000, ...)
596 * @return null if not found
598 PayloadType findPayloadType(String mime, int clockRate);
601 * get payload type from mime type
602 * Same as @{link {@link #findPayloadType(String, int, int)} but ignoring channels and clock rate params
603 * @param mime payload mime type (I.E SPEEX, PCMU, VP8)
604 * @return null if not found
606 PayloadType findPayloadType(String mime);
609 * Enable payload type
610 * @param pt payload type to enable, can be retrieve from {@link #findPayloadType}
611 * @param true if enabled
612 * @exception LinphoneCoreException
615 void enablePayloadType(PayloadType pt, boolean enable) throws LinphoneCoreException;
617 * Enables or disable echo cancellation.
620 void enableEchoCancellation(boolean enable);
623 * @return true if echo cancellation is enabled.
625 boolean isEchoCancellationEnabled();
627 * Get echo limiter status (another method of doing echo suppression, more brute force)
628 * @return true if echo limiter is enabled
630 boolean isEchoLimiterEnabled();
632 * Set transport ports linphone core will listen on
633 * @param local transports ports used for signaling (TCP, UDP and TLS)
635 void setSignalingTransportPorts(Transports transports);
637 * @return transports used for signaling (TCP, UDP, TLS)
639 Transports getSignalingTransportPorts();
642 * Assign a dscp value for the SIP socket.
643 * DSCP is an IP packet field used to indicate the type of routing service to routers.
646 void setSipDscp(int dscp);
649 * Get DSCP used for SIP socket.
650 * @return the DSCP value used for the SIP socket.
655 * Activates or deactivates the speaker.
658 void enableSpeaker(boolean value);
660 * Tells whether the speaker is activated.
661 * @return true if speaker enabled, false otherwise
663 boolean isSpeakerEnabled();
665 * add a friend to the current buddy list, if subscription attribute is set, a SIP SUBSCRIBE message is sent.
666 * @param lf LinphoenFriend to add
667 * @throws LinphoneCoreException
669 void addFriend(LinphoneFriend lf) throws LinphoneCoreException;
672 * Set my presence status
673 * @param minute_away how long in away
674 * @param status sip uri used to redirect call in state LinphoneStatusMoved
676 void setPresenceInfo(int minute_away,String alternative_contact, OnlineStatus status);
678 * Create a new chat room for messaging from a sip uri like sip:joe@sip.linphone.org
679 * @param to destination address for messages
681 * @return {@link LinphoneChatRoom} where messaging can take place.
683 LinphoneChatRoom createChatRoom(String to);
685 * Set the native video window id where the video is to be displayed.
686 * On Android, it must be of type {@link AndroidVideoWindowImpl}
687 * @param video window of type {@link AndroidVideoWindowImpl}
689 void setVideoWindow(Object w);
691 * Set the native video window id where the video preview is to be displayed.
692 * On Android, it must of type {@link SurfaceView}
693 * @param video window of type {@link SurfaceView}
695 void setPreviewWindow(Object w);
697 * Tells the core the device current orientation. This can be used by capture filters
698 * on mobile devices to select between portrait/landscape mode and to produce properly
699 * oriented images. The exact meaning of the value in rotation if left to each device
700 * specific implementations.
701 *@param rotation . Android supported values are 0, 90, 180 and 270.
704 void setDeviceRotation(int rotation);
706 * Sets the active video device.
708 * @param id of the video device as returned by {@link AndroidCameraConfiguration#retrieveCameras}
710 void setVideoDevice(int id);
712 * Returns the id of the currently active video device as found in {@link AndroidCameraConfiguration#retrieveCameras}.
714 int getVideoDevice();
717 * Enables video globally.
720 * This function does not have any effect during calls. It just indicates #LinphoneCore to
721 * initiate future calls with video or not. The two boolean parameters indicate in which
722 * direction video is enabled. Setting both to false disables video entirely.
724 * @param vcap_enabled indicates whether video capture is enabled
725 * @param display_enabled indicates whether video display should be shown
728 void enableVideo(boolean vcap_enabled, boolean display_enabled);
730 * Returns TRUE if video is enabled, FALSE otherwise.
733 boolean isVideoEnabled();
736 * Specify a STUN server to help firewall traversal.
737 * @param stun_server Stun server address and port, such as stun.linphone.org or stun.linphone.org:3478
739 void setStunServer(String stun_server);
742 * @return stun server address if previously set.
744 String getStunServer();
747 * Sets policy regarding workarounding NATs
748 * @param pol one of the FirewallPolicy members.
750 void setFirewallPolicy(FirewallPolicy pol);
752 * @return previously set firewall policy.
754 FirewallPolicy getFirewallPolicy();
756 * Initiates an outgoing call given a destination LinphoneAddress
758 * @param addr the destination of the call {@link #LinphoneAddress }.
759 * @param params call parameters {@link #LinphoneCallParams }
761 *<br>The LinphoneAddress can be constructed directly using {@link LinphoneCoreFactory#createLinphoneAddress} , or created {@link LinphoneCore#interpretUrl(String)}. .
763 * @return a {@link #LinphoneCall LinphoneCall} object
764 * @throws LinphoneCoreException in case of failure
766 LinphoneCall inviteAddressWithParams(LinphoneAddress destination, LinphoneCallParams params) throws LinphoneCoreException ;
768 * Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore.
770 * In this version this is limited to the following use cases:
771 * - setting up/down the video stream according to the video parameter of the {@link LinphoneCallParams} (see {@link LinphoneCallParams#enableVideo} ).
772 * - changing the size of the transmitted video after calling {@link LinphoneCore#setPreferredVideoSize(VideoSize)}
774 * In case no changes are requested through the {@link LinphoneCallParams} argument, then this argument can be omitted and set to null.
775 * @param call the {@link LinphoneCall} to be updated
776 * @param params the new {@link LinphoneCallParams call parameters} to use. (may be NULL)
777 * @return 0 if successful, -1 otherwise.
779 int updateCall(LinphoneCall call, LinphoneCallParams params);
781 * Get default call parameters reflecting current linphone core configuration
782 * @return LinphoneCallParams
784 LinphoneCallParams createDefaultCallParameters();
787 * Sets the path to a wav file used for ringing.
789 * @param path The file must be a wav 16bit linear. Local ring is disabled if null
791 void setRing(String path);
793 * gets the path to a wav file used for ringing.
795 * @return null if not set
800 * Sets file or folder containing trusted root CAs
802 * @param path path to file with multiple PEM certif or to folder with multiple PEM files
804 void setRootCA(String path);
806 void setUploadBandwidth(int bw);
808 * Sets maximum available download bandwidth
811 * This is IP bandwidth, in kbit/s.
812 * This information is used signaled to other parties during
813 * calls (within SDP messages) so that the remote end can have
814 * sufficient knowledge to properly configure its audio & video
815 * codec output bitrate to not overflow available bandwidth.
817 * @param bw the bandwidth in kbits/s, 0 for infinite
819 void setDownloadBandwidth(int bw);
822 * Sets audio packetization interval suggested for remote end.
823 * @param ptime packetization interval in milliseconds
825 void setDownloadPtime(int ptime);
828 * Sets audio packetization interval sent to remote end.
829 * @param ptime packetization interval in milliseconds
831 void setUploadPtime(int ptime);
833 * Sets the preferred video size.
835 * This applies only to the stream that is captured and sent to the remote party,
836 * since we accept all standard video size on the receive path.
840 void setPreferredVideoSize(VideoSize vSize);
842 * get current preferred video size for sending.
846 VideoSize getPreferredVideoSize();
849 * Returns the currently supported audio codecs, as PayloadType elements
852 PayloadType[] getAudioCodecs();
854 * Returns the currently supported video codecs, as PayloadType elements
857 PayloadType[] getVideoCodecs();
859 * enable signaling keep alive. small udp packet sent periodically to keep udp NAT association
861 void enableKeepAlive(boolean enable);
863 * get keep elive mode
864 * @return true if enable
866 boolean isKeepAliveEnabled();
868 * Start an echo calibration of the sound devices, in order to find adequate settings for the echo canceler automatically.
869 * status is notified to {@link LinphoneCoreListener#ecCalibrationStatus(EcCalibratorStatus, int, Object)}
871 * @throws LinphoneCoreException if operation is still in progress;
873 void startEchoCalibration(Object data) throws LinphoneCoreException;
876 * Returns true if echo calibration is recommended.
877 * If the device has a builtin echo canceller or calibration value is already known, it will return false.
879 boolean needsEchoCalibration();
881 void enableIpv6(boolean enable);
886 void adjustSoftwareVolume(int i);
889 * Pauses a call. If a music file has been setup using {@link LinphoneCore#setPlayFile(String)},
890 * this file will be played to the remote user.
893 boolean pauseCall(LinphoneCall call);
897 boolean resumeCall(LinphoneCall call);
899 * Pause all currently running calls.
901 boolean pauseAllCalls();
903 void setZrtpSecretsCache(String file);
904 void enableEchoLimiter(boolean val);
907 * Indicates whether the local user is part of the conference.
909 boolean isInConference();
911 * Moves the local participant inside the conference.
913 * Makes the local participant to join the conference.
914 * Typically, the local participant is by default always part of the conference when joining an active call into a conference.
915 * However, by calling {@link #leaveConference()} and {@link #enterConference()} the application can decide to temporarily
916 * move out and in the local participant from the conference.
918 * @returns true if successful
920 boolean enterConference();
922 * Moves the local participant out of the conference.
923 * When the local participant is out of the conference, the remote participants can continue to talk normally.
925 void leaveConference();
928 * Merge a call into a conference.
930 * If this is the first call that enters the conference, the virtual conference will be created automatically.
931 * If the local user was actively part of the call (ie not in paused state), then the local user is automatically entered into the conference.
932 * If the call was in paused state, then it is automatically resumed when entering into the conference.
933 * @param call an established call, either in {@link LinphoneCall.State#StreamsRunning} or {@link LinphoneCall.State#Paused} state.
936 void addToConference(LinphoneCall call);
938 * Remove a call from the conference.
939 * @param call a call that has been previously merged into the conference.
941 * After removing the remote participant belonging to the supplied call, the call becomes a normal call in paused state.
942 * If one single remote participant is left alone together with the local user in the conference after the removal, then the conference is
943 * automatically transformed into a simple call in StreamsRunning state.
944 * The conference's resources are then automatically destroyed.
946 * In other words, unless {@link #leaveConference()} is explicitely called, the last remote participant of a conference is automatically
947 * put in a simple call in running state.
950 void removeFromConference(LinphoneCall call);
952 * Add all calls into a conference.
954 * Merge all established calls (either in {@link LinphoneCall.State#StreamsRunning} or {@link LinphoneCall.State#Paused}) into a conference.
957 void addAllToConference();
960 * Terminates the conference and the calls associated with it.
962 * All the calls that were merged to the conference are terminated, and the conference resources are destroyed.
965 void terminateConference();
967 * Returns the number of participants to the conference, including the local participant.
969 * Typically, after merging two calls into the conference, there is total of 3 participants:
970 * the local participant (or local user), and two remote participants that were the destinations of the two previously establised calls.
972 * @returns the number of participants to the conference
974 int getConferenceSize();
977 * Request recording of the conference into a supplied file path.
979 * @param path where to write recording file
981 void startConferenceRecording(String path);
984 * Stop recording of the conference.
986 void stopConferenceRecording();
988 * Terminates all the calls.
990 void terminateAllCalls();
993 * @return an array with all call currently handle by Linphone core
995 LinphoneCall[] getCalls();
997 * Get number of calls currently handled by Linphone core
998 * @returns number of calls
1003 * Performs a simple call transfer to the specified destination.
1005 * @param call The current local call remains active and thus can be later paused or terminated.
1006 * @param referTo The remote call party endpoint is expected to issue a new call to this specified destination.
1008 void transferCall(LinphoneCall call, String referTo);
1010 * Transfer a call to destination of another running call. This is used for "attended transfer" scenarios.
1011 * The transfered call is supposed to be in paused state, so that it is able to accept the transfer immediately.
1012 * The destination call is a call previously established to introduce the transfered person.
1013 * This method will send a transfer request to the transfered person. The phone of the transfered is then
1014 * expected to automatically call to the destination of the transfer. The receiver of the transfer will then automatically
1015 * close the call with us (the 'dest' call).
1016 * @param call a running call you want to transfer
1017 * @param dest a running call whose remote person will receive the transfer
1019 void transferCallToAnother(LinphoneCall callToTransfer, LinphoneCall destination);
1021 * Search from the list of current calls if a remote address match uri
1022 * @param uri which should match call remote uri
1023 * @return LinphoneCall or NULL is no match is found
1025 LinphoneCall findCallFromUri(String uri);
1027 * Get the maximum number of simultaneous calls Linphone core can manage at a time. All new call above this limit are declined with a busy answer
1028 * @return max number of simultaneous calls
1032 * Set the maximum number of simultaneous calls Linphone core can manage at a time. All new call above this limit are declined with a busy answer
1033 * @param max number of simultaneous calls
1035 void setMaxCalls(int max);
1041 boolean isMyself(String uri);
1044 * Use this method to check the calls state and forbid proposing actions
1045 * which could result in an active call.
1046 * Eg: don't start a new call if one is in outgoing ringing.
1047 * Eg: don't merge to conference either as it could result
1048 * in two active calls (conference and accepted call).
1051 boolean soundResourcesLocked();
1053 * Returns whether given media encryption is supported by liblinphone.
1055 boolean mediaEncryptionSupported(MediaEncryption menc);
1057 * set media encryption (rtp) to use
1058 * @params menc: MediaEncryption.None, MediaEncryption.SRTP or MediaEncryption.ZRTP
1060 void setMediaEncryption(MediaEncryption menc);
1062 * return selected media encryption
1063 * @return MediaEncryption.None, MediaEncryption.SRTP or MediaEncryption.ZRTP
1065 MediaEncryption getMediaEncryption();
1067 * Set media encryption required for outgoing calls
1069 void setMediaEncryptionMandatory(boolean yesno);
1071 * @return if media encryption is required for outgoing calls
1073 boolean isMediaEncryptionMandatory();
1076 * @param path path to music file played to remote side when on hold.
1078 void setPlayFile(String path);
1079 void tunnelEnable(boolean enable);
1080 void tunnelAutoDetect();
1081 void tunnelCleanServers();
1082 void tunnelSetHttpProxy(String proxy_host, int port, String username, String password);
1084 * @param host tunnel server ip address
1085 * @param port tunnel server tls port, recommended value is 443
1086 * @param udpMirrorPort remote port on the tunnel server side used to test udp reachability
1087 * @param roundTripDelay udp packet round trip delay in ms considered as acceptable. recommended value is 1000 ms
1089 void tunnelAddServerAndMirror(String host, int port, int udpMirrorPort, int roundTripDelay);
1091 boolean isTunnelAvailable();
1093 * Returns an unmodifiable list of entered proxy configurations.
1094 * @return list of proxy config
1096 LinphoneProxyConfig[] getProxyConfigList();
1098 * Sets the default policy for video.
1099 * This policy defines whether:
1100 * @param autoInitiate video shall be initiated by default for outgoing calls
1101 * @param autoAccept video shall be accepter by default for incoming calls
1103 void setVideoPolicy(boolean autoInitiate, boolean autoAccept);
1104 /** Set static picture to be used when "Static picture" is the video device
1105 * @param path to the static picture file
1107 void setStaticPicture(String path);
1109 * Sets the user agent string used in SIP messages.
1110 * @param user agent name
1111 * @param user agent version
1113 void setUserAgent(String name, String version);
1115 * Set the number of cores used for media processing
1117 void setCpuCount(int count);
1122 public void removeCallLog(LinphoneCallLog log);
1125 * @return count of missed calls
1127 public int getMissedCallsCount();
1130 * Set missed calls count to zero
1132 public void resetMissedCallsCount();
1134 * re-initiates registration if network is up.
1136 public void refreshRegisters();
1139 * return the version code of linphone core
1141 public String getVersion();
1144 * remove a linphone friend from linphone core and linphonerc
1146 void removeFriend(LinphoneFriend lf);
1149 * return a linphone friend (if exists) that matches the sip address
1151 LinphoneFriend findFriendByAddress(String sipUri);
1154 * Sets the UDP port used for audio streaming.
1156 void setAudioPort(int port);
1159 * Sets the UDP port range from which to randomly select the port used for audio streaming.
1161 void setAudioPortRange(int minPort, int maxPort);
1164 * Assign a DSCP value to the audio RTP sockets.
1165 * @param dscp the DSCP value.
1166 * DSCP is an IP header field used to indicate a type of service to routers.
1168 void setAudioDscp(int dscp);
1171 * Return DSCP value used for the audio RTP sockets.
1172 * @return the DSCP value used for the audio RTP sockets.
1177 * Sets the UDP port used for video streaming.
1179 void setVideoPort(int port);
1182 * Sets the UDP port range from which to randomly select the port used for video streaming.
1184 void setVideoPortRange(int minPort, int maxPort);
1187 * Assign a DSCP value to the video RTP sockets.
1188 * @param dscp the DSCP value.
1189 * DSCP is an IP header field used to indicate a type of service to routers.
1191 void setVideoDscp(int dscp);
1194 * Return DSCP value used for the video RTP sockets.
1195 * @return the DSCP value used for the video RTP sockets.
1200 * Set the incoming call timeout in seconds.
1201 * If an incoming call isn't answered for this timeout period, it is
1202 * automatically declined.
1204 void setIncomingTimeout(int timeout);
1207 * Set the call timeout in seconds.
1208 * Once this time is elapsed (ringing included), the call is automatically hung up.
1210 void setInCallTimeout(int timeout);
1212 * Allow to control microphone level:
1215 void setMicrophoneGain(float gain);
1218 * Set username and display name to use if no LinphoneProxyConfig configured
1220 void setPrimaryContact(String displayName, String username);
1223 * Enable/Disable the use of SIP INFO for DTMFs
1225 void setUseSipInfoForDtmfs(boolean use);
1228 * Enable/Disable the use of inband DTMFs
1230 void setUseRfc2833ForDtmfs(boolean use);
1233 * @return returns LpConfig object to read/write to the config file: usefull if you wish to extend
1234 * the config file with your own sections
1236 LpConfig getConfig();
1240 * Return the availability of uPnP.
1242 * @return true if uPnP is available otherwise return false.
1244 public boolean upnpAvailable();
1247 * Return the internal state of uPnP.
1249 * @return an UpnpState.
1251 public UpnpState getUpnpState();
1254 * Return the external ip address of router.
1255 * In some cases the uPnP can have an external ip address but not a usable uPnP
1256 * (state different of Ok).
1258 * @return a null terminated string containing the external ip address. If the
1259 * the external ip address is not available return null.
1261 public String getUpnpExternalIpaddress();