1 /*! 2 * \file sccp_linedevice.h 3 * \brief SCCP LineDevice Header 4 * \author Sergio Chersovani <mlists [at] c-net.it> 5 * \note Reworked, but based on chan_sccp code. 6 * The original chan_sccp driver that was made by Zozo which itself was derived from the chan_skinny driver. 7 * Modified by Jan Czmok and Julien Goodwin 8 * \note This program is free software and may be modified and distributed under the terms of the GNU Public License. 9 * See the LICENSE file at the top of the source tree. 10 * 11 */ 12 #pragma once 13 14 #define sccp_linedevice_retain(_x) sccp_refcount_retain_type(sccp_linedevice_t, _x) 15 #define sccp_linedevice_release(_x) sccp_refcount_release_type(sccp_linedevice_t, _x) 16 #define sccp_linedevice_refreplace(_x, _y) sccp_refcount_refreplace_type(sccp_linedevice_t, _x, _y) 17 #define sccp_line_refreplace(_x, _y) sccp_refcount_refreplace_type(sccp_line_t, _x, _y) 18 /*! 19 * \brief SCCP cfwd information 20 */ 21 struct sccp_cfwd_information { 22 boolean_t enabled; 23 char number[SCCP_MAX_EXTENSION]; 24 }; 25 26 /*! 27 * \brief SCCP Line-Devices Structure 28 */ 29 struct sccp_linedevice { 30 devicePtr device; //!< SCCP Device 31 linePtr line; //!< SCCP Line 32 SCCP_LIST_ENTRY(sccp_linedevice_t) list; //!< Device Linked List Entry 33 34 sccp_cfwd_information_t cfwd[SCCP_CFWD_SENTINEL]; //!< cfwd information 35 36 sccp_subscription_id_t subscriptionId; //!< for addressing individual devices on shared line 37 char label[SCCP_MAX_LABEL]; //!< 38 uint8_t lineInstance; //!< line instance of this->line on this->device 39 }; /*!< SCCP Line-Device Structure */ 40 41 SCCP_API void SCCP_CALL sccp_linedevice_create(constDevicePtr d, constLinePtr line, uint8_t lineInstance, sccp_subscription_id_t * subscriptionId); 42 SCCP_API void SCCP_CALL sccp_linedevice_remove(constDevicePtr device, linePtr l); 43 SCCP_API void SCCP_CALL sccp_linedevice_cfwd(lineDevicePtr ld, sccp_cfwd_t type, char * number); 44 SCCP_API const char * const SCCP_CALL sccp_linedevice_get_cfwd_string(constLineDevicePtr ld, char * const buffer, size_t size); 45 SCCP_API void SCCP_CALL sccp_linedevice_indicateMWI(constLineDevicePtr ld); 46 47 #define sccp_linedevice_find(_x, _y) __sccp_linedevice_find(_x, _y, __FILE__, __LINE__, __PRETTY_FUNCTION__) 48 #define sccp_linedevice_findByLineinstance(_x, _y) __sccp_linedevice_findByLineinstance(_x, _y, __FILE__, __LINE__, __PRETTY_FUNCTION__) 49 SCCP_API lineDevicePtr SCCP_CALL __sccp_linedevice_find(constDevicePtr device, constLinePtr line, const char * filename, int lineno, const char * func); 50 SCCP_API lineDevicePtr SCCP_CALL __sccp_linedevice_findByLineinstance(constDevicePtr device, uint16_t instance, const char * filename, int lineno, const char * func); 51 SCCP_API void SCCP_CALL sccp_linedevice_createButtonsArray(devicePtr device); 52 SCCP_API void SCCP_CALL sccp_linedevice_deleteButtonsArray(devicePtr device); 53