1 /*! 2 * \file sccp_device.h 3 * \brief SCCP Device 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_device_retain(_x) sccp_refcount_retain_type(sccp_device_t, _x) 15 #define sccp_device_release(_x) sccp_refcount_release_type(sccp_device_t, _x) 16 #define sccp_device_refreplace(_x, _y) sccp_refcount_refreplace_type(sccp_device_t, _x, _y) 17 18 __BEGIN_C_EXTERN__ 19 20 /*! 21 * \brief SCCP Button Configuration Structure 22 */ 23 struct sccp_buttonconfig { 24 uint8_t instance; /*!< Instance on device */ 25 uint8_t index; /*!< Button position on device */ 26 uint8_t _padding1[2]; 27 sccp_config_buttontype_t type; /*!< Button type (e.g. line, speeddial, feature, empty) */ 28 char *label; /*!< Button Name/Label */ 29 SCCP_LIST_ENTRY (sccp_buttonconfig_t) list; /*!< Button Linked List Entry */ 30 31 /*! 32 * \brief SCCP Button Structure 33 */ 34 union sccp_button { 35 36 /*! 37 * \brief SCCP Button Line Structure 38 */ 39 struct /* sccp_line */ { 40 char *name; /*!< Button Name */ 41 sccp_subscription_id_t *subscriptionId; 42 char *options; 43 } line; /*!< SCCP Button Line Structure */ 44 45 /*! 46 * \brief SCCP Button Speeddial Structure 47 */ 48 struct /* sccp_speeddial */ { 49 char *ext; /*!< SpeedDial Extension */ 50 char *hint; /*!< SpeedDIal Hint */ 51 } speeddial; /*!< SCCP Button Speeddial Structure */ 52 53 /*! 54 * \brief SCCP Button Service Structure 55 */ 56 struct /* sccp_service */ { 57 char *url; /*!< The number to dial when it's hit */ 58 } service; /*!< SCCP Button Service Structure */ 59 60 /*! 61 * \brief SCCP Button Feature Structure 62 */ 63 struct /* sccp_feature */ { 64 uint8_t index; /*!< Button Feature Index */ 65 sccp_feature_type_t id; /*!< Button Feature ID */ 66 char *options; /*!< Button Feature Options */ 67 char *args; /*!< Button Feature Arguments */ 68 uint32_t status; /*!< Button Feature Status */ 69 } feature; /*!< SCCP Button Feature Structure */ 70 } button; /*!< SCCP Button Structure */ 71 72 boolean_t pendingDelete; 73 boolean_t pendingUpdate; 74 }; /*!< SCCP Button Configuration Structure */ 75 76 SCCP_LIST_HEAD (sccp_buttonconfig_list, sccp_buttonconfig_t); 77 /*! 78 * \brief SCCP SpeedDial Button Structure 79 * \todo replace ext/hint with charptr (save 80) 80 */ 81 struct sccp_speed { 82 uint8_t instance; /*!< The instance on the current device */ 83 uint8_t config_instance; /*!< The instance of the speeddial in the sccp.conf */ 84 uint8_t type; /*!< SpeedDial Button Type (SKINNY_BUTTONTYPE_SPEEDDIAL or SKINNY_BUTTONTYPE_LINE (hint)) */ 85 boolean_t valid; /*!< Speeddial configuration is valid or not */ 86 char name[StationMaxNameSize]; /*!< The name of the speed dial button */ 87 char ext[SCCP_MAX_EXTENSION]; /*!< The number to dial when it's hit */ 88 char hint[SCCP_MAX_EXTENSION]; /*!< The HINT on this SpeedDial */ 89 SCCP_LIST_ENTRY (sccp_speed_t) list; /*!< SpeedDial Linked List Entry */ 90 }; 91 92 /*! 93 * \brief Privacy Feature Enum 94 */ 95 enum sccp_privacyfeature { 96 SCCP_PRIVACYFEATURE_OFF = 0, 97 SCCP_PRIVACYFEATURE_HINT = 1 << 1, 98 SCCP_PRIVACYFEATURE_CALLPRESENT = 1 << 2, 99 }; 100 101 /*! 102 * \brief SCCP Call Statistics Structure 103 */ 104 struct sccp_call_statistics { 105 uint32_t num; 106 uint32_t packets_sent; 107 uint32_t packets_received; 108 uint32_t packets_lost; 109 uint32_t jitter; 110 uint32_t latency; 111 uint32_t discarded; 112 float opinion_score_listening_quality; 113 float avg_opinion_score_listening_quality; 114 float mean_opinion_score_listening_quality; 115 float max_opinion_score_listening_quality; 116 float variance_opinion_score_listening_quality; 117 float concealement_seconds; 118 float cumulative_concealement_ratio; 119 float interval_concealement_ratio; 120 float max_concealement_ratio; 121 uint32_t concealed_seconds; 122 uint32_t severely_concealed_seconds; 123 }; 124 125 /*! 126 * \brief SCCP Hostname Structure 127 */ 128 struct sccp_hostname { 129 char name[SCCP_MAX_HOSTNAME_LEN]; /*!< Name of the Host */ 130 SCCP_LIST_ENTRY (sccp_hostname_t) list; /*!< Host Linked List Entry */ 131 }; /*!< SCCP Hostname Structure */ 132 133 /*! 134 * \brief SCCP Device Structure 135 */ 136 struct sccp_device { 137 char id[StationMaxDeviceNameSize]; /*!< SEP<macAddress> of the device. */ 138 const sccp_deviceProtocol_t *protocol; /*!< protocol the devices uses */ 139 skinny_devicetype_t skinny_type; /*!< Model of this Phone sent by the station, devicetype */ 140 //uint8_t device_features[3]; /*!< device features (contains protocolversion in 8bit first segement */ 141 StationProtocolFeatures_t device_features; 142 boolean_t earlyrtp; /*!< RTP Channel State where to open the RTP Media Stream */ 143 uint16_t keepalive; /*!< Station Specific Keepalive Timeout */ 144 uint16_t keepaliveinterval; /*!< Currently set Keepalive Timeout */ 145 uint8_t protocolversion; /*!< Skinny Supported Protocol Version */ 146 uint8_t inuseprotocolversion; /*!< Skinny Used Protocol Version */ 147 uint16_t directrtp; /*!< Direct RTP Support (Boolean, default=on) */ 148 149 sccp_nat_t nat; /*!< Network Address Translation Support (Boolean, default=on) */ 150 sccp_session_t *session; /*!< Current Session */ 151 SCCP_RWLIST_ENTRY (sccp_device_t) list; /*!< Global Device Linked List */ 152 153 sccp_private_device_data_t *privateData; 154 155 sccp_channel_t *active_channel; /*!< Active SCCP Channel */ 156 sccp_line_t *currentLine; /*!< Current Line */ 157 158 struct { 159 sccp_linedevice_t ** instance; 160 uint8_t size; 161 } lineButtons; 162 //SCCP_LIST_HEAD (, sccp_buttonconfig_t) buttonconfig; /*!< SCCP Button Config Attached to this Device */ 163 sccp_buttonconfig_list_t buttonconfig; /*!< SCCP Button Config Attached to this Device */ 164 SCCP_LIST_HEAD (, sccp_selectedchannel_t) selectedChannels; /*!< Selected Channel List */ 165 SCCP_LIST_HEAD (, sccp_addon_t) addons; /*!< Add-Ons connect to this Device */ 166 SCCP_LIST_HEAD (, sccp_hostname_t) permithosts; /*!< Permit Registration to the Hostname/IP Address */ 167 168 char *description; /*!< Internal Description. Skinny protocol does not use it */ 169 char imageversion[StationMaxImageVersionSize]; /*!< Version to Send to the phone */ 170 char loadedimageversion[StationMaxImageVersionSize]; /*!< Loaded version on the phone */ 171 char config_type[SCCP_MAX_DEVICE_CONFIG_TYPE]; /*!< Model of this Phone used for setting up features/softkeys/buttons etc. */ 172 int32_t tz_offset; /*!< Timezone OffSet */ 173 uint8_t linesCount; /*!< Number of Lines */ 174 uint8_t defaultLineInstance; /*!< Default Line Instance */ 175 uint8_t maxstreams; /*!< Maximum number of Stream supported by the device */ 176 uint8_t _padding1; 177 struct { 178 char number[SCCP_MAX_EXTENSION]; 179 uint16_t lineInstance; 180 } redialInformation; /*!< Last Dialed Number */ 181 boolean_t linesRegistered; /*!< did we answer the RegisterAvailableLinesMessage */ 182 boolean_t meetme; /*!< Meetme on/off */ 183 boolean_t softkeysupport; /*!< Soft Key Support (Boolean, default=on) */ 184 boolean_t realtime; /*!< is it a realtime configuration */ 185 boolean_t transfer; /*!< Transfer Support (Boolean, default=on) */ 186 187 char *iconvcodepage; /*!< Iconv Codepage to use during conversion from UTF-8, for old phone models */ 188 char *backgroundImage; /*!< backgroundimage we will set after device registered */ 189 char *backgroundTN; /*!< background thumbnail we will set after device registered */ 190 char *ringtone; /*!< ringtone we will set after device registered */ 191 192 skinny_capabilities_t capabilities; 193 skinny_capabilities_t preferences; 194 195 time_t registrationTime; 196 197 struct sccp_ha *ha; /*!< Permit or Deny Connections to the Main Socket */ 198 199 sccp_dtmfmode_t dtmfmode; /*!< DTMF Mode (0 inband - 1 outofband) */ 200 boolean_t park; /*!< Park Support (Boolean, default=on) */ 201 boolean_t cfwdall; /*!< Call Forward All Support (Boolean, default=on) */ 202 boolean_t cfwdbusy; /*!< Call Forward on Busy Support (Boolean, default=on) */ 203 boolean_t cfwdnoanswer; /*!< Call Forward on No-Answer Support (Boolean, default=on) */ 204 char *meetmeopts; /*!< Meetme Options to be Used */ 205 skinny_lampmode_t mwilamp; /*!< MWI/Lamp to indicate MailBox Messages */ 206 boolean_t mwioncall; /*!< MWI On Call Support (Boolean, default=on) */ 207 boolean_t mwiUpdateRequired; 208 209 struct { 210 sccp_channel_t *transferee; /*!< SCCP Channel which will be transferred */ 211 sccp_channel_t *transferer; /*!< SCCP Channel which initiated the transferee */ 212 } transferChannels; 213 214 pthread_t postregistration_thread; /*!< Post Registration Thread */ 215 PBX_VARIABLE_TYPE *variables; /*!< Channel variables to set */ 216 217 sccp_dndmode_t dndmode; /*!< dnd mode: see SCCP_DNDMODE_* */ 218 struct { 219 uint8_t numberOfLines; /*!< Number of Lines */ 220 uint8_t numberOfSpeeddials; /*!< Number of SpeedDials */ 221 uint8_t numberOfFeatures; /*!< Number of Features */ 222 uint8_t numberOfServices; /*!< Number of Services */ 223 } configurationStatistic; /*!< Configuration Statistic Structure */ 224 225 struct { 226 uint16_t newmsgs; /*!< New Messages */ 227 uint16_t oldmsgs; /*!< Old Messages */ 228 } voicemailStatistic; /*!< VoiceMail Statistics */ 229 230 /* feature configurations */ 231 sccp_featureConfiguration_t privacyFeature; /*!< Device Privacy Feature. \see SCCP_PRIVACYFEATURE_* */ 232 sccp_featureConfiguration_t overlapFeature; /*!< Overlap Dial Feature */ 233 sccp_featureConfiguration_t monitorFeature; /*!< Monitor (automon) Feature */ 234 sccp_featureConfiguration_t dndFeature; /*!< dnd Feature */ 235 sccp_featureConfiguration_t priFeature; /*!< priority Feature */ 236 sccp_featureConfiguration_t mobFeature; /*!< priority Feature */ 237 238 uint8_t audio_tos; /*!< audio stream type_of_service (TOS) (RTP) */ 239 uint8_t video_tos; /*!< video stream type_of_service (TOS) (VRTP) */ 240 uint8_t audio_cos; /*!< audio stream class_of_service (COS) (VRTP) */ 241 uint8_t video_cos; /*!< video stream class_of_service (COS) (VRTP) */ 242 struct { 243 softkey_modes *modes; /*!< used softkeySet */ 244 uint32_t activeMask[SCCP_MAX_SOFTKEY_MASK]; /*!< enabled softkeys mask */ 245 uint8_t size; /*!< how many softkeysets are provided by modes */ 246 } softKeyConfiguration; /*!< SoftKeySet configuration */ 247 248 struct { 249 sccp_tokenstate_t token; /*!< token request state */ 250 } status; /*!< Status Structure */ 251 boolean_t allowRinginNotification; /*!< allow ringin notification for hinted extensions (Boolean, default=on) */ 252 boolean_t trustphoneip; /*!< Trust Phone IP Support (Boolean, default=off) DEPRECATED */ 253 boolean_t needcheckringback; /*!< Need to Check Ring Back Support (Boolean, default=on) */ 254 boolean_t isAnonymous; /*!< Device is connected Anonymously (Guest) */ 255 256 btnlist *buttonTemplate; /*!< Button Template for this device type */ 257 258 struct { 259 char *action; 260 uint32_t transactionID; 261 } dtu_softkey; 262 263 boolean_t (*checkACL) (constDevicePtr device); /*!< check ACL callback function */ 264 sccp_push_result_t (*pushURL) (constDevicePtr device, const char *url, uint8_t priority, skinny_tone_t tone); 265 sccp_push_result_t (*pushTextMessage) (constDevicePtr device, const char *messageText, const char *from, uint8_t priority, skinny_tone_t tone); 266 boolean_t (*hasDisplayPrompt) (void); /*!< has Display Prompt callback function (derived from devicetype and protocol) */ 267 boolean_t (*hasLabelLimitedDisplayPrompt) (void); /*!< Can only display very limited selection of label based status bar messages */ 268 boolean_t (*useHookFlash) (void); /*!< use Hook Flasg to transfer (based on devicetype) */ 269 boolean_t (*hasEnhancedIconMenuSupport) (void); /*!< has Enhanced IconMenu Support (derived from devicetype and protocol) */ 270 boolean_t (*hasMWILight) (void); /*!< has Message Waiting Indicator Light */ 271 void (*retrieveDeviceCapabilities) (constDevicePtr device); /*!< set device background image */ 272 void (*setBackgroundImage) (constDevicePtr device, const char *url, const char *tn); /*!< set device background thumbnail image */ 273 void (*displayBackgroundImagePreview) (constDevicePtr device, const char *url); /*!< display background image as preview */ 274 void (*setRingTone) (constDevicePtr device, const char *url); /*!< set the default Ringtone */ 275 const struct sccp_device_indication_cb *indicate; 276 277 sccp_dtmfmode_t(*getDtmfMode) (constDevicePtr device); 278 279 struct { 280 #ifndef SCCP_ATOMIC 281 sccp_mutex_t lock; /*!< Message Stack Lock */ 282 #endif 283 char *(messages[SCCP_MESSAGE_PRIORITY_SENTINEL]); /*!< Message Stack Array */ 284 } messageStack; 285 286 sccp_call_statistics_t call_statistics[2]; /*!< Call statistics */ 287 char *softkeyDefinition; /*!< requested softKey configuration */ 288 sccp_softKeySetConfiguration_t *softkeyset; /*!< Allow for a copy of the softkeyset, if any of the softkeys needs to be redefined, for example for urihook/uriaction */ 289 290 void (*copyStr2Locale) (constDevicePtr d, char *dst, ICONV_CONST char *src, size_t dst_size); /*!< copy string to device converted to locale if necessary */ 291 292 #ifdef CS_SCCP_CONFERENCE 293 sccp_conference_t *conference; /*!< conference we are part of */ /*! \todo to be removed in favor of conference_id */ 294 char *conf_music_on_hold_class; /*!< Play music on hold of this class when no moderator is listening on the conference. If set to an empty string, no music on hold will be played. */ 295 uint32_t conference_id; /*!< Conference ID */ 296 boolean_t conferencelist_active; /*!< ConfList is being displayed on this device */ 297 boolean_t allow_conference; /*!< Allow use of conference */ 298 boolean_t conf_play_general_announce; /*!< Playback General Announcements (Entering/Leaving) */ 299 boolean_t conf_play_part_announce; /*!< Playback Personal Announcements (You have been Kicked/You are muted) */ 300 301 boolean_t conf_mute_on_entry; /*!< Mute participants when they enter */ 302 boolean_t conf_show_conflist; /*!< Automatically show conference list to the moderator */ 303 #endif 304 #ifdef CS_SCCP_PICKUP 305 boolean_t directed_pickup; /*!< Directed Pickup Extension Support (Boolean, default=on) */ 306 char directed_pickup_context[SCCP_MAX_CONTEXT]; /*!< Directed Pickup Context to Use in DialPlan */ 307 boolean_t pickup_modeanswer; /*!< Directed Pickup Mode Answer (Boolean, default on). Answer on directed pickup */ 308 #endif 309 skinny_callHistoryDisposition_t callhistory_answered_elsewhere; /*!< What to do with the call history for calls that were answered remotely */ 310 boolean_t useRedialMenu; 311 312 uint32_t rtpPort; 313 #ifdef CS_AST_HAS_STASIS_ENDPOINT 314 PBX_ENDPOINT_TYPE *endpoint; 315 #endif 316 struct sockaddr_storage ipv4; 317 struct sockaddr_storage ipv6; 318 319 boolean_t pendingDelete; /*!< this bit will tell the scheduler to delete this line when unused */ 320 boolean_t pendingUpdate; /*!< this will contain the updated line struct once reloaded from config to update the line when unused */ 321 }; 322 323 /*! 324 * \brief SCCP Add-On Structure 325 * \note This defines the add-ons a.k.a sidecars 326 */ 327 struct sccp_addon { 328 SCCP_LIST_ENTRY (sccp_addon_t) list; /*!< Linked List Entry for this Add-On */ 329 // sccp_device_t *device; /*!< Device Associated with this Add-On */ 330 skinny_devicetype_t type; /*!< Addon Device Type */ 331 }; 332 333 /*! 334 * \brief SCCP Device Indication Callback Structure 335 */ 336 struct sccp_device_indication_cb { 337 void (*const onhook) (constDevicePtr device, const uint8_t lineInstance, uint32_t callid); 338 void (*const offhook)(constDevicePtr device, sccp_linedevice_t * ld, uint32_t callid); 339 void (*const dialing) (constDevicePtr device, const uint8_t lineInstance, const uint32_t callid, const skinny_calltype_t calltype, sccp_callinfo_t * const callinfo, char dialedNumber[SCCP_MAX_EXTENSION]); 340 void (*const proceed) (constDevicePtr device, const uint8_t lineInstance, const uint32_t callid, const skinny_calltype_t calltype, sccp_callinfo_t * const callinfo); 341 void (*const connected)(constDevicePtr device, const uint8_t lineInstance, const uint32_t callid, const skinny_calltype_t calltype, sccp_callinfo_t * const callinfo); 342 void (*const callhistory)(constDevicePtr device, const uint8_t lineInstance, const uint32_t callid, const skinny_callHistoryDisposition_t disposition); 343 void (*const remoteOnhook) (constDevicePtr device, const uint8_t lineInstance, const uint32_t callid); 344 void (*const remoteOffhook) (constDevicePtr device, const uint8_t lineInstance, const uint32_t callid); 345 void (*const remoteConnected) (constDevicePtr device, const uint8_t lineInstance, const uint32_t callid, skinny_callinfo_visibility_t visibility); 346 void (*const remoteHold) (constDevicePtr device, uint8_t lineInstance, uint32_t callid, skinny_callpriority_t callpriority, skinny_callinfo_visibility_t visibility); 347 }; 348 349 #if UNUSEDCODE // 2015-11-01 350 #define sccp_dev_display(p,q) sccp_dev_display_debug(p, q, __FILE__, __LINE__, __PRETTY_FUNCTION__) 351 #endif 352 #define sccp_dev_displayprompt(p, q, r, s, t) sccp_dev_displayprompt_debug(p, q, r, s, t, __FILE__, __LINE__, __PRETTY_FUNCTION__) 353 #define sccp_dev_displaynotify(p,q,r) sccp_dev_displaynotify_debug(p,q,r, __FILE__, __LINE__, __PRETTY_FUNCTION__) 354 #define sccp_dev_displayprinotify(p,q,r,s) sccp_dev_displayprinotify_debug(p,q,r,s,__FILE__, __LINE__, __PRETTY_FUNCTION__) 355 356 SCCP_API void SCCP_CALL sccp_device_pre_reload(void); 357 SCCP_API void SCCP_CALL sccp_device_post_reload(void); 358 359 /* ====================================================================================================== start getters / setters for privateData */ 360 SCCP_API const SCCP_CALL sccp_accessorystate_t sccp_device_getAccessoryStatus(constDevicePtr d, const sccp_accessory_t accessory); 361 SCCP_API const SCCP_CALL sccp_accessory_t sccp_device_getActiveAccessory(constDevicePtr d); 362 SCCP_API int SCCP_CALL sccp_device_setAccessoryStatus(constDevicePtr d, const sccp_accessory_t accessory, const sccp_accessorystate_t state); 363 SCCP_API const SCCP_CALL sccp_devicestate_t sccp_device_getDeviceState(constDevicePtr d); 364 SCCP_API int SCCP_CALL sccp_device_setDeviceState(constDevicePtr d, const sccp_devicestate_t state); 365 SCCP_API const SCCP_CALL skinny_registrationstate_t sccp_device_getRegistrationState(constDevicePtr d); 366 SCCP_API int SCCP_CALL sccp_device_setRegistrationState(constDevicePtr d, const skinny_registrationstate_t state); 367 /* ======================================================================================================== end getters / setters for privateData */ 368 369 SCCP_API devicePtr SCCP_CALL sccp_device_create(const char * id); 370 SCCP_API devicePtr SCCP_CALL sccp_device_createAnonymous(const char * name); 371 SCCP_API void SCCP_CALL sccp_device_addToGlobals(constDevicePtr device); 372 SCCP_API linePtr SCCP_CALL sccp_dev_getActiveLine(constDevicePtr device); 373 //SCCP_API void SCCP_CALL sccp_dev_setActiveLine(devicePtr device, constLinePtr l); 374 #define sccp_dev_setActiveLine(d, l) __sccp_dev_setActiveLine(d, l, __FILE__, __LINE__, __PRETTY_FUNCTION__) 375 SCCP_API void SCCP_CALL __sccp_dev_setActiveLine(devicePtr device, constLinePtr l, const char *file, uint32_t line, const char *func); 376 377 SCCP_API channelPtr SCCP_CALL sccp_device_getActiveChannel(constDevicePtr device); 378 //SCCP_API void SCCP_CALL sccp_device_setActiveChannel(constDevicePtr d, constChannelPtr channel); 379 #define sccp_device_setActiveChannel(_d,_c) __sccp_device_setActiveChannel(_d, _c, __FILE__, __LINE__, __PRETTY_FUNCTION__) 380 SCCP_API void SCCP_CALL __sccp_device_setActiveChannel(constDevicePtr d, constChannelPtr channel, const char *file, uint32_t line, const char *func); 381 382 SCCP_API sccp_buttonconfig_t * SCCP_CALL sccp_dev_serviceURL_find_byindex(devicePtr device, uint16_t instance); 383 SCCP_API void SCCP_CALL sccp_dev_check_displayprompt(constDevicePtr d); 384 SCCP_API void SCCP_CALL sccp_device_setLastNumberDialed(devicePtr device, const char * lastNumberDialed, const sccp_linedevice_t * ld); 385 SCCP_API void SCCP_CALL sccp_device_preregistration(devicePtr device); 386 SCCP_API uint8_t SCCP_CALL sccp_dev_build_buttontemplate(devicePtr d, btnlist * btn); 387 SCCP_API void SCCP_CALL sccp_dev_sendmsg(constDevicePtr d, sccp_mid_t t); 388 SCCP_API void SCCP_CALL sccp_dev_set_keyset(constDevicePtr d, uint8_t lineInstance, uint32_t callid, skinny_keymode_t softKeySetIndex); 389 SCCP_API void SCCP_CALL sccp_dev_set_ringer(constDevicePtr d, skinny_ringtype_t ringtype, skinny_ringduration_t duration, uint8_t lineInstance, uint32_t callid); 390 SCCP_API void SCCP_CALL sccp_dev_cleardisplay(constDevicePtr d); 391 SCCP_API void SCCP_CALL sccp_dev_set_registered(devicePtr d, skinny_registrationstate_t state); 392 SCCP_API void SCCP_CALL sccp_dev_set_speaker(constDevicePtr d, uint8_t mode); 393 SCCP_API void SCCP_CALL sccp_dev_set_microphone(devicePtr d, uint8_t mode); 394 SCCP_API void SCCP_CALL sccp_dev_set_cplane(constDevicePtr device, uint8_t lineInstance, int status); 395 SCCP_API void SCCP_CALL sccp_dev_deactivate_cplane(constDevicePtr d); 396 SCCP_API void SCCP_CALL sccp_dev_starttone(constDevicePtr d, skinny_tone_t tone, uint8_t lineInstance, uint32_t callid, uint32_t timeout); 397 SCCP_API void SCCP_CALL sccp_dev_stoptone(constDevicePtr d, uint8_t lineInstance, uint32_t callid); 398 SCCP_API void SCCP_CALL sccp_dev_clearprompt(constDevicePtr d, uint8_t lineInstance, uint32_t callid); 399 SCCP_API void SCCP_CALL sccp_dev_display_debug(constDevicePtr d, const char *msg, const char *file, const int lineno, const char *pretty_function); 400 SCCP_API void SCCP_CALL sccp_dev_displayprompt_debug(constDevicePtr d, const uint8_t lineInstance, const uint32_t callid, const char *msg, int timeout, const char *file, const int lineno, const char *pretty_function); 401 SCCP_API void SCCP_CALL sccp_dev_displaynotify_debug(constDevicePtr d, const char *msg, const uint8_t timeout, const char *file, const int lineno, const char *pretty_function); 402 SCCP_API void SCCP_CALL sccp_dev_displayprinotify_debug(constDevicePtr d, const char *msg, const sccp_message_priority_t priority, const uint8_t timeout, const char *file, const int lineno, const char *pretty_function); 403 SCCP_API void SCCP_CALL sccp_dev_cleardisplaynotify(constDevicePtr d); 404 SCCP_API void SCCP_CALL sccp_dev_cleardisplayprinotify(constDevicePtr d, const uint8_t priority); 405 SCCP_API void SCCP_CALL sccp_dev_speed_find_byindex(constDevicePtr d, const uint16_t instance, boolean_t withHint, sccp_speed_t * const k); 406 SCCP_API void SCCP_CALL sccp_dev_forward_status(constLinePtr l, uint8_t lineInstance, constDevicePtr device); 407 SCCP_API void SCCP_CALL _sccp_dev_clean(devicePtr device, boolean_t remove_from_global, boolean_t restart_device); 408 #define sccp_dev_clean(d, r) _sccp_dev_clean(d, r, FALSE); 409 #define sccp_dev_clean_restart(d, r) _sccp_dev_clean(d, r, TRUE); 410 SCCP_API void SCCP_CALL sccp_dev_keypadbutton(devicePtr d, char digit, uint8_t line, uint32_t callid); 411 SCCP_API void SCCP_CALL sccp_dev_set_message(devicePtr d, const char *msg, const int timeout, const boolean_t storedb, const boolean_t beep); 412 SCCP_API void SCCP_CALL sccp_dev_clear_message(devicePtr d, const boolean_t cleardb); 413 SCCP_API void SCCP_CALL sccp_device_addMessageToStack(devicePtr device, const uint8_t priority, const char *message); 414 SCCP_API void SCCP_CALL sccp_device_clearMessageFromStack(devicePtr device, const uint8_t priority); 415 SCCP_API void SCCP_CALL sccp_device_featureChangedDisplay(const sccp_event_t * event); 416 SCCP_API void SCCP_CALL sccp_device_sendcallstate(constDevicePtr d, uint8_t instance, uint32_t callid, skinny_callstate_t state, skinny_callpriority_t precedence_level, skinny_callinfo_visibility_t visibility); 417 SCCP_API void SCCP_CALL sccp_device_sendCallHistoryDisposition(constDevicePtr d, uint8_t lineInstance, uint32_t callid, skinny_callHistoryDisposition_t disposition); 418 SCCP_API int SCCP_CALL sccp_dev_send(constDevicePtr d, sccp_msg_t * msg); 419 SCCP_API int SCCP_CALL sccp_device_sendReset(devicePtr d, skinny_resetType_t reset_type); 420 SCCP_API uint8_t SCCP_CALL sccp_device_find_index_for_line(constDevicePtr d, const char *lineName); 421 SCCP_API uint8_t SCCP_CALL sccp_device_numberOfChannels(constDevicePtr device); 422 SCCP_API boolean_t SCCP_CALL sccp_device_isVideoSupported(constDevicePtr device); 423 SCCP_API boolean_t SCCP_CALL sccp_device_check_update(devicePtr device); 424 SCCP_INLINE SCCP_CALL int16_t sccp_device_buttonIndex2lineInstance(constDevicePtr d, uint16_t buttonIndex); 425 426 // find device 427 SCCP_API devicePtr SCCP_CALL sccp_device_find_byid(const char * id, boolean_t useRealtime); 428 #ifdef CS_SCCP_REALTIME 429 # if DEBUG 430 # define sccp_device_find_realtime(_x) __sccp_device_find_realtime(_x, __FILE__, __LINE__, __PRETTY_FUNCTION__) 431 SCCP_API devicePtr SCCP_CALL __sccp_device_find_realtime(const char * name, const char * filename, int lineno, const char * func); 432 # else 433 SCCP_API devicePtr SCCP_CALL sccp_device_find_realtime(const char * name); 434 # endif 435 # define sccp_device_find_realtime_byid(x) sccp_device_find_realtime(x) 436 #endif 437 438 SCCP_API void SCCP_CALL sccp_device_setLamp(constDevicePtr device, skinny_stimulus_t stimulus, uint8_t instance, skinny_lampmode_t mode); 439 SCCP_API void SCCP_CALL sccp_device_setMWI(devicePtr device); 440 SCCP_API void SCCP_CALL sccp_device_suppressMWI(devicePtr device); 441 SCCP_API void SCCP_CALL sccp_device_indicateMWI(devicePtr device); 442 __END_C_EXTERN__ 443 // kate: indent-width 8; replace-tabs off; indent-mode cstyle; auto-insert-doxygen on; line-numbers on; tab-indents on; keep-extra-spaces off; auto-brackets off; 444