/* * Copyright (c) 2010-2019 Belledonne Communications SARL. * * This file is part of Liblinphone. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef LINPHONE_TYPES_H_ #define LINPHONE_TYPES_H_ #include "ortp/payloadtype.h" #include "mediastreamer2/msinterfaces.h" #include "mediastreamer2/msvideo.h" #include "linphone/defs.h" // For migration purpose. #include "linphone/api/c-types.h" /** * The #LinphoneAccountCreator object used to configure an account on a server via XML-RPC. * @ingroup account_creator **/ typedef struct _LinphoneAccountCreator LinphoneAccountCreator; /** * An object to define a #LinphoneAccountCreator service. * @ingroup account_creator * @donotwrap **/ typedef struct _LinphoneAccountCreatorService LinphoneAccountCreatorService; /** * An object to handle the responses callbacks for handling the #LinphoneAccountCreator operations. * @ingroup account_creator **/ typedef struct _LinphoneAccountCreatorCbs LinphoneAccountCreatorCbs; /** * Enum describing Phone number checking. * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorPhoneNumberStatus { LinphoneAccountCreatorPhoneNumberStatusOk = 0x1, /**< Phone number ok */ LinphoneAccountCreatorPhoneNumberStatusTooShort = 0x2, /**< Phone number too short */ LinphoneAccountCreatorPhoneNumberStatusTooLong = 0x4, /**< Phone number too long */ LinphoneAccountCreatorPhoneNumberStatusInvalidCountryCode = 0x8, /**< Country code invalid */ LinphoneAccountCreatorPhoneNumberStatusInvalid = 0x10 /**< Phone number invalid */ } LinphoneAccountCreatorPhoneNumberStatus; /** * A mask of #LinphoneAccountCreatorPhoneNumberStatus values * @ingroup account_creator */ typedef unsigned int LinphoneAccountCreatorPhoneNumberStatusMask; /** * Enum describing Username checking. * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorUsernameStatus { LinphoneAccountCreatorUsernameStatusOk, /**< Username ok */ LinphoneAccountCreatorUsernameStatusTooShort, /**< Username too short */ LinphoneAccountCreatorUsernameStatusTooLong, /**< Username too long */ LinphoneAccountCreatorUsernameStatusInvalidCharacters, /**< Contain invalid characters */ LinphoneAccountCreatorUsernameStatusInvalid /**< Invalid username */ } LinphoneAccountCreatorUsernameStatus; /** * Enum describing Email checking. * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorEmailStatus { LinphoneAccountCreatorEmailStatusOk, /**< Email ok */ LinphoneAccountCreatorEmailStatusMalformed, /**< Email malformed */ LinphoneAccountCreatorEmailStatusInvalidCharacters /**< Contain invalid characters */ } LinphoneAccountCreatorEmailStatus; /** * Enum describing Password checking. * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorPasswordStatus { LinphoneAccountCreatorPasswordStatusOk, /**< Password ok */ LinphoneAccountCreatorPasswordStatusTooShort, /**< Password too short */ LinphoneAccountCreatorPasswordStatusTooLong, /**< Password too long */ LinphoneAccountCreatorPasswordStatusInvalidCharacters, /**< Contain invalid characters */ LinphoneAccountCreatorPasswordStatusMissingCharacters /**< Missing specific characters */ } LinphoneAccountCreatorPasswordStatus; /** * Enum describing language checking. * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorLanguageStatus { LinphoneAccountCreatorLanguageStatusOk /**< Language ok */ } LinphoneAccountCreatorLanguageStatus; /** * Enum algorithm checking. * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorAlgoStatus { LinphoneAccountCreatorAlgoStatusOk, /**< Algorithm ok */ LinphoneAccountCreatorAlgoStatusNotSupported /**< Algorithm not supported */ } LinphoneAccountCreatorAlgoStatus; /** * Enum describing Activation code checking. * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorActivationCodeStatus { LinphoneAccountCreatorActivationCodeStatusOk, /**< Activation code ok */ LinphoneAccountCreatorActivationCodeStatusTooShort, /**< Activation code too short */ LinphoneAccountCreatorActivationCodeStatusTooLong, /**< Activation code too long */ LinphoneAccountCreatorActivationCodeStatusInvalidCharacters /**< Contain invalid characters */ } LinphoneAccountCreatorActivationCodeStatus; /** * Enum describing Domain checking * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorDomainStatus { LinphoneAccountCreatorDomainOk, /**< Domain ok */ LinphoneAccountCreatorDomainInvalid /**< Domain invalid */ } LinphoneAccountCreatorDomainStatus; /** * Enum describing Transport checking * @ingroup account_creator **/ typedef enum _LinphoneAccountCreatorTransportStatus { LinphoneAccountCreatorTransportOk, /**< Transport ok */ LinphoneAccountCreatorTransportUnsupported /**< Transport invalid */ } LinphoneAccountCreatorTransportStatus; /** * Enum describing the status of server request. * @ingroup account_creator_request **/ typedef enum _LinphoneAccountCreatorStatus { /** Request status **/ LinphoneAccountCreatorStatusRequestOk, /**< Request passed */ LinphoneAccountCreatorStatusRequestFailed, /**< Request failed */ LinphoneAccountCreatorStatusMissingArguments, /**< Request failed due to missing argument(s) */ LinphoneAccountCreatorStatusMissingCallbacks, /**< Request failed due to missing callback(s) */ /** Account status **/ /* Creation */ LinphoneAccountCreatorStatusAccountCreated, /**< Account created */ LinphoneAccountCreatorStatusAccountNotCreated, /**< Account not created */ /* Existence */ LinphoneAccountCreatorStatusAccountExist, /**< Account exist */ LinphoneAccountCreatorStatusAccountExistWithAlias, /**< Account exist with alias */ LinphoneAccountCreatorStatusAccountNotExist, /**< Account not exist */ LinphoneAccountCreatorStatusAliasIsAccount, /**< Account was created with Alias */ LinphoneAccountCreatorStatusAliasExist, /**< Alias exist */ LinphoneAccountCreatorStatusAliasNotExist, /**< Alias not exist */ /* Activation */ LinphoneAccountCreatorStatusAccountActivated, /**< Account activated */ LinphoneAccountCreatorStatusAccountAlreadyActivated, /**< Account already activated */ LinphoneAccountCreatorStatusAccountNotActivated, /**< Account not activated */ /* Linking */ LinphoneAccountCreatorStatusAccountLinked, /**< Account linked */ LinphoneAccountCreatorStatusAccountNotLinked, /**< Account not linked */ /** Server **/ LinphoneAccountCreatorStatusServerError, /**< Error server */ LinphoneAccountCreatorStatusPhoneNumberInvalid, /**< Error cannot send SMS */ LinphoneAccountCreatorStatusWrongActivationCode, /**< Error key doesn't match */ LinphoneAccountCreatorStatusPhoneNumberOverused, /**< Error too many SMS sent */ LinphoneAccountCreatorStatusAlgoNotSupported, /** < Error algo isn't MD5 or SHA-256 */ LinphoneAccountCreatorStatusUnexpectedError, /** < Generic error */ } LinphoneAccountCreatorStatus; /** * Enum describing Ip family. * @ingroup initializing **/ typedef enum _LinphoneAddressFamily { LinphoneAddressFamilyInet, /**< IpV4 */ LinphoneAddressFamilyInet6, /**< IpV6 */ LinphoneAddressFamilyUnspec, /**< Unknown */ } LinphoneAddressFamily; /** * Enum describing type of audio route. * @ingroup call_control **/ typedef enum _LinphoneAudioRoute { LinphoneAudioRouteEarpiece, LinphoneAudioRouteSpeaker } LinphoneAudioRoute; /** * Object holding authentication information. * * @note The object's fields should not be accessed directly. Prefer using * the accessor methods. * * In most case, authentication information consists of a username and password. * Sometimes, a userid is required by proxy, and realm can be useful to discriminate * different SIP domains. * * Once created and filled, a #LinphoneAuthInfo must be added to the #LinphoneCore in * order to become known and used automatically when needed. * Use linphone_core_add_auth_info() for that purpose. * * The #LinphoneCore object can take the initiative to request authentication information * when needed to the application through the auth_info_requested callback of the * #LinphoneCoreVTable structure. * * The application can respond to this information request later using * linphone_core_add_auth_info(). This will unblock all pending authentication * transactions and retry them with authentication headers. * * @ingroup authentication **/ typedef struct _LinphoneAuthInfo LinphoneAuthInfo; /** * Enum describing the authentication methods * @ingroup network_parameters **/ typedef enum _LinphoneAuthMethod { LinphoneAuthHttpDigest, /**< Digest authentication requested */ LinphoneAuthTls, /**< Client certificate requested */ } LinphoneAuthMethod; /** * Enum describing RTP AVPF activation modes. * @ingroup media_parameters **/ typedef enum _LinphoneAVPFMode { LinphoneAVPFDefault = -1, /**< Use default value defined at upper level */ LinphoneAVPFDisabled, /**< AVPF is disabled */ LinphoneAVPFEnabled /**< AVPF is enabled */ } LinphoneAVPFMode; /** * The #LinphoneContent object representing a data buffer. * @ingroup misc **/ typedef struct _LinphoneBuffer LinphoneBuffer; /** * Enum representing the direction of a call. * @ingroup call_logs **/ typedef enum _LinphoneCallDir { LinphoneCallOutgoing, /**< outgoing calls*/ LinphoneCallIncoming /**< incoming calls*/ } LinphoneCallDir; /** * Structure representing a call log. * @ingroup call_logs **/ typedef struct _LinphoneCallLog LinphoneCallLog; /** * The #LinphoneCallParams is an object containing various call related parameters. * It can be used to retrieve parameters from a currently running call or modify * the call's characteristics dynamically. * @ingroup call_control **/ typedef struct _LinphoneCallParams LinphoneCallParams; /** * The #LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams. * * To receive these informations periodically and as soon as they are computed, the application is invited to place a #LinphoneCoreCallStatsUpdatedCb callback in the #LinphoneCoreVTable structure * it passes for instanciating the #LinphoneCore object (see linphone_core_new() ). * * At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats(). * @ingroup call_misc **/ typedef struct _LinphoneCallStats LinphoneCallStats; /** * Enum representing the status of a call * @ingroup call_logs **/ typedef enum _LinphoneCallStatus { LinphoneCallSuccess, /**< The call was sucessful */ LinphoneCallAborted, /**< The call was aborted */ LinphoneCallMissed, /**< The call was missed (unanswered) */ LinphoneCallDeclined, /**< The call was declined, either locally or by remote end */ LinphoneCallEarlyAborted, /** */ LinphonePrivacyUser = 0x1, /** * Request that privacy services modify headers that cannot * be set arbitrarily by the user (Contact/Via). */ LinphonePrivacyHeader = 0x2, /** * Request that privacy services provide privacy for session * media */ LinphonePrivacySession = 0x4, /** * rfc3325 * The presence of this privacy type in * a Privacy header field indicates that the user would like the Network * Asserted Identity to be kept private with respect to SIP entities * outside the Trust Domain with which the user authenticated. Note * that a user requesting multiple types of privacy MUST include all of * the requested privacy types in its Privacy header field value * */ LinphonePrivacyId = 0x8, /** * Privacy service must perform the specified services or * fail the request * **/ LinphonePrivacyCritical = 0x10, /** * Special keyword to use privacy as defined either globally or by proxy using linphone_proxy_config_set_privacy() */ LinphonePrivacyDefault = 0x8000, } LinphonePrivacy; /* WARNING This enum MUST be kept in sync with the SalPrivacy enum from sal.h */ /** * A mask of #LinphonePrivacy values * @ingroup call_control */ typedef unsigned int LinphonePrivacyMask; /** * The #LinphoneProxyConfig object represents a proxy configuration to be used * by the #LinphoneCore object. * Its fields must not be used directly in favour of the accessors methods. * Once created and filled properly the #LinphoneProxyConfig can be given to * #LinphoneCore with linphone_core_add_proxy_config(). * This will automatically triggers the registration, if enabled. * * The proxy configuration are persistent to restarts because they are saved * in the configuration file. As a consequence, after linphone_core_new() there * might already be a list of configured proxy that can be examined with * linphone_core_get_proxy_config_list(). * * The default proxy (see linphone_core_set_default_proxy() ) is the one of the list * that is used by default for calls. * @ingroup proxies **/ typedef struct _LinphoneProxyConfig LinphoneProxyConfig; /** * Enum for publish states. * @ingroup event_api **/ typedef enum _LinphonePublishState{ LinphonePublishNone, /**< Initial state, do not use */ LinphonePublishProgress, /**< An outgoing publish was created and submitted */ LinphonePublishOk, /**< Publish is accepted */ LinphonePublishError, /**< Publish encoutered an error, linphone_event_get_reason() gives reason code */ LinphonePublishExpiring, /**< Publish is about to expire, only sent if [sip]->refresh_generic_publish property is set to 0 */ LinphonePublishCleared /**< Event has been un published */ } LinphonePublishState; /** * Enum describing various failure reasons or contextual information for some events. * @see linphone_call_get_reason() * @see linphone_proxy_config_get_error() * @see linphone_error_info_get_reason() * @ingroup misc **/ typedef enum _LinphoneReason{ LinphoneReasonNone, /**< No reason has been set by the core */ LinphoneReasonNoResponse, /**< No response received from remote */ LinphoneReasonForbidden, /**< Authentication failed due to bad credentials or resource forbidden */ LinphoneReasonDeclined, /**< The call has been declined */ LinphoneReasonNotFound, /**< Destination of the call was not found */ LinphoneReasonNotAnswered, /**< The call was not answered in time (request timeout) */ LinphoneReasonBusy, /**< Phone line was busy */ LinphoneReasonUnsupportedContent, /**< Unsupported content */ LinphoneReasonIOError, /**< Transport error: connection failures, disconnections etc... */ LinphoneReasonDoNotDisturb, /**< Do not disturb reason */ LinphoneReasonUnauthorized, /**< Operation is unauthorized because missing credential */ LinphoneReasonNotAcceptable, /**< Operation is rejected due to incompatible or unsupported media parameters */ LinphoneReasonNoMatch, /**< Operation could not be executed by server or remote client because it didn't have any context for it */ LinphoneReasonMovedPermanently, /**< Resource moved permanently */ LinphoneReasonGone, /**< Resource no longer exists */ LinphoneReasonTemporarilyUnavailable, /**< Temporarily unavailable */ LinphoneReasonAddressIncomplete, /**< Address incomplete */ LinphoneReasonNotImplemented, /**< Not implemented */ LinphoneReasonBadGateway, /**< Bad gateway */ LinphoneReasonSessionIntervalTooSmall, /**< The received request contains a Session-Expires header field with a duration below the minimum timer */ LinphoneReasonServerTimeout, /**< Server timeout */ LinphoneReasonUnknown /**< Unknown reason */ } LinphoneReason; #define LinphoneReasonBadCredentials LinphoneReasonForbidden /*for compatibility*/ #define LinphoneReasonMedia LinphoneReasonUnsupportedContent /** * #LinphoneRegistrationState describes proxy registration states. * @ingroup proxies **/ typedef enum _LinphoneRegistrationState { LinphoneRegistrationNone, /**< Initial state for registrations */ LinphoneRegistrationProgress, /**< Registration is in progress */ LinphoneRegistrationOk, /**< Registration is successful */ LinphoneRegistrationCleared, /**< Unregistration succeeded */ LinphoneRegistrationFailed /**< Registration failed */ } LinphoneRegistrationState; typedef struct _LinphoneRingtonePlayer LinphoneRingtonePlayer; /** * Linphone core SIP transport ports. * Special values #LC_SIP_TRANSPORT_RANDOM, #LC_SIP_TRANSPORT_RANDOM, #LC_SIP_TRANSPORT_DONTBIND can be used. * Use with #linphone_core_set_sip_transports * @deprecated * @donotwrap */ typedef struct _LinphoneSipTransports { int udp_port; /**< SIP/UDP port */ int tcp_port; /**< SIP/TCP port */ int dtls_port; /**< SIP/DTLS port */ int tls_port; /**< SIP/TLS port */ } LinphoneSipTransports; /** * Linphone core SIP transport ports. * Special values #LC_SIP_TRANSPORT_RANDOM, #LC_SIP_TRANSPORT_RANDOM, #LC_SIP_TRANSPORT_DONTBIND can be used. * Use with #linphone_core_set_sip_transports * @ingroup initializing */ typedef struct _LinphoneTransports LinphoneTransports; /** * Old name of #LinphoneSipTransports * @deprecated * @donotwrap */ LINPHONE_DEPRECATED typedef struct _LinphoneSipTransports LCSipTransports; typedef struct _LinphoneSoundDaemon LinphoneSoundDaemon; /** * Enum describing the stream types. * @ingroup initializing **/ typedef enum _LinphoneStreamType { LinphoneStreamTypeAudio, LinphoneStreamTypeVideo, LinphoneStreamTypeText, LinphoneStreamTypeUnknown /* WARNING: Make sure this value remains the last one in the list */ } LinphoneStreamType; /** * Enum controlling behavior for incoming subscription request. * Use by linphone_friend_set_inc_subscribe_policy() * @ingroup buddy_list */ typedef enum _LinphoneSubscribePolicy { /** * Does not automatically accept an incoming subscription request. * This policy implies that a decision has to be taken for each incoming subscription request notified by callback LinphoneCoreVTable.new_subscription_requested */ LinphoneSPWait, LinphoneSPDeny, /**< Rejects incoming subscription request */ LinphoneSPAccept /**< Automatically accepts a subscription request */ } LinphoneSubscribePolicy; /** * Enum for subscription direction (incoming or outgoing). * @ingroup event_api **/ typedef enum _LinphoneSubscriptionDir{ LinphoneSubscriptionIncoming, /**< Incoming subscription. */ LinphoneSubscriptionOutgoing, /**< Outgoing subscription. */ LinphoneSubscriptionInvalidDir /**< Invalid subscription direction. */ } LinphoneSubscriptionDir; /** * Enum for subscription states. * #LinphoneSubscriptionTerminated and #LinphoneSubscriptionError are final states. * @ingroup event_api **/ typedef enum _LinphoneSubscriptionState{ LinphoneSubscriptionNone, /**< Initial state, should not be used */ LinphoneSubscriptionOutgoingProgress, /**< An outgoing subcription was sent */ LinphoneSubscriptionIncomingReceived, /**< An incoming subcription is received */ LinphoneSubscriptionPending, /**< Subscription is pending, waiting for user approval */ LinphoneSubscriptionActive, /**< Subscription is accepted */ LinphoneSubscriptionTerminated, /**< Subscription is terminated normally */ LinphoneSubscriptionError, /**< Subscription was terminated by an error, indicated by linphone_event_get_reason() */ LinphoneSubscriptionExpiring, /**< Subscription is about to expire, only sent if [sip]->refresh_generic_subscribe property is set to 0 */ } LinphoneSubscriptionState; /** * Enum listing frequent telephony tones. * @ingroup misc **/ typedef enum _LinphoneToneID { LinphoneToneUndefined, /**< Not a tone */ LinphoneToneBusy, /**< Busy tone */ LinphoneToneCallWaiting, /** Call waiting tone */ LinphoneToneCallOnHold, /** Call on hold tone */ LinphoneToneCallLost /** Tone played when call is abruptly disconnected (media lost)*/ } LinphoneToneID; /** * Enum describing transport type for LinphoneAddress. * @ingroup linphone_address **/ typedef enum _LinphoneTransportType { LinphoneTransportUdp, LinphoneTransportTcp, LinphoneTransportTls, LinphoneTransportDtls } LinphoneTransportType; /* WARNING This enum MUST be kept in sync with the SalTransport enum from sal.h */ /** * Linphone tunnel object. * @ingroup tunnel */ typedef struct _LinphoneTunnel LinphoneTunnel; /** * @brief Tunnel settings. * @ingroup tunnel */ typedef struct _LinphoneTunnelConfig LinphoneTunnelConfig; /** * Enum describing the tunnel modes. * @ingroup tunnel **/ typedef enum _LinphoneTunnelMode { LinphoneTunnelModeDisable, /**< The tunnel is disabled */ LinphoneTunnelModeEnable, /**< The tunnel is enabled */ LinphoneTunnelModeAuto /**< The tunnel is enabled automatically if it is required */ } LinphoneTunnelMode; /** * Enum describing uPnP states. * @ingroup initializing **/ typedef enum _LinphoneUpnpState { LinphoneUpnpStateIdle, /**< uPnP is not activate */ LinphoneUpnpStatePending, /**< uPnP process is in progress */ LinphoneUpnpStateAdding, /**< Internal use: Only used by port binding */ LinphoneUpnpStateRemoving, /**< Internal use: Only used by port binding */ LinphoneUpnpStateNotAvailable, /**< uPnP is not available */ LinphoneUpnpStateOk, /**< uPnP is enabled */ LinphoneUpnpStateKo, /**< uPnP processing has failed */ LinphoneUpnpStateBlacklisted, /**< IGD router is blacklisted */ } LinphoneUpnpState; /** * The #LinphoneVcard object. * @ingroup carddav_vcard */ typedef struct _LinphoneVcard LinphoneVcard; /** * Enum describing the result of a version update check. * @ingroup misc */ typedef enum _LinphoneVersionUpdateCheckResult { LinphoneVersionUpdateCheckUpToDate, LinphoneVersionUpdateCheckNewVersionAvailable, LinphoneVersionUpdateCheckError } LinphoneVersionUpdateCheckResult; /** * The #LinphoneVideoDefinition object represents a video definition, eg. its width and its height. * @ingroup media_parameters */ typedef struct _LinphoneVideoDefinition LinphoneVideoDefinition; /** * Structure describing policy regarding video streams establishments. * @ingroup media_parameters * @deprecated * @donotwrap **/ typedef struct _LinphoneVideoPolicy { bool_t automatically_initiate; /**