/* * private_structs.h * Copyright (C) 2010-2018 Belledonne Communications SARL * * 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 2 * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRIVATE_STRUCTS_H_ #define _PRIVATE_STRUCTS_H_ #include #include #include #include #include #include "carddav.h" #include "sal/register-op.h" struct _LinphoneQualityReporting{ reporting_session_report_t * reports[3]; /**Store information on audio and video media streams (RFC 6035) */ bool_t was_video_running; /*Keep video state since last check in order to detect its (de)activation*/ LinphoneQualityReportingReportSendCb on_report_sent; }; struct _LinphoneCallLog{ belle_sip_object_t base; void *user_data; struct _LinphoneCore *lc; LinphoneCallDir dir; /**< The direction of the call*/ LinphoneCallStatus status; /**< The status of the call*/ LinphoneAddress *from; /**= 6) || __GNUC__ > 4) #pragma GCC diagnostic push #endif #ifdef _MSC_VER #pragma warning(disable : 4996) #else #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif LinphoneEcCalibrationCallback cb; void *cb_data; LinphoneEcCalibrationAudioInit audio_init_cb; LinphoneEcCalibrationAudioUninit audio_uninit_cb; #if __clang__ || ((__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4) #pragma GCC diagnostic pop #endif int64_t acc; int delay; unsigned int rate; LinphoneEcCalibratorStatus status; bool_t freq1,freq2,freq3; bool_t play_cool_tones; }; struct _EchoTester { MSFactory *factory; MSFilter *in,*out; MSSndCard *capture_card; MSSndCard *playback_card; MSTicker *ticker; unsigned int rate; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneContent); struct _LinphoneBuffer { belle_sip_object_t base; void *user_data; uint8_t *content; /**< A pointer to the buffer content */ size_t size; /**< The size of the buffer content */ }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneBuffer); struct _LinphoneNatPolicy { belle_sip_object_t base; void *user_data; LinphoneCore *lc; belle_sip_resolver_context_t *stun_resolver_context; belle_sip_resolver_results_t *resolver_results; char *stun_server; char *stun_server_username; char *ref; bool_t stun_enabled; bool_t turn_enabled; bool_t ice_enabled; bool_t upnp_enabled; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneNatPolicy); struct _LinphoneImNotifPolicy { belle_sip_object_t base; void *user_data; LinphoneCore *lc; bool_t send_is_composing; bool_t recv_is_composing; bool_t send_imdn_delivered; bool_t recv_imdn_delivered; bool_t send_imdn_displayed; bool_t recv_imdn_displayed; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneImNotifPolicy); /***************************************************************************** * XML-RPC interface * ****************************************************************************/ struct _LinphoneXmlRpcArg { LinphoneXmlRpcArgType type; union { int i; char *s; } data; }; struct _LinphoneXmlRpcRequestCbs { belle_sip_object_t base; void *user_data; LinphoneXmlRpcRequestCbsResponseCb response; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneXmlRpcRequestCbs); struct _LinphoneXmlRpcRequest { belle_sip_object_t base; void *user_data; LinphoneXmlRpcRequestCbs *callbacks; belle_sip_list_t *arg_list; char *content; /**< The string representation of the XML-RPC request */ char *method; LinphoneXmlRpcStatus status; struct _LinphoneXmlRpcArg response; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneXmlRpcRequest); struct _LinphoneXmlRpcSession { belle_sip_object_t base; void *user_data; LinphoneCore *core; char *url; bool_t released; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneXmlRpcSession); /***************************************************************************** * CardDAV interface * ****************************************************************************/ struct _LinphoneCardDavContext { LinphoneFriendList *friend_list; int ctag; void *user_data; LinphoneCardDavContactCreatedCb contact_created_cb; LinphoneCardDavContactUpdatedCb contact_updated_cb; LinphoneCardDavContactRemovedCb contact_removed_cb; LinphoneCardDavSynchronizationDoneCb sync_done_cb; LinphoneAuthInfo *auth_info; }; struct _LinphoneCardDavQuery { LinphoneCardDavContext *context; char *url; const char *method; char *body; const char *depth; const char *ifmatch; belle_http_request_listener_t *http_request_listener; void *user_data; LinphoneCardDavQueryType type; }; struct _LinphoneCardDavResponse { char *etag; char *url; char *vcard; }; /***************************************************************************** * Player interface * ****************************************************************************/ struct _LinphonePlayerCbs { belle_sip_object_t base; void *user_data; LinphonePlayerCbsEofReachedCb eof; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphonePlayerCbs); struct _LinphonePlayer{ belle_sip_object_t base; void *user_data; int (*open)(LinphonePlayer* player, const char *filename); int (*start)(LinphonePlayer* player); int (*pause)(LinphonePlayer* player); int (*seek)(LinphonePlayer* player, int time_ms); MSPlayerState (*get_state)(LinphonePlayer* player); int (*get_duration)(LinphonePlayer *player); int (*get_position)(LinphonePlayer *player); void (*close)(LinphonePlayer* player); void (*destroy)(LinphonePlayer *player); void *impl; LinphonePlayerCbs *callbacks; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphonePlayer); /***************************************************************************** * XML UTILITY FUNCTIONS * ****************************************************************************/ #define XMLPARSING_BUFFER_LEN 2048 #define MAX_XPATH_LENGTH 256 struct _xmlparsing_context { xmlDoc *doc; xmlXPathContextPtr xpath_ctx; char errorBuffer[XMLPARSING_BUFFER_LEN]; char warningBuffer[XMLPARSING_BUFFER_LEN]; }; /***************************************************************************** * OTHER UTILITY FUNCTIONS * ****************************************************************************/ struct _LinphoneImEncryptionEngineCbs { belle_sip_object_t base; void *user_data; LinphoneImEncryptionEngineCbsIncomingMessageCb process_incoming_message; LinphoneImEncryptionEngineCbsOutgoingMessageCb process_outgoing_message; LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferCb is_encryption_enabled_for_file_transfer; LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb generate_file_transfer_key; LinphoneImEncryptionEngineCbsDownloadingFileCb process_downlading_file; LinphoneImEncryptionEngineCbsUploadingFileCb process_uploading_file; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneImEncryptionEngineCbs); struct _LinphoneImEncryptionEngine { belle_sip_object_t base; void *user_data; LinphoneCore *lc; LinphoneImEncryptionEngineCbs *callbacks; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneImEncryptionEngine); struct _LinphoneRange { belle_sip_object_t base; void *user_data; int min; int max; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneRange); struct _LinphoneTransports { belle_sip_object_t base; void *user_data; int udp_port; /**< SIP/UDP port */ int tcp_port; /**< SIP/TCP port */ int dtls_port; /**< SIP/DTLS port */ int tls_port; /**< SIP/TLS port */ }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneTransports); struct _LinphoneVideoActivationPolicy { belle_sip_object_t base; void *user_data; bool_t automatically_initiate; /**