1 /*! 2 * \file pbx_impl/ast/define.h 3 * \brief SCCP PBX Redefinition Asterisk Header 4 * \author Diederik de Groot <ddegroot [at] users.sourceforge.net> 5 * \note This program is free software and may be modified and distributed under the terms of the GNU Public License. 6 * See the LICENSE file at the top of the source tree. 7 */ 8 #pragma once 9 #include "config.h" 10 11 // type redefinitions 12 #define pbx_variable ast_variable 13 #define pbx_context ast_context 14 #define pbx_module ast_module 15 // sccp redefinitions 16 #define sccp_malloc ast_malloc 17 #define sccp_calloc ast_calloc 18 #define sccp_realloc ast_realloc 19 //#define sccp_strdup ast_strdup 20 #define sccp_free(_x) {ast_free((void *)(_x)); (_x) = NULL; } 21 #define sccp_asprintf ast_asprintf 22 #define sccp_vasprintf ast_vasprintf 23 #define sccp_calloc_cache ast_calloc_cache 24 #define sccp_alloca(_size) __builtin_alloca((_size)) 25 #define CS_BRIDGEPEERNAME "BRIDGEPEER" 26 27 #if !defined(SCANBUILD) && defined(DEV_MODE) 28 #define pbx_assert ast_assert 29 #else 30 #define pbx_assert assert 31 #endif 32 33 /* Lock Macro's */ 34 #define sccp_mutex_init(_x) pbx_mutex_init((_x)) 35 #define sccp_mutex_destroy(_x) pbx_mutex_destroy((_x)) 36 #define sccp_mutex_lock(_x) pbx_mutex_lock((_x)) 37 #define sccp_mutex_lock_desc(_x,_y) pbx_mutex_lock_desc((_x),(_y)) 38 #define sccp_mutex_unlock(_x) pbx_mutex_unlock((_x)) 39 #define sccp_mutex_trylock(_x) pbx_mutex_trylock((_x)) 40 #ifdef SCOPED_LOCK 41 # undef SCOPED_LOCK 42 #endif 43 #define SCOPED_LOCK(varname, lock, lockfunc, unlockfunc) \ 44 RAII(typeof((lock)), varname, ({ \ 45 lockfunc((lock)); \ 46 (lock); \ 47 }), \ 48 unlockfunc) 49 #ifdef SCOPED_MUTEX 50 # undef SCOPED_MUTEX 51 #endif 52 #define SCOPED_MUTEX(varname, lock) SCOPED_LOCK(varname, (lock), pbx_mutex_lock, pbx_mutex_unlock) 53 #ifdef SCOPED_RDLOCK 54 # undef SCOPED_RDLOCK 55 #endif 56 #define SCOPED_RDLOCK(varname, lock) SCOPED_LOCK(varname, (lock), pbx_rwlock_rdlock, pbx_rwlock_unlock) 57 #ifdef SCOPED_WRLOCK 58 # undef SCOPED_WRLOCK 59 #endif 60 #define SCOPED_WRLOCK(varname, lock) SCOPED_LOCK(varname, (lock), pbx_rwlock_wrlock, pbx_rwlock_unlock) 61 62 // SCCP_FILE_VERSION definition 63 #if defined(LOW_MEMORY) 64 # define SCCP_FILE_VERSION(_file, _version) 65 #else 66 # if CS_AST_REGISTER_FILE_VERSION 67 # define SCCP_FILE_VERSION(_file, _version) ASTERISK_FILE_VERSION((_file), (_version)) 68 # else 69 # if ASTERISK_VERSION_GROUP >= 114 70 # define SCCP_FILE_VERSION(_file, _version) 71 # else 72 # define SCCP_FILE_VERSION(_file, _version) ASTERISK_REGISTER_FILE() 73 # endif 74 # endif 75 #endif 76 77 // codec / format redefinitions 78 #define pbx_codec_pref_index ast_codec_pref_index 79 #define pbx_codec_pref_getsize ast_codec_pref_getsize 80 #define pbx_codec2str ast_codec2str 81 82 // application / module / cli redefinitions 83 #define pbx_channel_register ast_channel_register 84 #define pbx_channel_register_ex ast_channel_register_ex 85 #define pbx_channel_unregister ast_channel_unregister 86 87 // general redefinitions 88 #define pbx_check_hangup ast_check_hangup 89 #define pbx_check_hangup_locked ast_check_hangup_locked 90 #define pbx_channel_lock ast_channel_lock 91 #define pbx_channel_unlock ast_channel_unlock 92 #define pbx_sched_wait ast_sched_wait 93 #define pbx_io_wait ast_io_wait 94 #define pbx_gethostbyname ast_gethostbyname 95 #define pbx_get_version ast_get_version 96 #define pbx_apply_ha ast_apply_ha 97 #define pbx_moh_stop ast_moh_stop 98 #define pbx_channel_alloc ast_channel_alloc 99 #define pbx_null_frame ast_null_frame 100 #define pbx_jb_configure ast_jb_configure 101 #define pbx_rtp_proto_register ast_rtp_proto_register 102 #define pbx_rtp_proto_unregister ast_rtp_proto_unregister 103 #define pbx_rtp_glue_register ast_rtp_glue_register 104 #define pbx_rtp_glue_unregister ast_rtp_glue_unregister 105 #define pbx_add_extension ast_add_extension 106 #define pbx_app_has_voicemail ast_app_has_voicemail 107 #define pbx_app_inboxcount ast_app_inboxcount 108 #define pbx_app_separate_args ast_app_separate_args 109 #define pbx_bridge_features_init ast_bridge_features_init 110 111 #if ASTERISK_VERSION_NUMBER < 11010 112 #define pbx_bridge_join(_bridge, _channel, _replace, _features, _tech_optimizations, _flags) ast_bridge_join((_bridge), (_channel), (_replace), (_features)) 113 #else 114 #ifndef CS_BRIDGE_JOIN_PASSREFERENCE 115 #define pbx_bridge_join(_bridge, _channel, _replace, _features, _tech_optimizations, _flags) ast_bridge_join((_bridge), (_channel), (_replace), (_features), (_tech_optimizations)) 116 #else 117 #define pbx_bridge_join(_bridge, _channel, _replace, _features, _tech_optimizations, _flags) ast_bridge_join((_bridge), (_channel), (_replace), (_features), (_tech_optimizations), (_flags)) 118 #endif 119 #endif 120 121 #ifndef CS_BRIDGE_BASE_NEW 122 #define pbx_bridge_new(_a,_b,_c,_d,_e) ast_bridge_new((_a), (_b)) 123 #else 124 #define pbx_bridge_new(_a,_b,_c,_d,_e) ast_bridge_base_new((_a), (_b), (_c), (_d), (_e)) 125 #endif 126 #define pbx_bridge_remove ast_bridge_remove 127 #define pbx_bridge_kick ast_bridge_kick 128 #define pbx_bridge_result ast_bridge_result 129 130 #if ASTERISK_VERSION_GROUP < 110 131 #define pbx_bridge_impart(_bridge, _underlying_channel, _swap_channel, _features, _allow_hangup) ast_bridge_impart((_bridge), (_underlying_channel), (_swap_channel), (_features)) 132 #else 133 #define pbx_bridge_impart(_bridge, _underlying_channel, _swap_channel, _features, _allow_hangup) ast_bridge_impart((_bridge), (_underlying_channel), (_swap_channel), (_features), (_allow_hangup)) 134 #endif 135 #ifndef CS_BRIDGE_DEPART_ONLY_CHANNEL 136 #define pbx_bridge_depart(_x, _y) ast_bridge_depart((_x),(_y)) 137 #else 138 #define pbx_bridge_depart(_x, _y) ast_bridge_depart((_y)) 139 #endif 140 141 #define pbx_bridge_destroy(_x, _y) ast_bridge_destroy((_x)) 142 #define pbx_bridge_features_cleanup ast_bridge_features_cleanup 143 #define pbx_bridge_change_state ast_bridge_change_state 144 #define pbx_bridge_lock ast_bridge_lock 145 #define pbx_bridge_unlock ast_bridge_unlock 146 #define pbx_bridge_suspend ast_bridge_suspend 147 #define pbx_bridge_unsuspend ast_bridge_unsuspend 148 149 #define pbx_request ast_request 150 #define pbx_build_string ast_build_string 151 #define pbx_callerid_parse ast_callerid_parse 152 #define pbx_calloc ast_calloc 153 #define pbx_canmatch_extension ast_canmatch_extension 154 #define pbx_category_browse ast_category_browse 155 #define pbx_cause ast_cause 156 #if ASTERISK_VERSION_GROUP < 112 157 #define pbx_ama_flags_type long int 158 #else 159 #define pbx_ama_flags_type enum ama_flags 160 #endif 161 #define pbx_cdr_amaflags2int ast_cdr_amaflags2int 162 #define pbx_cdr_flags2str ast_cdr_flags2str 163 #define pbx_channel_amaflags2string ast_cdr_flags2str 164 #define pbx_channel_string2amaflag ast_cdr_amaflags2int 165 #define pbx_cdr_start ast_cdr_start 166 #define pbx_cdr_update ast_cdr_update 167 #define pbx_channel_defer_dtmf ast_channel_defer_dtmf 168 #define pbx_channel_get_by_name ast_channel_get_by_name 169 #define pbx_channel_iterator_all_new ast_channel_iterator_all_new 170 #define pbx_channel_iterator_destroy ast_channel_iterator_destroy 171 #define pbx_channel_lock ast_channel_lock 172 #define pbx_channel_masquerade ast_channel_masquerade 173 #define pbx_channel_queue_connected_line_update ast_channel_queue_connected_line_update 174 #define pbx_channel_register ast_channel_register 175 #define pbx_channel_search_locked ast_channel_search_locked 176 #define pbx_channel_trylock ast_channel_trylock 177 #define pbx_channel_undefer_dtmf ast_channel_undefer_dtmf 178 #define pbx_channel_unregister ast_channel_unregister 179 180 #define pbx_cli ast_cli 181 #define pbx_cli_entry ast_cli_entry 182 #define pbx_cli_register ast_cli_register 183 #define pbx_cli_unregister ast_cli_unregister 184 #define pbx_codec_pref_string ast_codec_pref_string 185 #define pbx_cond_t ast_cond_t 186 #define pbx_cond_broadcast ast_cond_broadcast 187 #define pbx_cond_destroy ast_cond_destroy 188 #define pbx_cond_init ast_cond_init 189 #define pbx_cond_signal ast_cond_signal 190 #define pbx_cond_timedwait(_cond, _mutex,_ts) ast_cond_timedwait((_cond), (ast_mutex_t*)(_mutex), (_ts)) 191 #define pbx_cond_wait(_cond, _mutex) ast_cond_wait((_cond), (ast_mutex_t*)(_mutex)) 192 #define pbx_config_destroy ast_config_destroy 193 #define pbx_copy_string ast_copy_string 194 #define pbx_custom_function ast_custom_function 195 #define pbx_db_freetree ast_db_freetree 196 197 #if CS_CACHEABLE_DEVICESTATE 198 #define pbx_devstate_changed(_a,_b,_c) ast_devstate_changed((_a),AST_DEVSTATE_CACHABLE,(_b),(_c)) 199 #define pbx_devstate_changed_literal(_a,_b) ast_devstate_changed_literal((_a),AST_DEVSTATE_CACHABLE,(_b)) 200 #elif defined(CS_DEVICESTATE) 201 #define pbx_devstate_changed(_a,_b,_c) ast_devstate_changed((_a),(_b),(_c)) 202 #define pbx_devstate_changed_literal(_a,_b) ast_devstate_changed_literal((_a),(_b)) 203 #else 204 #define pbx_devstate_changed(_a,_b,_c) ast_device_state_changed((_b),(_c)) 205 #define pbx_devstate_changed_literal(_a,_b) ast_device_state_changed_literal((_b)) 206 #endif 207 208 #if defined(CS_AST_ENABLE_DISTRIBUTED_DEVSTATE) 209 #define pbx_enable_distributed_devstate() ast_enable_distributed_devstate() 210 #else 211 #define pbx_enable_distributed_devstate() 212 #endif 213 214 #define pbx_devstate_val ast_devstate_val 215 #define pbx_digit_usecs ast_digit_usecs 216 #define pbx_do_masquerade ast_do_masquerade 217 typedef struct ast_event pbx_event_t; 218 219 #define pbx_event_get_ie_str ast_event_get_ie_str 220 #define pbx_event_get_ie_uint ast_event_get_ie_uint 221 #define pbx_event_new ast_event_new 222 /* 223 #if defined( CS_AST_HAS_STASIS ) 224 #define pbx_event_sub stasis_subscription 225 #else 226 #define pbx_event_sub ast_event_sub 227 #endif 228 */ 229 #if defined( HAVE_PBX_STASIS_H ) 230 #define pbx_event_sub stasis_subscription 231 #define pbx_mwi_state_type ast_mwi_state_type 232 #else 233 #define pbx_event_sub ast_event_sub 234 #endif 235 typedef struct pbx_event_sub pbx_event_subscription_t; 236 #define pbx_mwi_topic ast_mwi_topic 237 #define pbx_mwi_subscribe_pool ast_mwi_subscribe_pool 238 #define pbx_mwi_unsubscribe_and_join ast_mwi_unsubscribe_and_join 239 #define pbx_mwi_subscriber ast_mwi_subscriber 240 #define pbx_event_subscribe ast_event_subscribe 241 #define pbx_event_unsubscribe ast_event_unsubscribe 242 #define pbx_event_queue_and_cache ast_event_queue_and_cache 243 #define pbx_exists_extension ast_exists_extension 244 #define pbx_extension_state_add ast_extension_state_add 245 #define pbx_extension_state_del ast_extension_state_del 246 #define pbx_extension_state ast_extension_state 247 #define pbx_event_get_cached ast_event_get_cached 248 #define pbx_event_destroy ast_event_destroy 249 #define pbx_get_group ast_get_group 250 #define pbx_get_hint ast_get_hint 251 #define pbx_gethostbyname ast_gethostbyname 252 #define pbx_ignore_pattern ast_ignore_pattern 253 #define pbx_indicate ast_indicate 254 #define pbx_io_wait ast_io_wait 255 #define pbx_jb_read_conf ast_jb_read_conf 256 #define pbx_load_realtime ast_load_realtime 257 #define pbx_log ast_log 258 #define pbx_malloc ast_malloc 259 #define pbx_manager_register_xml ast_manager_register_xml 260 #define pbx_manager_unregister ast_manager_unregister 261 #define pbx_matchmore_extension ast_matchmore_extension 262 #define pbx_moh_stop ast_moh_stop 263 264 //#define pbx_mutex_t ast_mutex_t 265 #define pbx_mutex_destroy(_x) ast_mutex_destroy((ast_mutex_t *)(_x)) 266 #define pbx_mutex_init(_x) ast_mutex_init((ast_mutex_t *)(_x)) 267 #define pbx_mutex_init_notracking(_x) ast_mutex_init_notracking((ast_mutex_t *)(_x)) 268 269 //#define pbx_rwlock_t ast_rwlock_t 270 #define pbx_rwlock_destroy(_x) ast_rwlock_destroy((ast_rwlock_t *)(_x)) 271 #define pbx_rwlock_init(_x) ast_rwlock_init((ast_rwlock_t *)(_x)) 272 #define pbx_rwlock_init_notracking(_x) ast_rwlock_init_notracking((ast_rwlock_t *)(_x)) 273 274 #if CS_LOCK_DEBUG 275 #define pbx_mutex_lock(_x) {ast_debug(4, "[%d] %s:%d (%s) MUTEX_LOCK: " #_x ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x)); ast_mutex_lock((ast_mutex_t *)(_x));} 276 #define pbx_mutex_trylock(_x) {ast_debug(4, "[%d] %s:%d (%s) MUTEX_TRYLOCK: " #_x ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x)); ast_mutex_trylock((ast_mutex_t *)(_x));} 277 #define pbx_mutex_unlock(_x) {ast_mutex_unlock((ast_mutex_t *)_x); ast_debug(4, "[%d] %s:%d (%s) MUTEX_UNLOCK: " #(_x) ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x));} 278 #define pbx_rwlock_rdlock(_x) {ast_debug(5, "[%d] %s:%d (%s) RWLOCK_RDLOCK: " #_x ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x)); ast_rwlock_rdlock((ast_rwlock_t *)(_x));} 279 #define pbx_rwlock_wrlock(_x) {ast_debug(5, "[%d] %s:%d (%s) RWLOCK_WRLOCK: " #_x ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x)); ast_rwlock_wrlock((ast_rwlock_t *)(_x));} 280 #define pbx_rwlock_tryrdlock(_x) {ast_debug(5, "[%d] %s:%d (%s) RWLOCK_TRYRDLOCK: " #_x ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x)); ast_rwlock_tryrdlock((ast_rwlock_t *)(_x));} 281 #define pbx_rwlock_trywrlock(_x) {ast_debug(5, "[%d] %s:%d (%s) RWLOCK_TRYWRLOCK: " #_x ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x)); ast_rwlock_trywrlock((ast_rwlock_t *)(_x));} 282 #define pbx_rwlock_unlock(_x) {ast_rwlock_unlock((ast_rwlock_t *)(_x)); ast_debug(5, "[%d] %s:%d (%s) RWLOCK_UNLOCK: " #_x ": %p\n", (unsigned int) pthread_self(), __FILE__, __LINE__, __PRETTY_FUNCTION__, (_x));} 283 #else 284 #define pbx_mutex_lock(_x) ({ast_mutex_lock((ast_mutex_t *)(_x));}) 285 #define pbx_mutex_trylock(_x) ({ast_mutex_trylock((ast_mutex_t *)(_x));}) 286 #define pbx_mutex_unlock(_x) ({ast_mutex_unlock((ast_mutex_t *)(_x));}) 287 #define pbx_rwlock_rdlock(_x) ({ast_rwlock_rdlock((ast_rwlock_t *)(_x));}) 288 #define pbx_rwlock_wrlock(_x) ({ast_rwlock_wrlock((ast_rwlock_t *)(_x));}) 289 #define pbx_rwlock_tryrdlock(_x) ({ast_rwlock_tryrdlock((ast_rwlock_t *)(_x));}) 290 #define pbx_rwlock_trywrlock(_x) ({ast_rwlock_trywrlock((ast_rwlock_t *)(_x));}) 291 #define pbx_rwlock_unlock(_x) ({ast_rwlock_unlock((ast_rwlock_t *)(_x));}) 292 #endif 293 294 #define pbx_park_call ast_park_call 295 #define pbx_party_name_free ast_party_name_free 296 #define pbx_party_number_free ast_party_number_free 297 #define pbx_pbx_run ast_pbx_run 298 // #define pbx_pbx_start ast_pbx_start 299 #define pbx_poll ast_poll 300 #define pbx_print_group ast_print_group 301 #define pbx_print_namedgroup ast_print_namedgroup 302 #define pbx_pthread_create ast_pthread_create 303 #define pbx_pthread_create_background ast_pthread_create_background 304 #define pbx_pthread_create_detached_background ast_pthread_create_detached_background 305 #define pbx_pthread_mutex_lock ast_pthread_mutex_lock 306 #define pbx_pthread_mutex_trylock ast_pthread_mutex_trylock 307 #define pbx_pthread_mutex_unlock ast_pthread_mutex_unlock 308 #define __pbx_pthread_mutex_unlock __ast_pthread_mutex_unlock 309 #define __pbx_pthread_mutex_lock __ast_pthread_mutex_lock 310 #define __pbx_pthread_mutex_trylock __ast_pthread_mutex_trylock 311 #define pbx_queue_hangup ast_queue_hangup 312 #define pbx_random ast_random 313 #define pbx_realloc ast_realloc 314 #define pbx_rtp_bridge ast_rtp_bridge 315 #define pbx_rtp_codecs_payloads_set_rtpmap_type_rate ast_rtp_codecs_payloads_set_rtpmap_type_rate 316 #define pbx_rtp_glue_register ast_rtp_glue_register 317 #define pbx_rtp_glue_result ast_rtp_glue_result 318 #define pbx_rtp_glue_unregister ast_rtp_glue_unregister 319 #define pbx_rtp_instance_bridge ast_rtp_instance_bridge 320 #define pbx_rtp_instance_change_source ast_rtp_instance_change_source 321 #define pbx_rtp_instance_destroy ast_rtp_instance_destroy 322 #define pbx_rtp_instance_fd ast_rtp_instance_fd 323 #define pbx_rtp_instance_get_codecs ast_rtp_instance_get_codecs 324 #define pbx_rtp_instance_get_local_address ast_rtp_instance_get_local_address 325 #define pbx_rtp_instance_get_remote_address ast_rtp_instance_get_remote_address 326 #define pbx_rtp_instance_new ast_rtp_instance_new 327 #define pbx_rtp_instance_read ast_rtp_instance_read 328 #define pbx_rtp_instance_set_prop ast_rtp_instance_set_prop 329 #define pbx_rtp_instance_set_qos ast_rtp_instance_set_qos 330 #define pbx_rtp_instance_set_remote_address ast_rtp_instance_set_remote_address 331 #define pbx_rtp_instance_stop ast_rtp_instance_stop 332 #define pbx_rtp_instance_update_source ast_rtp_instance_update_source 333 #define pbx_rtp_instance_write ast_rtp_instance_write 334 #define pbx_rtp_set_vars ast_rtp_set_vars 335 #define pbx_safe_sleep ast_safe_sleep 336 #define pbx_sched_add ast_sched_add 337 #define pbx_sched_del ast_sched_del 338 #define pbx_sched_runq ast_sched_runq 339 #define pbx_sched_wait ast_sched_wait 340 #define pbx_sched_when ast_sched_when 341 #define pbx_set_callerid ast_set_callerid 342 #define pbx_setcallstate ast_setcallstate 343 #define pbx_set_read_format ast_set_read_format 344 #define pbx_setstate ast_setstate 345 #define pbx_set_write_format ast_set_write_format 346 #define pbx_skip_blanks ast_skip_blanks 347 #define pbx_skip_nonblanks ast_skip_nonblanks 348 #define pbx_sockaddr_from_sin ast_sockaddr_from_sin 349 #define pbx_sockaddr_port ast_sockaddr_port 350 #define pbx_sockaddr_to_sin ast_sockaddr_to_sin 351 #define pbx_state2str ast_state2str 352 #define pbx_str_t struct ast_str 353 #define pbx_str_create ast_str_create 354 #define pbx_str_alloca(init_len) \ 355 ({ \ 356 pbx_str_t *__pbx_str_buf; \ 357 __pbx_str_buf = (pbx_str_t *)ast_alloca(sizeof(*__pbx_str_buf) + (init_len)); \ 358 __pbx_str_buf->__AST_STR_LEN = (init_len); \ 359 __pbx_str_buf->__AST_STR_USED = 0; \ 360 __pbx_str_buf->__AST_STR_TS = DS_ALLOCA; \ 361 __pbx_str_buf->__AST_STR_STR[0] = '\0'; \ 362 (__pbx_str_buf); \ 363 }) 364 #define pbx_str_append ast_str_append 365 #define pbx_str_reset ast_str_reset 366 #define pbx_str_strlen ast_str_strlen 367 #define pbx_str_size ast_str_size 368 #define pbx_str_thread_get ast_str_thread_get 369 #define pbx_str_append_escapecommas ast_str_append_escapecommas 370 #define pbx_str_buffer ast_str_buffer 371 #define PBX_THREADSTORAGE AST_THREADSTORAGE 372 #define pbx_strdup ast_strdup 373 #define pbx_strdupa ast_strdupa 374 #define pbx_stream_and_wait ast_stream_and_wait 375 #define pbx_say_number ast_say_number 376 #define pbx_fileexists ast_fileexists 377 #if ASTERISK_VERSION_GROUP < 111 && defined(__clang__) 378 #undef AST_STRING_FIELD_ALLOCATION 379 #define AST_STRING_FIELD_ALLOCATION(_x) *((ast_string_field_allocation *) ((ast_string_field_allocation)(_x) - __alignof__(ast_string_field_allocation))) 380 #endif 381 #define pbx_string_field_build ast_string_field_build 382 #define pbx_string_field_set ast_string_field_set 383 #define pbx_strip ast_strip 384 #define pbx_trim_blanks ast_trim_blanks 385 #define pbx_true ast_true 386 #define pbx_false ast_false 387 #define pbx_tvnow ast_tvnow 388 #if CS_AST_REGISTER_FILE_VERSION 389 #define pbx_register_file_version ast_register_file_version 390 #define pbx_unregister_file_version ast_unregister_file_version 391 #endif 392 #define pbx_update_use_count ast_update_use_count 393 #define pbx_variable_browse ast_variable_browse 394 #define pbx_variable_new ast_variable_new 395 #define pbx_variable_retrieve ast_variable_retrieve 396 #define pbx_variables_destroy ast_variables_destroy 397 #define pbx_strlen_zero ast_strlen_zero 398 #define pbx_context_find ast_context_find 399 #if CS_AST_HAS_CONTEXT_DESTROY_BY_NAME 400 #define pbx_context_destroy_by_name ast_context_destroy_by_name 401 #else 402 #define pbx_context_destroy_by_name ast_context_destroy 403 #endif 404 #define pbx_context_destroy ast_context_destroy 405 #define PBX_CONTEXT_TYPE struct ast_context 406 #define pbx_hangup ast_hangup 407 #define pbx_atomic_fetchadd_int ast_atomic_fetchadd_int 408 #define pbx_clear_flag ast_clear_flag 409 #define pbx_set_flag ast_set_flag 410 #define pbx_test_flag ast_test_flag 411 #define pbx_set2_flag ast_set2_flag 412 413 // Fixes for asterisk-trunk, need to sorted later 414 #define pbx_channel_flags(_a) (_a) /* needed in asterisk trunk */ 415 #define pbx_channel_uniqueid(_a) (_a)->uniqueid 416 #define pbx_channel_call_forward(_a) (_a)->call_forward 417 #define pbx_channel_appl(_a) (_a)->appl 418 #define pbx_channel_state(_a) (_a)->_state 419 #define pbx_channel_pbx(_a) (_a)->pbx 420 #define pbx_channel_hangupcause(_a) (_a)->hangupcause 421 #define pbx_channel_set_hangupcause(_a,_b) (_a)->hangupcause = (_b) 422 #define pbx_channel_softhangup(_a) (_a)->_softhangup 423 #define pbx_channel_context(_a) (_a)->context 424 #define pbx_channel_nativeformats(_a) (_a)->nativeformats 425 #define pbx_channel_exten(_a) (_a)->exten 426 #define pbx_channel_priority(_a) (_a)->priority 427 #define pbx_channel_macroexten(_a) (_a)->macroexten 428 #define pbx_channel_macrocontext(_a) (_a)->macrocontext 429 #define pbx_channel_dialcontext(_a) (_a)->dialcontext 430 #define pbx_channel_callgroup(_a) (_a)->callgroup 431 #define pbx_channel_masq(_a) (_a)->masq 432 #define pbx_channel_setwhentohangup_tv(_a, _b) (_a)->whentohangup = (_b) 433 #define pbx_channel_blocker(_a) (_a)->blocker 434 #define pbx_channel_blockproc(_a) (_a)->blockproc 435 #define pbx_channel_tech(_a) (_a)->tech 436 #define pbx_channel_bridge(_a) (_a)->bridge 437 #define pbx_channel_set_bridge(_a,_b) (_a)->bridge = (_b) 438 #define pbx_channel_language(_a) (_a)->language 439 #define pbx_channel_cdr(_a) (_a)->cdr 440 #define pbx_channel_call_forward_set(_a,_b) ast_string_field_set((_a), call_forward, (_b)); 441 #define pbx_channel_varshead(_a) &(_a)->varshead 442 #define pbx_pickup_call ast_pickup_call 443 #define pbx_channel_monitor(_a) (_a)->monitor 444 445 #define pbx_bridge_change_state ast_bridge_change_state 446 #define pbx_channel_redirecting_effective_from(_a) (_a)->redirecting.from 447 #define pbx_channel_redirecting_effective_to(_a) (_a)->redirecting.to 448 #define pbx_channel_redirecting_effective_orig(_a) (_a)->redirecting.orig 449 #define pbx_channel_connected_id(_a) (_a)->connected.id 450 #define pbx_channel_connected_source(_a) (_a)->connected.source 451 #define pbx_connected_line_source_name(_a) ast_connected_line_source_name(_a) 452 453 #define pbx_streamfile ast_streamfile 454 #if CS_TEST_FRAMEWORK 455 #define pbx_test_validate_cleanup ast_test_validate_cleanup 456 #define pbx_test_status_update ast_test_status_update 457 #ifdef SCANBUILD 458 #define pbx_test_validate(_test,_assertion) assert((_assertion)); 459 #else 460 #define pbx_test_validate ast_test_validate 461 #endif 462 #endif 463 #define pbx_channel_callid ast_channel_callid 464 #if !defined(CS_AST_CHANNEL_CALLID_TYPEDEF) 465 # define pbx_callid_t struct ast_callid * 466 # define pbx_channel_callid_set(_chan, _callid) ast_channel_callid_set(_chan, (struct ast_callid *)_callid) 467 # define pbx_callid_threadassoc_add(_callid) ast_callid_threadassoc_add((struct ast_callid *)_callid) 468 #else 469 # define pbx_callid_t ast_callid 470 # define pbx_channel_callid_set(_chan, _callid) ast_channel_callid_set(_chan, (ast_callid)_callid) 471 # define pbx_callid_threadassoc_add(_callid) ast_callid_threadassoc_add((ast_callid)_callid) 472 #endif 473 #define pbx_create_callid (pbx_callid_t) ast_create_callid 474 #define pbx_callid_threadassoc_remove ast_callid_threadassoc_remove 475 476 // 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; 477