part 1 of many standardizing typedefed types to end in _t

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1292 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2006-04-29 01:00:52 +00:00
parent 751ca005d3
commit d0347b2a95
41 changed files with 344 additions and 333 deletions

View File

@ -35,13 +35,13 @@
#ifndef SWITCH_H #ifndef SWITCH_H
#define SWITCH_H #define SWITCH_H
#ifdef __cplusplus #ifdef __cplusplus
#define BEGIN_EXTERN_C extern "C" { #define BEGIN_EXTERN_C extern "C" {
#define END_EXTERN_C } #define END_EXTERN_C }
#else #else
#define BEGIN_EXTERN_C #define BEGIN_EXTERN_C
#define END_EXTERN_C #define END_EXTERN_C
#endif #endif
BEGIN_EXTERN_C BEGIN_EXTERN_C

View File

@ -256,7 +256,7 @@ typedef apr_thread_cond_t switch_thread_cond_t;
DoxyDefine(apr_status_t switch_thread_cond_create(switch_thread_cond_t **cond, switch_pool_t *pool);) DoxyDefine(apr_status_t switch_thread_cond_create(switch_thread_cond_t **cond, switch_pool_t *pool);)
#define switch_thread_cond_create apr_thread_cond_create #define switch_thread_cond_create apr_thread_cond_create
typedef apr_os_thread_t switch_thread_id; typedef apr_os_thread_t switch_thread_id_t;
#define switch_thread_data_set apr_thread_data_set #define switch_thread_data_set apr_thread_data_set
#define switch_thread_data_get apr_thread_data_get #define switch_thread_data_get apr_thread_data_get
@ -331,7 +331,7 @@ DoxyDefine(apr_status_t switch_thread_cond_destroy(switch_thread_cond_t *cond);)
*/ */
/** Opaque Thread structure. */ /** Opaque Thread structure. */
typedef apr_thread_t switch_thread; typedef apr_thread_t switch_thread_t;
/** Opaque Thread attributes structure. */ /** Opaque Thread attributes structure. */
typedef apr_threadattr_t switch_threadattr_t; typedef apr_threadattr_t switch_threadattr_t;
@ -947,7 +947,7 @@ DoxyDefine(apr_status_t switch_mcast_interface(switch_socket_t *sock,
* @{ * @{
*/ */
/** The fundamental pool type */ /** The fundamental pool type */
typedef apr_pool_t switch_memory_pool; typedef apr_pool_t switch_memory_pool_t;
/** /**
@ -958,7 +958,7 @@ typedef apr_pool_t switch_memory_pool;
* to re-use this memory for the next allocation. * to re-use this memory for the next allocation.
* @see apr_pool_destroy() * @see apr_pool_destroy()
*/ */
DoxyDefine(void switch_pool_clear(switch_memory_pool *p);) DoxyDefine(void switch_pool_clear(switch_memory_pool_t *p);)
#define switch_pool_clear apr_pool_clear #define switch_pool_clear apr_pool_clear
/** @} */ /** @} */
@ -1135,7 +1135,7 @@ DoxyDefine(void switch_sleep(apr_interval_time_t t);)
*/ */
/** Abstract type for hash tables. */ /** Abstract type for hash tables. */
typedef apr_hash_t switch_hash; typedef apr_hash_t switch_hash_t;
/** Abstract type for scanning hash tables. */ /** Abstract type for scanning hash tables. */
typedef apr_hash_index_t switch_hash_index_t; typedef apr_hash_index_t switch_hash_index_t;
@ -1392,7 +1392,7 @@ typedef apr_thread_mutex_t switch_mutex_t;
* *
SWITCH_DECLARE(switch_status) switch_mutex_init(switch_mutex_t **lock, SWITCH_DECLARE(switch_status) switch_mutex_init(switch_mutex_t **lock,
switch_lock_flag flags, switch_lock_flag flags,
switch_memory_pool *pool); switch_memory_pool_t *pool);
*/ */
#define switch_mutex_init apr_thread_mutex_create #define switch_mutex_init apr_thread_mutex_create
/** /**

View File

@ -60,7 +60,7 @@ struct switch_buffer;
* \param max_len length required by the buffer * \param max_len length required by the buffer
* \return status * \return status
*/ */
SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool *pool, switch_buffer **buffer, switch_size_t max_len); SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer **buffer, switch_size_t max_len);
/*! \brief Get the length of a switch_buffer /*! \brief Get the length of a switch_buffer
* \param buffer any buffer of type switch_buffer * \param buffer any buffer of type switch_buffer

View File

@ -151,7 +151,7 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session
\param destination_number destination number \param destination_number destination number
\return a new profile object allocated from the session's memory pool \return a new profile object allocated from the session's memory pool
*/ */
SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool *pool, SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool_t *pool,
char *dialplan, char *dialplan,
char *caller_id_name, char *caller_id_name,
char *caller_id_number, char *caller_id_number,
@ -179,7 +179,7 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_
\param event the event to add the information to \param event the event to add the information to
*/ */
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, switch_event *event); SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, switch_event_t *event);
END_EXTERN_C END_EXTERN_C

View File

@ -122,7 +122,7 @@ SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch
\param pool memory_pool to use for allocation \param pool memory_pool to use for allocation
\return SWITCH_STATUS_SUCCESS if successful \return SWITCH_STATUS_SUCCESS if successful
*/ */
SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool *pool); SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool_t *pool);
/*! /*!
\brief Connect a newly allocated channel to a session object and setup it's initial state \brief Connect a newly allocated channel to a session object and setup it's initial state
@ -367,7 +367,7 @@ SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state stat
\param channel channel to add information about \param channel channel to add information about
\param event event to add information to \param event event to add information to
*/ */
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event *event); SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event_t *event);
// These may go away // These may go away

View File

@ -82,7 +82,7 @@ struct switch_core_thread_session {
/*! array of void pointers to pass mutiple data objects */ /*! array of void pointers to pass mutiple data objects */
void *objs[SWITCH_MAX_CORE_THREAD_SESSION_OBJS]; void *objs[SWITCH_MAX_CORE_THREAD_SESSION_OBJS];
/*! a pointer to a memory pool if the thread has it's own pool */ /*! a pointer to a memory pool if the thread has it's own pool */
switch_memory_pool *pool; switch_memory_pool_t *pool;
}; };
struct switch_core_session; struct switch_core_session;
@ -162,13 +162,13 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_core_get_state_handler
\brief Create a new sub memory pool from the core's master pool \brief Create a new sub memory pool from the core's master pool
\return SWITCH_STATUS_SUCCESS on success \return SWITCH_STATUS_SUCCESS on success
*/ */
SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool **pool); SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool_t **pool);
/*! /*!
\brief Returns a subpool back to the main pool \brief Returns a subpool back to the main pool
\return SWITCH_STATUS_SUCCESS on success \return SWITCH_STATUS_SUCCESS on success
*/ */
SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool **pool); SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool_t **pool);
/*! /*!
\brief Start the session's state machine \brief Start the session's state machine
@ -196,7 +196,7 @@ SWITCH_DECLARE(void *) switch_core_permenant_alloc(switch_size_t memory);
\param memory the number of bytes to allocate \param memory the number of bytes to allocate
\return a void pointer to the allocated memory \return a void pointer to the allocated memory
*/ */
SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool *pool, switch_size_t memory); SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size_t memory);
/*! /*!
\brief Allocate memory from a session's pool \brief Allocate memory from a session's pool
@ -228,7 +228,7 @@ SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session *session,
\param todup the string to duplicate \param todup the string to duplicate
\return a pointer to the newly duplicated string \return a pointer to the newly duplicated string
*/ */
SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup); SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, char *todup);
/*! /*!
\brief Retrieve the memory pool from a session \brief Retrieve the memory pool from a session
@ -236,7 +236,7 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup)
\return the session's pool \return the session's pool
\note to be used sparingly \note to be used sparingly
*/ */
SWITCH_DECLARE(switch_memory_pool *) switch_core_session_get_pool(switch_core_session *session); SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session *session);
///\} ///\}
///\defgroup sessm Session Creation / Management ///\defgroup sessm Session Creation / Management
@ -248,7 +248,7 @@ SWITCH_DECLARE(switch_memory_pool *) switch_core_session_get_pool(switch_core_se
\param pool the pool to use for the allocation (a new one will be used if NULL) \param pool the pool to use for the allocation (a new one will be used if NULL)
\return the newly created session \return the newly created session
*/ */
SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface, switch_memory_pool *pool); SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface, switch_memory_pool_t *pool);
/*! /*!
\brief Destroy a session and return the memory pool to the core \brief Destroy a session and return the memory pool to the core
@ -263,7 +263,7 @@ SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session);
\param pool the pool to use \param pool the pool to use
\return the newly created session \return the newly created session
*/ */
SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool *pool); SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t *pool);
/*! /*!
\brief Launch the session thread (state machine) on a given session \brief Launch the session thread (state machine) on a given session
@ -312,7 +312,7 @@ SWITCH_DECLARE (switch_status) switch_core_session_message_send(char *uuid_str,
\param event the event to send \param event the event to send
\return the status returned by the message handler \return the status returned by the message handler
*/ */
SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event *event); SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event_t *event);
/*! /*!
\brief Retrieve private user data from a session \brief Retrieve private user data from a session
@ -358,7 +358,7 @@ SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session *se
\param func a function to execute in the thread \param func a function to execute in the thread
\param obj an arguement \param obj an arguement
*/ */
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, void *(*func)(switch_thread *, void *), void *obj); SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, void *(*func)(switch_thread_t *, void *), void *obj);
/*! /*!
\brief Signal a thread using a thread session to terminate \brief Signal a thread using a thread session to terminate
@ -387,7 +387,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s
char *endpoint_name, char *endpoint_name,
switch_caller_profile *caller_profile, switch_caller_profile *caller_profile,
switch_core_session **new_session, switch_core_session **new_session,
switch_memory_pool *pool); switch_memory_pool_t *pool);
/*! /*!
\brief Answer the channel of a given session \brief Answer the channel of a given session
@ -410,7 +410,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_se
\param event the event to queue \param event the event to queue
\return the status returned by the message handler \return the status returned by the message handler
*/ */
SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event *event); SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event_t *event);
/*! /*!
\brief Read a frame from a session \brief Read a frame from a session
@ -563,14 +563,14 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switc
\param pool the pool to use for the new hash \param pool the pool to use for the new hash
\return SWITCH_STATUS_SUCCESS if the hash is created \return SWITCH_STATUS_SUCCESS if the hash is created
*/ */
SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash **hash, switch_memory_pool *pool); SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash_t **hash, switch_memory_pool_t *pool);
/*! /*!
\brief Destroy an existing hash table \brief Destroy an existing hash table
\param hash the hash to destroy \param hash the hash to destroy
\return SWITCH_STATUS_SUCCESS if the hash is destroyed \return SWITCH_STATUS_SUCCESS if the hash is destroyed
*/ */
SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash *hash); SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash_t *hash);
/*! /*!
\brief Insert data into a hash \brief Insert data into a hash
@ -580,7 +580,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash *hash);
\return SWITCH_STATUS_SUCCESS if the data is added \return SWITCH_STATUS_SUCCESS if the data is added
\note the string key must be a constant or a dynamic string \note the string key must be a constant or a dynamic string
*/ */
SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash *hash, char *key, void *data); SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash_t *hash, char *key, void *data);
/*! /*!
\brief Insert data into a hash with dynamicly allocated key name \brief Insert data into a hash with dynamicly allocated key name
@ -589,7 +589,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash *hash, char *k
\param data the data to add \param data the data to add
\return SWITCH_STATUS_SUCCESS if the data is added \return SWITCH_STATUS_SUCCESS if the data is added
*/ */
SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash *hash, char *key, void *data); SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash_t *hash, char *key, void *data);
/*! /*!
\brief Delete data from a hash based on desired key \brief Delete data from a hash based on desired key
@ -597,7 +597,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash *hash, cha
\param key the key from which to delete the data \param key the key from which to delete the data
\return SWITCH_STATUS_SUCCESS if the data is deleted \return SWITCH_STATUS_SUCCESS if the data is deleted
*/ */
SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash *hash, char *key); SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash_t *hash, char *key);
/*! /*!
\brief Retrieve data from a given hash \brief Retrieve data from a given hash
@ -605,7 +605,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash *hash, char *k
\param key the key to retrieve \param key the key to retrieve
\return a pointer to the data held in the key \return a pointer to the data held in the key
*/ */
SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key); SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t *hash, char *key);
///\} ///\}
///\defgroup timer Timer Functions ///\defgroup timer Timer Functions
@ -620,7 +620,7 @@ SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key);
\param pool the memory pool to use for allocation \param pool the memory pool to use for allocation
\return \return
*/ */
SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples, switch_memory_pool *pool); SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
/*! /*!
\brief Wait for one cycle on an existing timer \brief Wait for one cycle on an existing timer
@ -659,7 +659,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec,
int channels, int channels,
uint32_t flags, uint32_t flags,
const switch_codec_settings *codec_settings, const switch_codec_settings *codec_settings,
switch_memory_pool *pool); switch_memory_pool_t *pool);
/*! /*!
\brief Encode data using a codec handle \brief Encode data using a codec handle
@ -777,7 +777,7 @@ SWITCH_DECLARE(switch_core_db *) switch_core_db_open_file(char *filename);
\return SWITCH_STATUS_SUCCESS if the file is opened \return SWITCH_STATUS_SUCCESS if the file is opened
\note the loadable module used is chosen based on the file extension \note the loadable module used is chosen based on the file extension
*/ */
SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char *file_path, unsigned int flags, switch_memory_pool *pool); SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char *file_path, unsigned int flags, switch_memory_pool_t *pool);
/*! /*!
\brief Read media from a file handle \brief Read media from a file handle
@ -833,7 +833,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
char *voice_name, char *voice_name,
unsigned int rate, unsigned int rate,
switch_speech_flag *flags, switch_speech_flag *flags,
switch_memory_pool *pool); switch_memory_pool_t *pool);
/*! /*!
\brief Feed data to the ASR module \brief Feed data to the ASR module
@ -907,7 +907,7 @@ SWITCH_DECLARE(switch_status) switch_core_directory_open(switch_directory_handle
char *source, char *source,
char *dsn, char *dsn,
char *passwd, char *passwd,
switch_memory_pool *pool); switch_memory_pool_t *pool);
/*! /*!
\brief Query a directory handle \brief Query a directory handle
@ -967,7 +967,7 @@ SWITCH_DECLARE(FILE *) switch_core_get_console(void);
/*! /*!
\brief Launch a thread \brief Launch a thread
*/ */
SWITCH_DECLARE(void) switch_core_launch_thread(void *(*func)(switch_thread *, void*), void *obj, switch_memory_pool *pool); SWITCH_DECLARE(void) switch_core_launch_thread(void *(*func)(switch_thread_t *, void*), void *obj, switch_memory_pool_t *pool);
/*! /*!
\brief Initiate Globals \brief Initiate Globals

View File

@ -63,7 +63,7 @@
BEGIN_EXTERN_C BEGIN_EXTERN_C
/*! \brief An event Header */ /*! \brief An event Header */
struct switch_event_header { struct switch_event_header{
/*! the header name */ /*! the header name */
char *name; char *name;
/*! the header value */ /*! the header value */
@ -82,7 +82,7 @@ struct switch_event_subclass {
/*! \brief Representation of an event */ /*! \brief Representation of an event */
struct switch_event { struct switch_event {
/*! the event id (descriptor) */ /*! the event id (descriptor) */
switch_event_t event_id; switch_event_types_t event_id;
/*! the priority of the event */ /*! the priority of the event */
switch_priority_t priority; switch_priority_t priority;
/*! the owner of the event */ /*! the owner of the event */
@ -90,7 +90,7 @@ struct switch_event {
/*! the subclass of the event */ /*! the subclass of the event */
switch_event_subclass *subclass; switch_event_subclass *subclass;
/*! the event headers */ /*! the event headers */
struct switch_event_header *headers; switch_event_header_t *headers;
/*! the body of the event */ /*! the body of the event */
char *body; char *body;
/*! user data from the subclass provider */ /*! user data from the subclass provider */
@ -105,7 +105,7 @@ struct switch_event_node {
/*! the id of the node */ /*! the id of the node */
char *id; char *id;
/*! the event id enumeration to bind to */ /*! the event id enumeration to bind to */
switch_event_t event_id; switch_event_types_t event_id;
/*! the event subclass to bind to for custom events */ /*! the event subclass to bind to for custom events */
switch_event_subclass *subclass; switch_event_subclass *subclass;
/*! a callback function to execute when the event is triggered */ /*! a callback function to execute when the event is triggered */
@ -122,7 +122,7 @@ struct switch_event_node {
\param pool the memory pool to use for the event system (creates a new one if NULL) \param pool the memory pool to use for the event system (creates a new one if NULL)
\return SWITCH_STATUS_SUCCESS when complete \return SWITCH_STATUS_SUCCESS when complete
*/ */
SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool *pool); SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool_t *pool);
/*! /*!
\brief Stop the eventing system \brief Stop the eventing system
@ -137,7 +137,7 @@ SWITCH_DECLARE(switch_status) switch_event_shutdown(void);
\param subclass_name the subclass name for custom event (only valid when event_id is SWITCH_EVENT_CUSTOM) \param subclass_name the subclass name for custom event (only valid when event_id is SWITCH_EVENT_CUSTOM)
\return SWITCH_STATUS_SUCCESS on success \return SWITCH_STATUS_SUCCESS on success
*/ */
SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, switch_event_t event_id, char *subclass_name); SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id, char *subclass_name);
/*! /*!
\brief Set the priority of an event \brief Set the priority of an event
@ -145,7 +145,7 @@ SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event,
\param priority the event priority \param priority the event priority
\return SWITCH_STATUS_SUCCESS \return SWITCH_STATUS_SUCCESS
*/ */
SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, switch_priority_t priority); SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event_t *event, switch_priority_t priority);
/*! /*!
\brief Retrieve a header value from an event \brief Retrieve a header value from an event
@ -153,7 +153,7 @@ SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, swi
\param header_name the name of the header to read \param header_name the name of the header to read
\return the value of the requested header \return the value of the requested header
*/ */
SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header_name); SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *header_name);
/*! /*!
\brief Add a header to an event \brief Add a header to an event
@ -163,13 +163,13 @@ SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header
\param fmt the value of the header (varargs see standard sprintf family) \param fmt the value of the header (varargs see standard sprintf family)
\return SWITCH_STATUS_SUCCESS if the header was added \return SWITCH_STATUS_SUCCESS if the header was added
*/ */
SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switch_stack_t stack, char *header_name, char *fmt, ...); SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name, char *fmt, ...);
/*! /*!
\brief Destroy an event \brief Destroy an event
\param event pointer to the pointer to event to destroy \param event pointer to the pointer to event to destroy
*/ */
SWITCH_DECLARE(void) switch_event_destroy(switch_event **event); SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event);
/*! /*!
\brief Duplicate an event \brief Duplicate an event
@ -177,7 +177,7 @@ SWITCH_DECLARE(void) switch_event_destroy(switch_event **event);
\param todup an event to duplicate \param todup an event to duplicate
\return SWITCH_STATUS_SUCCESS if the event was duplicated \return SWITCH_STATUS_SUCCESS if the event was duplicated
*/ */
SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_event *todup); SWITCH_DECLARE(switch_status) switch_event_dup(switch_event_t **event, switch_event_t *todup);
/*! /*!
\brief Fire an event with full arguement list \brief Fire an event with full arguement list
@ -188,7 +188,7 @@ SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_even
\param user_data optional private data to pass to the event handlers \param user_data optional private data to pass to the event handlers
\return \return
*/ */
SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event **event, void *user_data); SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event_t **event, void *user_data);
/*! /*!
\brief Bind an event callback to a specific event \brief Bind an event callback to a specific event
@ -199,14 +199,14 @@ SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func,
\param user_data optional user specific data to pass whenever the callback is invoked \param user_data optional user specific data to pass whenever the callback is invoked
\return SWITCH_STATUS_SUCCESS if the event was binded \return SWITCH_STATUS_SUCCESS if the event was binded
*/ */
SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_t event, char *subclass_name, switch_event_callback_t callback, void *user_data); SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback, void *user_data);
/*! /*!
\brief Render the name of an event id enumeration \brief Render the name of an event id enumeration
\param event the event id to render the name of \param event the event id to render the name of
\return the rendered name \return the rendered name
*/ */
SWITCH_DECLARE(char *) switch_event_name(switch_event_t event); SWITCH_DECLARE(char *) switch_event_name(switch_event_types_t event);
/*! /*!
\brief Reserve a subclass name for private use with a custom event \brief Reserve a subclass name for private use with a custom event
@ -227,7 +227,7 @@ SWITCH_DECLARE(switch_status) switch_event_reserve_subclass_detailed(char *owner
\return SWITCH_STATUS_SUCCESS if the operation was successful \return SWITCH_STATUS_SUCCESS if the operation was successful
\note the body supplied by this function will supersede an existing body the event may have \note the body supplied by this function will supersede an existing body the event may have
*/ */
SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event *event, char *buf, switch_size_t buflen, char *fmt, ...); SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event_t *event, char *buf, switch_size_t buflen, char *fmt, ...);
/*! /*!
\brief Determine if the event system has been initilized \brief Determine if the event system has been initilized
@ -242,7 +242,7 @@ SWITCH_DECLARE(switch_status) switch_event_running(void);
\return SWITCH_STATUS_SUCCESS if the body was added to the event \return SWITCH_STATUS_SUCCESS if the body was added to the event
\note the body parameter can be shadowed by the switch_event_reserve_subclass_detailed function \note the body parameter can be shadowed by the switch_event_reserve_subclass_detailed function
*/ */
SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *fmt, ...); SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event_t *event, char *fmt, ...);
/*! /*!
@ -266,7 +266,7 @@ SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *f
\param event the event to send (will be nulled) \param event the event to send (will be nulled)
\note normaly use switch_event_fire for delivering events (only use this when you wish to deliver the event blocking on your thread) \note normaly use switch_event_fire for delivering events (only use this when you wish to deliver the event blocking on your thread)
*/ */
SWITCH_DECLARE(void) switch_event_deliver(switch_event **event); SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event);
/*! /*!
\brief Fire an event filling in most of the arguements with obvious values \brief Fire an event filling in most of the arguements with obvious values

View File

@ -178,7 +178,7 @@ SWITCH_DECLARE(switch_directory_interface *) switch_loadable_module_get_director
\param arraylen the max size in elements of the array \param arraylen the max size in elements of the array
\return the number of elements added to the array \return the number of elements added to the array
*/ */
SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool *pool, SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool,
switch_codec_interface **array, switch_codec_interface **array,
int arraylen); int arraylen);

View File

@ -74,7 +74,7 @@ typedef switch_status (*switch_log_function)(const switch_log_node *node, switch
\param pool the memory pool to use \param pool the memory pool to use
\note to be called at application startup by the core \note to be called at application startup by the core
*/ */
SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool *pool); SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool_t *pool);
/*! /*!
\brief Shut down the logging engine \brief Shut down the logging engine

View File

@ -159,7 +159,7 @@ struct switch_io_event_hooks {
/*! \brief A table of i/o routines that an endpoint interface can implement */ /*! \brief A table of i/o routines that an endpoint interface can implement */
struct switch_io_routines { struct switch_io_routines {
/*! creates an outgoing session from given session, caller profile */ /*! creates an outgoing session from given session, caller profile */
switch_status (*outgoing_channel)(switch_core_session *, switch_caller_profile *, switch_core_session **, switch_memory_pool *); switch_status (*outgoing_channel)(switch_core_session *, switch_caller_profile *, switch_core_session **, switch_memory_pool_t *);
/*! answers the given session's channel */ /*! answers the given session's channel */
switch_status (*answer_channel)(switch_core_session *); switch_status (*answer_channel)(switch_core_session *);
/*! read a frame from a session */ /*! read a frame from a session */
@ -177,7 +177,7 @@ struct switch_io_routines {
/*! receive a message from another session*/ /*! receive a message from another session*/
switch_status (*receive_message)(switch_core_session *, switch_core_session_message *); switch_status (*receive_message)(switch_core_session *, switch_core_session_message *);
/*! queue a message for another session*/ /*! queue a message for another session*/
switch_status (*queue_event)(switch_core_session *, switch_event *); switch_status (*queue_event)(switch_core_session *, switch_event_t *);
}; };
/*! \brief Abstraction of an module endpoint interface /*! \brief Abstraction of an module endpoint interface
@ -216,7 +216,7 @@ struct switch_timer {
/*! the timer interface provided from a loadable module */ /*! the timer interface provided from a loadable module */
struct switch_timer_interface *timer_interface; struct switch_timer_interface *timer_interface;
/*! the timer's memory pool */ /*! the timer's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool_t *memory_pool;
/*! private data for loadable modules to store information */ /*! private data for loadable modules to store information */
void *private_info; void *private_info;
}; };
@ -287,7 +287,7 @@ struct switch_file_handle {
/*! the speed of the file playback*/ /*! the speed of the file playback*/
int speed; int speed;
/*! the handle's memory pool */ /*! the handle's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool_t *memory_pool;
/*! private data for the format module to store handle specific info */ /*! private data for the format module to store handle specific info */
void *private_info; void *private_info;
int64_t pos; int64_t pos;
@ -331,7 +331,7 @@ struct switch_speech_handle {
uint32_t flags; uint32_t flags;
/*! the handle's memory pool */ /*! the handle's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool_t *memory_pool;
/*! private data for the format module to store handle specific info */ /*! private data for the format module to store handle specific info */
void *private_info; void *private_info;
}; };
@ -364,7 +364,7 @@ struct switch_directory_handle {
uint32_t flags; uint32_t flags;
/*! the handle's memory pool */ /*! the handle's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool_t *memory_pool;
/*! private data for the format module to store handle specific info */ /*! private data for the format module to store handle specific info */
void *private_info; void *private_info;
}; };
@ -418,7 +418,7 @@ struct switch_codec {
/*! flags to modify behaviour */ /*! flags to modify behaviour */
uint32_t flags; uint32_t flags;
/*! the handle's memory pool*/ /*! the handle's memory pool*/
switch_memory_pool *memory_pool; switch_memory_pool_t *memory_pool;
/*! private data for the codec module to store handle specific info */ /*! private data for the codec module to store handle specific info */
void *private_info; void *private_info;
}; };

View File

@ -53,7 +53,7 @@ BEGIN_EXTERN_C
*/ */
/*! \brief An audio resampling handle */ /*! \brief An audio resampling handle */
struct switch_audio_resampler { typedef struct {
/*! a pointer to store the resampler object */ /*! a pointer to store the resampler object */
void *resampler; void *resampler;
/*! the rate to resample from in hz */ /*! the rate to resample from in hz */
@ -74,7 +74,7 @@ struct switch_audio_resampler {
uint32_t to_len; uint32_t to_len;
/*! the total size of the to buffer */ /*! the total size of the to buffer */
uint32_t to_size; uint32_t to_size;
}; } switch_audio_resampler_t;
/*! /*!
\brief Prepare a new resampler handle \brief Prepare a new resampler handle
@ -86,18 +86,18 @@ struct switch_audio_resampler {
\param pool the memory pool to use for buffer allocation \param pool the memory pool to use for buffer allocation
\return SWITCH_STATUS_SUCCESS if the handle was created \return SWITCH_STATUS_SUCCESS if the handle was created
*/ */
SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler **new_resampler, SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler_t **new_resampler,
int from_rate, int from_rate,
switch_size_t from_size, switch_size_t from_size,
int to_rate, int to_rate,
uint32_t to_size, uint32_t to_size,
switch_memory_pool *pool); switch_memory_pool_t *pool);
/*! /*!
\brief Destroy an existing resampler handle \brief Destroy an existing resampler handle
\param resampler the resampler handle to destroy \param resampler the resampler handle to destroy
*/ */
SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler *resampler); SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler_t *resampler);
/*! /*!
\brief Resample one float buffer into another using specifications of a given handle \brief Resample one float buffer into another using specifications of a given handle
@ -109,7 +109,7 @@ SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler *resampler);
\param last parameter denoting the last sample is being resampled \param last parameter denoting the last sample is being resampled
\return the used size of dst \return the used size of dst
*/ */
SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler *resampler, float *src, int srclen, float *dst, uint32_t dstlen, int last); SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler_t *resampler, float *src, int srclen, float *dst, uint32_t dstlen, int last);
/*! /*!
\brief Convert an array of floats to an array of shorts \brief Convert an array of floats to an array of shorts

View File

@ -45,7 +45,7 @@ BEGIN_EXTERN_C
///\defgroup rtp RTP (RealTime Transport Protocol) ///\defgroup rtp RTP (RealTime Transport Protocol)
///\ingroup core1 ///\ingroup core1
///\{ ///\{
typedef void (*switch_rtp_invalid_handler)(switch_rtp *rtp_session, typedef void (*switch_rtp_invalid_handler)(switch_rtp_t *rtp_session,
switch_socket_t *sock, switch_socket_t *sock,
void *data, void *data,
switch_size_t datalen, switch_size_t datalen,
@ -56,7 +56,7 @@ typedef void (*switch_rtp_invalid_handler)(switch_rtp *rtp_session,
\param pool the memory pool to use for long term allocations \param pool the memory pool to use for long term allocations
\note Generally called by the core_init \note Generally called by the core_init
*/ */
SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool *pool); SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool);
/*! /*!
\brief Request a new port to be used for media \brief Request a new port to be used for media
@ -76,14 +76,14 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void);
\param pool a memory pool to use for the session \param pool a memory pool to use for the session
\return the new RTP session or NULL on failure \return the new RTP session or NULL on failure
*/ */
SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session, SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp_t **new_rtp_session,
switch_payload_t payload, switch_payload_t payload,
uint32_t packet_size, uint32_t packet_size,
uint32_t ms_per_packet, uint32_t ms_per_packet,
switch_rtp_flag_t flags, switch_rtp_flag_t flags,
char *crypto_key, char *crypto_key,
const char **err, const char **err,
switch_memory_pool *pool); switch_memory_pool_t *pool);
/*! /*!
@ -101,7 +101,7 @@ SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session,
\param pool a memory pool to use for the session \param pool a memory pool to use for the session
\return the new RTP session or NULL on failure \return the new RTP session or NULL on failure
*/ */
SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host,
switch_port_t rx_port, switch_port_t rx_port,
char *tx_host, char *tx_host,
switch_port_t tx_port, switch_port_t tx_port,
@ -111,7 +111,7 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host,
switch_rtp_flag_t flags, switch_rtp_flag_t flags,
char *crypto_key, char *crypto_key,
const char **err, const char **err,
switch_memory_pool *pool); switch_memory_pool_t *pool);
/*! /*!
@ -121,7 +121,7 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host,
\param port the remote port \param port the remote port
\param err pointer for error messages \param err pointer for error messages
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err); SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err);
/*! /*!
\brief Assign a local address to the RTP session \brief Assign a local address to the RTP session
@ -131,32 +131,32 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_sess
\param err pointer for error messages \param err pointer for error messages
\note this call also binds the RTP session's socket to the new address \note this call also binds the RTP session's socket to the new address
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err); SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err);
/*! /*!
\brief Kill the socket on an existing RTP session \brief Kill the socket on an existing RTP session
\param rtp_session an RTP session to kill the socket of \param rtp_session an RTP session to kill the socket of
*/ */
SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp *rtp_session); SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp_t *rtp_session);
/*! /*!
\brief Destroy an RTP session \brief Destroy an RTP session
\param rtp_session an RTP session to destroy \param rtp_session an RTP session to destroy
*/ */
SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp **rtp_session); SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session);
/*! /*!
\brief Acvite ICE on an RTP session \brief Acvite ICE on an RTP session
\return SWITCH_STATUS_SUCCESS \return SWITCH_STATUS_SUCCESS
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, char *login, char *rlogin); SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp_t *rtp_session, char *login, char *rlogin);
/*! /*!
\brief Set an RTP Flag \brief Set an RTP Flag
\param rtp_session the RTP session \param rtp_session the RTP session
\param flags the flags to set \param flags the flags to set
*/ */
SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags); SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags);
/*! /*!
\brief Test an RTP Flag \brief Test an RTP Flag
@ -164,49 +164,49 @@ SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp *rtp_session, switch_rtp_fla
\param flags the flags to test \param flags the flags to test
\return TRUE or FALSE \return TRUE or FALSE
*/ */
SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags); SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags);
/*! /*!
\brief Clear an RTP Flag \brief Clear an RTP Flag
\param rtp_session the RTP session \param rtp_session the RTP session
\param flags the flags to clear \param flags the flags to clear
*/ */
SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags); SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags);
/*! /*!
\brief Retrieve the socket from an existing RTP session \brief Retrieve the socket from an existing RTP session
\param rtp_session the RTP session to retrieve the socket from \param rtp_session the RTP session to retrieve the socket from
\return the socket from the RTP session \return the socket from the RTP session
*/ */
SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp *rtp_session); SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp_t *rtp_session);
/*! /*!
\brief Set the default packet size for a given RTP session \brief Set the default packet size for a given RTP session
\param rtp_session the RTP session to set the packet size on \param rtp_session the RTP session to set the packet size on
\param packet_size the new default packet size \param packet_size the new default packet size
*/ */
SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp *rtp_session, uint16_t packet_size); SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp_t *rtp_session, uint16_t packet_size);
/*! /*!
\brief Get the default packet size for a given RTP session \brief Get the default packet size for a given RTP session
\param rtp_session the RTP session to get the packet size from \param rtp_session the RTP session to get the packet size from
\return the default packet_size of the RTP session \return the default packet_size of the RTP session
*/ */
SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp *rtp_session); SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp_t *rtp_session);
/*! /*!
\brief Set the default payload number for a given RTP session \brief Set the default payload number for a given RTP session
\param rtp_session the RTP session to set the payload number on \param rtp_session the RTP session to set the payload number on
\param payload the new default payload number \param payload the new default payload number
*/ */
SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp *rtp_session, switch_payload_t payload); SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp_t *rtp_session, switch_payload_t payload);
/*! /*!
\brief Get the default payload number for a given RTP session \brief Get the default payload number for a given RTP session
\param rtp_session the RTP session to get the payload number from \param rtp_session the RTP session to get the payload number from
\return the default payload of the RTP session \return the default payload of the RTP session
*/ */
SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp *rtp_session); SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp_t *rtp_session);
/*! /*!
@ -215,7 +215,7 @@ SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp *rtp_session)
\param on_invalid the function to set \param on_invalid the function to set
\return \return
*/ */
SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, switch_rtp_invalid_handler on_invalid); SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp_t *rtp_session, switch_rtp_invalid_handler on_invalid);
/*! /*!
\brief Read data from a given RTP session \brief Read data from a given RTP session
@ -226,7 +226,7 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, swit
\param flags flags \param flags flags
\return the number of bytes read \return the number of bytes read
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags); SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags);
/*! /*!
\brief Read data from a given RTP session without copying \brief Read data from a given RTP session without copying
@ -237,7 +237,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *dat
\param flags flags \param flags flags
\return the number of bytes read \return the number of bytes read
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags); SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp_t *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags);
/*! /*!
\brief Read data from a given RTP session without copying \brief Read data from a given RTP session without copying
@ -245,7 +245,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session,
\param frame a frame to populate with information \param frame a frame to populate with information
\return the number of bytes read \return the number of bytes read
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_session, switch_frame *frame); SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame *frame);
/*! /*!
\brief Write data to a given RTP session \brief Write data to a given RTP session
@ -256,7 +256,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_ses
\param flags frame flags \param flags frame flags
\return the number of bytes written \return the number of bytes written
*/ */
SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags); SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags);
/*! /*!
\brief Enable VAD on an RTP Session \brief Enable VAD on an RTP Session
@ -266,14 +266,14 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32
\param flags flags for control \param flags flags for control
\return SWITCH_STAUTS_SUCCESS on success \return SWITCH_STAUTS_SUCCESS on success
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags); SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags);
/*! /*!
\brief Disable VAD on an RTP Session \brief Disable VAD on an RTP Session
\param rtp_session the RTP session \param rtp_session the RTP session
\return SWITCH_STAUTS_SUCCESS on success \return SWITCH_STAUTS_SUCCESS on success
*/ */
SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session); SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp_t *rtp_session);
/*! /*!
\brief Write data to a given RTP session \brief Write data to a given RTP session
@ -282,7 +282,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session);
\param ts then number of bytes to increment the timestamp by \param ts then number of bytes to increment the timestamp by
\return the number of bytes written \return the number of bytes written
*/ */
SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame *frame, uint32_t ts); SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame *frame, uint32_t ts);
/*! /*!
\brief Write data with a specified payload and sequence number to a given RTP session \brief Write data with a specified payload and sequence number to a given RTP session
@ -296,28 +296,28 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame
\param flags frame flags \param flags frame flags
\return the number of bytes written \return the number of bytes written
*/ */
SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp *rtp_session, void *data, uint16_t datalen, uint8_t m, switch_payload_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags); SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, void *data, uint16_t datalen, uint8_t m, switch_payload_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags);
/*! /*!
\brief Retrieve the SSRC from a given RTP session \brief Retrieve the SSRC from a given RTP session
\param rtp_session the RTP session to retrieve from \param rtp_session the RTP session to retrieve from
\return the SSRC \return the SSRC
*/ */
SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp *rtp_session); SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp_t *rtp_session);
/*! /*!
\brief Associate an arbitrary data pointer with and RTP session \brief Associate an arbitrary data pointer with and RTP session
\param rtp_session the RTP session to assign the pointer to \param rtp_session the RTP session to assign the pointer to
\param private_data the private data to assign \param private_data the private data to assign
*/ */
SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp *rtp_session, void *private_data); SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp_t *rtp_session, void *private_data);
/*! /*!
\brief Retrieve the private data from a given RTP session \brief Retrieve the private data from a given RTP session
\param rtp_session the RTP session to retrieve the data from \param rtp_session the RTP session to retrieve the data from
\return the pointer to the private data \return the pointer to the private data
*/ */
SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp *rtp_session); SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp_t *rtp_session);
/*! /*!
\} \}

View File

@ -214,7 +214,7 @@ SWITCH_DECLARE(switch_status) switch_stun_lookup (char **ip,
char *stunip, char *stunip,
switch_port_t stunport, switch_port_t stunport,
char **err, char **err,
switch_memory_pool *pool); switch_memory_pool_t *pool);

View File

@ -491,7 +491,7 @@ typedef enum {
also never put any new ones before EVENT_ALL also never put any new ones before EVENT_ALL
*/ */
/*! /*!
\enum switch_event_t \enum switch_event_type_t
\brief Built-in Events \brief Built-in Events
<pre> <pre>
@ -541,7 +541,7 @@ typedef enum {
SWITCH_EVENT_NOTALK, SWITCH_EVENT_NOTALK,
SWITCH_EVENT_SESSION_CRASH, SWITCH_EVENT_SESSION_CRASH,
SWITCH_EVENT_ALL SWITCH_EVENT_ALL
} switch_event_t; } switch_event_types_t;
typedef enum { typedef enum {
@ -594,11 +594,10 @@ typedef enum {
typedef uint8_t switch_payload_t; typedef uint8_t switch_payload_t;
typedef struct switch_rtp switch_rtp; typedef struct switch_rtp switch_rtp_t;
typedef struct switch_core_session_message switch_core_session_message; typedef struct switch_core_session_message switch_core_session_message;
typedef struct switch_audio_resampler switch_audio_resampler; typedef struct switch_event_header switch_event_header_t;
typedef struct switch_event_header switch_event_header; typedef struct switch_event switch_event_t;
typedef struct switch_event switch_event;
typedef struct switch_event_subclass switch_event_subclass; typedef struct switch_event_subclass switch_event_subclass;
typedef struct switch_event_node switch_event_node; typedef struct switch_event_node switch_event_node;
typedef struct switch_loadable_module switch_loadable_module; typedef struct switch_loadable_module switch_loadable_module;
@ -643,13 +642,13 @@ typedef struct switch_speech_interface switch_speech_interface;
typedef struct switch_directory_handle switch_directory_handle; typedef struct switch_directory_handle switch_directory_handle;
typedef struct switch_directory_interface switch_directory_interface; typedef struct switch_directory_interface switch_directory_interface;
typedef void (*switch_application_function)(switch_core_session *, char *); typedef void (*switch_application_function)(switch_core_session *, char *);
typedef void (*switch_event_callback_t)(switch_event *); typedef void (*switch_event_callback_t)(switch_event_t *);
typedef switch_caller_extension *(*switch_dialplan_hunt_function)(switch_core_session *); typedef switch_caller_extension *(*switch_dialplan_hunt_function)(switch_core_session *);
typedef switch_status (*switch_state_handler)(switch_core_session *); typedef switch_status (*switch_state_handler)(switch_core_session *);
typedef switch_status (*switch_outgoing_channel_hook)(switch_core_session *, switch_caller_profile *, switch_core_session *); typedef switch_status (*switch_outgoing_channel_hook)(switch_core_session *, switch_caller_profile *, switch_core_session *);
typedef switch_status (*switch_answer_channel_hook)(switch_core_session *); typedef switch_status (*switch_answer_channel_hook)(switch_core_session *);
typedef switch_status (*switch_receive_message_hook)(switch_core_session *, switch_core_session_message *); typedef switch_status (*switch_receive_message_hook)(switch_core_session *, switch_core_session_message *);
typedef switch_status (*switch_queue_event_hook)(switch_core_session *, switch_event *); typedef switch_status (*switch_queue_event_hook)(switch_core_session *, switch_event_t *);
typedef switch_status (*switch_read_frame_hook)(switch_core_session *, switch_frame **, int, switch_io_flag, int); typedef switch_status (*switch_read_frame_hook)(switch_core_session *, switch_frame **, int, switch_io_flag, int);
typedef switch_status (*switch_write_frame_hook)(switch_core_session *, switch_frame *, int, switch_io_flag, int); typedef switch_status (*switch_write_frame_hook)(switch_core_session *, switch_frame *, int, switch_io_flag, int);
typedef switch_status (*switch_kill_channel_hook)(switch_core_session *, int); typedef switch_status (*switch_kill_channel_hook)(switch_core_session *, int);

View File

@ -157,7 +157,7 @@ SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char
\param pool the memory pool to use \param pool the memory pool to use
\return SWITCH_STATUS_SUCCESS when successful \return SWITCH_STATUS_SUCCESS when successful
*/ */
SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock, switch_int16_t flags, switch_memory_pool *pool); SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock, switch_int16_t flags, switch_memory_pool_t *pool);
/*! /*!
\brief Wait for a socket \brief Wait for a socket

View File

@ -37,7 +37,7 @@
static const char modname[] = "mod_dingaling"; static const char modname[] = "mod_dingaling";
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
typedef enum { typedef enum {
TFLAG_IO = (1 << 0), TFLAG_IO = (1 << 0),
@ -74,7 +74,7 @@ static struct {
int codec_rates_last; int codec_rates_last;
unsigned int flags; unsigned int flags;
unsigned int init; unsigned int init;
switch_hash *profile_hash; switch_hash_t *profile_hash;
int running; int running;
int handles; int handles;
} globals; } globals;
@ -107,7 +107,7 @@ struct private_object {
switch_codec_interface *codecs[SWITCH_MAX_CODECS]; switch_codec_interface *codecs[SWITCH_MAX_CODECS];
unsigned int num_codecs; unsigned int num_codecs;
int codec_index; int codec_index;
struct switch_rtp *rtp_session; switch_rtp_t *rtp_session;
ldl_session_t *dlsession; ldl_session_t *dlsession;
char *remote_ip; char *remote_ip;
switch_port_t local_port; switch_port_t local_port;
@ -155,7 +155,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
static switch_status channel_on_loopback(switch_core_session *session); static switch_status channel_on_loopback(switch_core_session *session);
static switch_status channel_on_transmit(switch_core_session *session); static switch_status channel_on_transmit(switch_core_session *session);
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool); switch_core_session **new_session, switch_memory_pool_t *pool);
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout, static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
switch_io_flag flags, int stream_id); switch_io_flag flags, int stream_id);
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout, static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
@ -200,7 +200,7 @@ static void get_codecs(struct private_object *tech_pvt)
static void *SWITCH_THREAD_FUNC handle_thread_run(switch_thread *thread, void *obj) static void *SWITCH_THREAD_FUNC handle_thread_run(switch_thread_t *thread, void *obj)
{ {
ldl_handle_t *handle = obj; ldl_handle_t *handle = obj;
struct mdl_profile *profile = NULL; struct mdl_profile *profile = NULL;
@ -217,7 +217,7 @@ static void *SWITCH_THREAD_FUNC handle_thread_run(switch_thread *thread, void *o
static void handle_thread_launch(ldl_handle_t *handle) static void handle_thread_launch(ldl_handle_t *handle)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
switch_threadattr_create(&thd_attr, module_pool); switch_threadattr_create(&thd_attr, module_pool);
@ -449,7 +449,7 @@ static int do_describe(struct private_object *tech_pvt, int force)
return 0; return 0;
} }
static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread *thread, void *obj) static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, void *obj)
{ {
switch_core_session *session = obj; switch_core_session *session = obj;
@ -532,7 +532,7 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread *thread, void
static void negotiate_thread_launch(switch_core_session *session) static void negotiate_thread_launch(switch_core_session *session)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
switch_threadattr_create(&thd_attr, switch_core_session_get_pool(session)); switch_threadattr_create(&thd_attr, switch_core_session_get_pool(session));
@ -1009,7 +1009,7 @@ static const switch_loadable_module_interface channel_module_interface = {
that allocate memory or you will have 1 channel with memory allocated from another channel's pool! that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/ */
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool) switch_core_session **new_session, switch_memory_pool_t *pool)
{ {
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) { if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt; struct private_object *tech_pvt;

View File

@ -41,7 +41,7 @@
static const char modname[] = "mod_exosip"; static const char modname[] = "mod_exosip";
#define STRLEN 15 #define STRLEN 15
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
@ -88,8 +88,8 @@ static struct {
char *codec_string; char *codec_string;
char *codec_order[SWITCH_MAX_CODECS]; char *codec_order[SWITCH_MAX_CODECS];
int codec_order_last; int codec_order_last;
switch_hash *call_hash; switch_hash_t *call_hash;
switch_hash *srtp_hash; switch_hash_t *srtp_hash;
int running; int running;
int codec_ms; int codec_ms;
int dtmf_duration; int dtmf_duration;
@ -110,7 +110,7 @@ struct private_object {
int32_t timestamp_recv; int32_t timestamp_recv;
int32_t timestamp_dtmf; int32_t timestamp_dtmf;
int payload_num; int payload_num;
struct switch_rtp *rtp_session; switch_rtp_t *rtp_session;
struct osip_rfc3264 *sdp_config; struct osip_rfc3264 *sdp_config;
sdp_message_t *remote_sdp; sdp_message_t *remote_sdp;
sdp_message_t *local_sdp; sdp_message_t *local_sdp;
@ -150,7 +150,7 @@ static switch_status exosip_on_hangup(switch_core_session *session);
static switch_status exosip_on_loopback(switch_core_session *session); static switch_status exosip_on_loopback(switch_core_session *session);
static switch_status exosip_on_transmit(switch_core_session *session); static switch_status exosip_on_transmit(switch_core_session *session);
static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool); switch_core_session **new_session, switch_memory_pool_t *pool);
static switch_status exosip_read_frame(switch_core_session *session, switch_frame **frame, int timeout, static switch_status exosip_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
switch_io_flag flags, int stream_id); switch_io_flag flags, int stream_id);
static switch_status exosip_write_frame(switch_core_session *session, switch_frame *frame, int timeout, static switch_status exosip_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
@ -996,7 +996,7 @@ static const switch_loadable_module_interface exosip_module_interface = {
}; };
static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool) switch_core_session **new_session, switch_memory_pool_t *pool)
{ {
if ((*new_session = switch_core_session_request(&exosip_endpoint_interface, pool)) != 0) { if ((*new_session = switch_core_session_request(&exosip_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt; struct private_object *tech_pvt;
@ -1808,7 +1808,7 @@ static int config_exosip(int reload)
SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void) SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
{ {
eXosip_event_t *event = NULL; eXosip_event_t *event = NULL;
switch_event *s_event; switch_event_t *s_event;
config_exosip(0); config_exosip(0);

View File

@ -44,7 +44,7 @@
static const char modname[] = "mod_iax"; static const char modname[] = "mod_iax";
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
static int running = 1; static int running = 1;
@ -396,7 +396,7 @@ static switch_status channel_on_ring(switch_core_session *session);
static switch_status channel_on_loopback(switch_core_session *session); static switch_status channel_on_loopback(switch_core_session *session);
static switch_status channel_on_transmit(switch_core_session *session); static switch_status channel_on_transmit(switch_core_session *session);
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool); switch_core_session **new_session, switch_memory_pool_t *pool);
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout, static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
switch_io_flag flags, int stream_id); switch_io_flag flags, int stream_id);
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout, static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
@ -724,7 +724,7 @@ static const switch_loadable_module_interface channel_module_interface = {
that allocate memory or you will have 1 channel with memory allocated from another channel's pool! that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/ */
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool) switch_core_session **new_session, switch_memory_pool_t *pool)
{ {
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) { if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt; struct private_object *tech_pvt;
@ -871,7 +871,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
{ {
//int refresh; //int refresh;
struct iax_event *iaxevent = NULL; struct iax_event *iaxevent = NULL;
switch_event *s_event; switch_event_t *s_event;
if (load_config() != SWITCH_STATUS_SUCCESS) { if (load_config() != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_TERM; return SWITCH_STATUS_TERM;
} }

View File

@ -41,7 +41,7 @@
static const char modname[] = "mod_portaudio"; static const char modname[] = "mod_portaudio";
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
//static int running = 1; //static int running = 1;
#define SAMPLE_TYPE paInt16 #define SAMPLE_TYPE paInt16
@ -73,7 +73,7 @@ static struct {
int indev; int indev;
int outdev; int outdev;
int call_id; int call_id;
switch_hash *call_hash; switch_hash_t *call_hash;
switch_mutex_t *device_lock; switch_mutex_t *device_lock;
int sample_rate; int sample_rate;
} globals; } globals;
@ -105,7 +105,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
static switch_status channel_on_transmit(switch_core_session *session); static switch_status channel_on_transmit(switch_core_session *session);
static switch_status channel_outgoing_channel(switch_core_session *session, static switch_status channel_outgoing_channel(switch_core_session *session,
switch_caller_profile *outbound_profile, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool); switch_core_session **new_session, switch_memory_pool_t *pool);
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout, static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
switch_io_flag flags, int stream_id); switch_io_flag flags, int stream_id);
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout, static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
@ -268,7 +268,7 @@ static switch_status channel_on_transmit(switch_core_session *session)
while (switch_channel_get_state(channel) == CS_TRANSMIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) { while (switch_channel_get_state(channel) == CS_TRANSMIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
if (switch_time_now() - last >= waitsec) { if (switch_time_now() - last >= waitsec) {
char buf[512]; char buf[512];
switch_event *event; switch_event_t *event;
snprintf(buf, sizeof(buf), "BRRRRING! BRRRRING! call %s\n", tech_pvt->call_id); snprintf(buf, sizeof(buf), "BRRRRING! BRRRRING! call %s\n", tech_pvt->call_id);
@ -476,7 +476,7 @@ static const switch_loadable_module_interface channel_module_interface = {
that allocate memory or you will have 1 channel with memory allocated from another channel's pool! that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/ */
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool) switch_core_session **new_session, switch_memory_pool_t *pool)
{ {
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) { if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt; struct private_object *tech_pvt;

View File

@ -50,7 +50,7 @@
static const char modname[] = "mod_woomera"; static const char modname[] = "mod_woomera";
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
#define STRLEN 15 #define STRLEN 15
#define FRAME_LEN 480 #define FRAME_LEN 480
@ -169,7 +169,7 @@ static switch_status woomerachan_on_ring(switch_core_session *session);
static switch_status woomerachan_on_loopback(switch_core_session *session); static switch_status woomerachan_on_loopback(switch_core_session *session);
static switch_status woomerachan_on_transmit(switch_core_session *session); static switch_status woomerachan_on_transmit(switch_core_session *session);
static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool); switch_core_session **new_session, switch_memory_pool_t *pool);
static switch_status woomerachan_read_frame(switch_core_session *session, switch_frame **frame, int timeout, static switch_status woomerachan_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
switch_io_flag flags, int stream_id); switch_io_flag flags, int stream_id);
static switch_status woomerachan_write_frame(switch_core_session *session, switch_frame *frame, int timeout, static switch_status woomerachan_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
@ -186,7 +186,7 @@ static int connect_woomera(switch_socket_t **new_sock, woomera_profile * profile
static int woomera_profile_thread_running(woomera_profile * profile, int set, int new); static int woomera_profile_thread_running(woomera_profile * profile, int set, int new);
static int woomera_locate_socket(woomera_profile * profile, switch_socket_t **woomera_socket); static int woomera_locate_socket(woomera_profile * profile, switch_socket_t **woomera_socket);
static int tech_create_read_socket(private_object * tech_pvt); static int tech_create_read_socket(private_object * tech_pvt);
static void *woomera_channel_thread_run(switch_thread *thread, void *obj); static void *woomera_channel_thread_run(switch_thread_t *thread, void *obj);
static void *woomera_thread_run(void *obj); static void *woomera_thread_run(void *obj);
static int tech_activate(private_object * tech_pvt); static int tech_activate(private_object * tech_pvt);
@ -473,7 +473,7 @@ static const switch_loadable_module_interface woomerachan_module_interface = {
that allocate memory or you will have 1 channel with memory allocated from another channel's pool! that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/ */
static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool *pool) switch_core_session **new_session, switch_memory_pool_t *pool)
{ {
if ((*new_session = switch_core_session_request(&woomerachan_endpoint_interface, pool)) != 0) { if ((*new_session = switch_core_session_request(&woomerachan_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt; struct private_object *tech_pvt;
@ -858,7 +858,7 @@ static int woomera_locate_socket(woomera_profile * profile, switch_socket_t **wo
static int tech_create_read_socket(private_object * tech_pvt) static int tech_create_read_socket(private_object * tech_pvt)
{ {
switch_memory_pool *pool = switch_core_session_get_pool(tech_pvt->session); switch_memory_pool_t *pool = switch_core_session_get_pool(tech_pvt->session);
if ((tech_pvt->port = globals.next_woomera_port++) >= WOOMERA_MAX_PORT) { if ((tech_pvt->port = globals.next_woomera_port++) >= WOOMERA_MAX_PORT) {
tech_pvt->port = globals.next_woomera_port = WOOMERA_MIN_PORT; tech_pvt->port = globals.next_woomera_port = WOOMERA_MIN_PORT;
@ -926,7 +926,7 @@ static int tech_activate(private_object * tech_pvt)
static void *woomera_channel_thread_run(switch_thread *thread, void *obj) static void *woomera_channel_thread_run(switch_thread_t *thread, void *obj)
{ {
switch_core_session *session = obj; switch_core_session *session = obj;
switch_channel *channel = NULL; switch_channel *channel = NULL;

View File

@ -33,7 +33,7 @@
static const char modname[] = "mod_event_multicast"; static const char modname[] = "mod_event_multicast";
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
static struct { static struct {
char *address; char *address;
@ -81,7 +81,7 @@ static switch_status load_config(void)
} }
static void event_handler(switch_event *event) static void event_handler(switch_event_t *event)
{ {
char buf[1024]; char buf[1024];
size_t len; size_t len;
@ -189,7 +189,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void) SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
{ {
switch_event *local_event; switch_event_t *local_event;
char buf[1024]; char buf[1024];
globals.running = 1; globals.running = 1;

View File

@ -36,7 +36,7 @@ static const char modname[] = "mod_event_test";
//#define TORTURE_ME //#define TORTURE_ME
static void event_handler(switch_event *event) static void event_handler(switch_event_t *event)
{ {
char buf[1024]; char buf[1024];
@ -68,12 +68,12 @@ static switch_loadable_module_interface event_test_module_interface = {
#define TTHREADS 500 #define TTHREADS 500
static int THREADS = 0; static int THREADS = 0;
static void *torture_thread(switch_thread *thread, void *obj) static void *torture_thread(switch_thread_t *thread, void *obj)
{ {
int y = 0; int y = 0;
int z = 0; int z = 0;
switch_core_thread_session *ts = obj; switch_core_thread_session *ts = obj;
switch_event *event; switch_event_t *event;
z = THREADS++; z = THREADS++;
@ -89,7 +89,7 @@ static void *torture_thread(switch_thread *thread, void *obj)
} }
if (ts->pool) { if (ts->pool) {
switch_memory_pool *pool = ts->pool; switch_memory_pool_t *pool = ts->pool;
switch_core_destroy_memory_pool(&pool); switch_core_destroy_memory_pool(&pool);
} }

View File

@ -58,7 +58,7 @@ static struct {
struct session session; struct session session;
} globals; } globals;
static void event_handler(switch_event *event) static void event_handler(switch_event_t *event)
{ {
char buf[1024]; char buf[1024];
iks *msg; iks *msg;

View File

@ -34,7 +34,7 @@
static const char modname[] = "mod_zeroconf"; static const char modname[] = "mod_zeroconf";
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
static struct { static struct {
sw_discovery discovery; sw_discovery discovery;
@ -121,7 +121,7 @@ static sw_result HOWL_API my_service_reply(sw_discovery discovery,
} }
static void event_handler(switch_event *event) static void event_handler(switch_event_t *event)
{ {
sw_text_record text_record; sw_text_record text_record;
sw_result result; sw_result result;
@ -132,7 +132,7 @@ static void event_handler(switch_event *event)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sw_text_record_init() failed\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sw_text_record_init() failed\n");
return; return;
} else { } else {
switch_event_header *hp; switch_event_header_t *hp;
char *service = switch_event_get_header(event, "service"); char *service = switch_event_get_header(event, "service");
char *port = switch_event_get_header(event, "port"); char *port = switch_event_get_header(event, "port");
sw_port porti = 0; sw_port porti = 0;

View File

@ -120,7 +120,7 @@ struct teletone_obj {
switch_codec codec; switch_codec codec;
switch_buffer *audio_buffer; switch_buffer *audio_buffer;
switch_buffer *loop_buffer; switch_buffer *loop_buffer;
switch_memory_pool *pool; switch_memory_pool_t *pool;
switch_timer *timer; switch_timer *timer;
switch_timer timer_base; switch_timer timer_base;
char code_buffer[1024]; char code_buffer[1024];
@ -132,14 +132,14 @@ struct fileio_obj {
char *path; char *path;
unsigned int flags; unsigned int flags;
switch_file_t *fd; switch_file_t *fd;
switch_memory_pool *pool; switch_memory_pool_t *pool;
char *buf; char *buf;
switch_size_t buflen; switch_size_t buflen;
int32 bufsize; int32 bufsize;
}; };
struct db_obj { struct db_obj {
switch_memory_pool *pool; switch_memory_pool_t *pool;
switch_core_db *db; switch_core_db *db;
switch_core_db_stmt *stmt; switch_core_db_stmt *stmt;
char *dbname; char *dbname;
@ -965,7 +965,7 @@ static int teletone_handler(teletone_generation_session_t *ts, teletone_tone_map
/*********************************************************************************/ /*********************************************************************************/
static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{ {
switch_memory_pool *pool = NULL; switch_memory_pool_t *pool = NULL;
if (argc > 2) { if (argc > 2) {
struct js_session *jss = NULL; struct js_session *jss = NULL;
JSObject *session_obj; JSObject *session_obj;
@ -1070,7 +1070,7 @@ static void session_destroy(JSContext *cx, JSObject *obj)
/*********************************************************************************/ /*********************************************************************************/
static JSBool fileio_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) static JSBool fileio_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{ {
switch_memory_pool *pool; switch_memory_pool_t *pool;
switch_file_t *fd; switch_file_t *fd;
char *path, *flags_str; char *path, *flags_str;
unsigned int flags = 0; unsigned int flags = 0;
@ -1120,7 +1120,7 @@ static void fileio_destroy(JSContext *cx, JSObject *obj)
struct fileio_obj *fio = JS_GetPrivate(cx, obj); struct fileio_obj *fio = JS_GetPrivate(cx, obj);
if (fio) { if (fio) {
switch_memory_pool *pool = fio->pool; switch_memory_pool_t *pool = fio->pool;
switch_core_destroy_memory_pool(&pool); switch_core_destroy_memory_pool(&pool);
pool = NULL; pool = NULL;
} }
@ -1241,7 +1241,7 @@ JSClass fileio_class = {
/*********************************************************************************/ /*********************************************************************************/
static JSBool db_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) static JSBool db_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{ {
switch_memory_pool *pool; switch_memory_pool_t *pool;
switch_core_db *db; switch_core_db *db;
struct db_obj *dbo; struct db_obj *dbo;
@ -1271,7 +1271,7 @@ static void db_destroy(JSContext *cx, JSObject *obj)
struct db_obj *dbo = JS_GetPrivate(cx, obj); struct db_obj *dbo = JS_GetPrivate(cx, obj);
if (dbo) { if (dbo) {
switch_memory_pool *pool = dbo->pool; switch_memory_pool_t *pool = dbo->pool;
if (dbo->stmt) { if (dbo->stmt) {
switch_core_db_finalize(dbo->stmt); switch_core_db_finalize(dbo->stmt);
dbo->stmt = NULL; dbo->stmt = NULL;
@ -1472,7 +1472,7 @@ static JSBool teletone_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
struct teletone_obj *tto = NULL; struct teletone_obj *tto = NULL;
struct js_session *jss = NULL; struct js_session *jss = NULL;
switch_codec *read_codec; switch_codec *read_codec;
switch_memory_pool *pool; switch_memory_pool_t *pool;
char *timer_name = NULL; char *timer_name = NULL;
if (argc > 0) { if (argc > 0) {
@ -1549,7 +1549,7 @@ static JSBool teletone_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
static void teletone_destroy(JSContext *cx, JSObject *obj) static void teletone_destroy(JSContext *cx, JSObject *obj)
{ {
struct teletone_obj *tto = JS_GetPrivate(cx, obj); struct teletone_obj *tto = JS_GetPrivate(cx, obj);
switch_memory_pool *pool; switch_memory_pool_t *pool;
if (tto) { if (tto) {
if (tto->timer) { if (tto->timer) {
switch_core_timer_destroy(tto->timer); switch_core_timer_destroy(tto->timer);
@ -2114,7 +2114,7 @@ static void js_parse_and_execute(switch_core_session *session, char *input_code)
static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread *thread, void *obj) static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t *thread, void *obj)
{ {
char *input_code = obj; char *input_code = obj;
@ -2128,11 +2128,11 @@ static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread *thread, void *obj)
} }
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
static void js_thread_launch(char *text) static void js_thread_launch(char *text)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
if (!module_pool) { if (!module_pool) {

View File

@ -47,9 +47,9 @@ static switch_loadable_module_interface console_module_interface = {
/*.directory_interface */ NULL /*.directory_interface */ NULL
}; };
static switch_memory_pool *module_pool = NULL; static switch_memory_pool_t *module_pool = NULL;
static switch_hash *log_hash = NULL; static switch_hash_t *log_hash = NULL;
static switch_hash *name_hash = NULL; static switch_hash_t *name_hash = NULL;
static int8_t all_level = -1; static int8_t all_level = -1;
static void del_mapping(char *var) { static void del_mapping(char *var) {

View File

@ -70,7 +70,7 @@ int main(int argc, char *argv[])
char path[256] = ""; char path[256] = "";
char *ppath = NULL; char *ppath = NULL;
char *err = NULL; char *err = NULL;
switch_event *event; switch_event_t *event;
int bg = 0; int bg = 0;
FILE *f; FILE *f;
#ifdef WIN32 #ifdef WIN32

View File

@ -30,6 +30,7 @@
* *
*/ */
#include <switch_buffer.h> #include <switch_buffer.h>
#include <switch.h>
static uint32_t buffer_id = 0; static uint32_t buffer_id = 0;
@ -40,7 +41,7 @@ struct switch_buffer {
uint32_t id; uint32_t id;
}; };
SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool *pool, switch_buffer **buffer, switch_size_t max_len) SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer **buffer, switch_size_t max_len)
{ {
switch_buffer *new_buffer; switch_buffer *new_buffer;

View File

@ -30,8 +30,9 @@
* *
*/ */
#include <switch_caller.h> #include <switch_caller.h>
#include <switch.h>
SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool *pool, SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool_t *pool,
char *dialplan, char *dialplan,
char *caller_id_name, char *caller_id_name,
char *caller_id_number, char *caller_id_number,
@ -90,7 +91,7 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_
} }
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix,
switch_event *event) switch_event_t *event)
{ {
char header_name[1024]; char header_name[1024];

View File

@ -30,6 +30,7 @@
* *
*/ */
#include <switch_channel.h> #include <switch_channel.h>
#include <switch.h>
struct switch_cause_table { struct switch_cause_table {
const char *name; const char *name;
@ -99,7 +100,7 @@ struct switch_channel {
switch_caller_extension *caller_extension; switch_caller_extension *caller_extension;
const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS]; const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS];
int state_handler_index; int state_handler_index;
switch_hash *variables; switch_hash_t *variables;
switch_channel_timetable_t *times; switch_channel_timetable_t *times;
void *private_info; void *private_info;
switch_call_cause_t hangup_cause; switch_call_cause_t hangup_cause;
@ -148,7 +149,7 @@ SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch
return channel->times; return channel->times;
} }
SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool *pool) SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool_t *pool)
{ {
assert(pool != NULL); assert(pool != NULL);
@ -243,7 +244,7 @@ SWITCH_DECLARE(switch_status) switch_channel_queue_dtmf(switch_channel *channel,
SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf(switch_channel *channel, char *dtmf, switch_size_t len) SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf(switch_channel *channel, char *dtmf, switch_size_t len)
{ {
switch_size_t bytes; switch_size_t bytes;
switch_event *event; switch_event_t *event;
assert(channel != NULL); assert(channel != NULL);
@ -516,7 +517,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_cha
channel->hangup_cause = SWITCH_CAUSE_NORMAL_CLEARING; channel->hangup_cause = SWITCH_CAUSE_NORMAL_CLEARING;
} }
if (state < CS_HANGUP) { if (state < CS_HANGUP) {
switch_event *event; switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event); switch_channel_event_set_data(channel, event);
switch_event_fire(&event); switch_event_fire(&event);
@ -541,7 +542,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_cha
return channel->state; return channel->state;
} }
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event *event) SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event_t *event)
{ {
switch_caller_profile *caller_profile, *originator_caller_profile, *originatee_caller_profile; switch_caller_profile *caller_profile, *originator_caller_profile, *originatee_caller_profile;
switch_hash_index_t *hi; switch_hash_index_t *hi;
@ -605,7 +606,7 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel *channel,
} }
if (!channel->caller_profile) { if (!channel->caller_profile) {
switch_event *event; switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_CREATE) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_CREATE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event); switch_channel_event_set_data(channel, event);
@ -766,7 +767,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channe
} }
if (channel->state < CS_HANGUP) { if (channel->state < CS_HANGUP) {
switch_event *event; switch_event_t *event;
switch_channel_state last_state = channel->state; switch_channel_state last_state = channel->state;
channel->state = CS_HANGUP; channel->state = CS_HANGUP;
@ -824,7 +825,7 @@ SWITCH_DECLARE(switch_status) switch_channel_perform_answer(switch_channel *chan
} }
if (switch_core_session_answer_channel(channel->session) == SWITCH_STATUS_SUCCESS) { if (switch_core_session_answer_channel(channel->session) == SWITCH_STATUS_SUCCESS) {
switch_event *event; switch_event_t *event;
channel->times->answered = switch_time_now(); channel->times->answered = switch_time_now();
switch_channel_set_flag(channel, CF_ANSWERED); switch_channel_set_flag(channel, CF_ANSWERED);

View File

@ -30,6 +30,7 @@
* *
*/ */
#include <switch_config.h> #include <switch_config.h>
#include <switch.h>
SWITCH_DECLARE(int) switch_config_open_file(switch_config *cfg, char *file_path) SWITCH_DECLARE(int) switch_config_open_file(switch_config *cfg, char *file_path)
{ {

View File

@ -99,7 +99,7 @@ SWITCH_DECLARE(void) switch_console_printf(switch_text_channel channel, char *fi
} else { } else {
switch_size_t retsize; switch_size_t retsize;
switch_time_exp_t tm; switch_time_exp_t tm;
switch_event *event; switch_event_t *event;
switch_time_exp_lt(&tm, switch_time_now()); switch_time_exp_lt(&tm, switch_time_now());
switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm); switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);

View File

@ -42,9 +42,9 @@ struct switch_core_session {
uint32_t id; uint32_t id;
char name[80]; char name[80];
int thread_running; int thread_running;
switch_memory_pool *pool; switch_memory_pool_t *pool;
switch_channel *channel; switch_channel *channel;
switch_thread *thread; switch_thread_t *thread;
const switch_endpoint_interface *endpoint_interface; const switch_endpoint_interface *endpoint_interface;
struct switch_io_event_hooks event_hooks; struct switch_io_event_hooks event_hooks;
switch_codec *read_codec; switch_codec *read_codec;
@ -63,8 +63,8 @@ struct switch_core_session {
uint8_t enc_read_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE]; uint8_t enc_read_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
switch_audio_resampler *read_resampler; switch_audio_resampler_t *read_resampler;
switch_audio_resampler *write_resampler; switch_audio_resampler_t *write_resampler;
switch_mutex_t *mutex; switch_mutex_t *mutex;
switch_thread_cond_t *cond; switch_thread_cond_t *cond;
@ -85,8 +85,8 @@ struct switch_core_runtime {
time_t initiated; time_t initiated;
uint32_t session_id; uint32_t session_id;
apr_pool_t *memory_pool; apr_pool_t *memory_pool;
switch_hash *session_table; switch_hash_t *session_table;
switch_hash *stack_table; switch_hash_t *stack_table;
switch_core_db *db; switch_core_db *db;
switch_core_db *event_db; switch_core_db *event_db;
const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS]; const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS];
@ -96,7 +96,7 @@ struct switch_core_runtime {
}; };
/* Prototypes */ /* Prototypes */
static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread, void *obj); static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thread, void *obj);
static void switch_core_standard_on_init(switch_core_session *session); static void switch_core_standard_on_init(switch_core_session *session);
static void switch_core_standard_on_hangup(switch_core_session *session); static void switch_core_standard_on_hangup(switch_core_session *session);
static void switch_core_standard_on_ring(switch_core_session *session); static void switch_core_standard_on_ring(switch_core_session *session);
@ -274,7 +274,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_message_send(char *uuid_str, s
return status; return status;
} }
SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event *event) SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event_t *event)
{ {
switch_core_session *session = NULL; switch_core_session *session = NULL;
switch_status status = SWITCH_STATUS_FALSE; switch_status status = SWITCH_STATUS_FALSE;
@ -326,7 +326,7 @@ SWITCH_DECLARE(switch_codec *) switch_core_session_get_write_codec(switch_core_s
SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *codec_name, uint32_t rate, int ms, SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *codec_name, uint32_t rate, int ms,
int channels, uint32_t flags, int channels, uint32_t flags,
const switch_codec_settings *codec_settings, const switch_codec_settings *codec_settings,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
const switch_codec_interface *codec_interface; const switch_codec_interface *codec_interface;
const switch_codec_implementation *iptr, *implementation = NULL; const switch_codec_implementation *iptr, *implementation = NULL;
@ -462,7 +462,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec)
} }
SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char *file_path, unsigned int flags, SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char *file_path, unsigned int flags,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
char *ext; char *ext;
switch_status status; switch_status status;
@ -521,7 +521,7 @@ SWITCH_DECLARE(switch_status) switch_core_directory_open(switch_directory_handle
char *source, char *source,
char *dsn, char *dsn,
char *passwd, char *passwd,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
switch_status status; switch_status status;
@ -567,7 +567,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh,
char *voice_name, char *voice_name,
unsigned int rate, unsigned int rate,
switch_speech_flag *flags, switch_speech_flag *flags,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
switch_status status; switch_status status;
@ -628,7 +628,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_close(switch_speech_handle *sh,
} }
SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples, SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
switch_timer_interface *timer_interface; switch_timer_interface *timer_interface;
switch_status status; switch_status status;
@ -689,7 +689,7 @@ SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer *timer)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static void *switch_core_service_thread(switch_thread *thread, void *obj) static void *switch_core_service_thread(switch_thread_t *thread, void *obj)
{ {
switch_core_thread_session *data = obj; switch_core_thread_session *data = obj;
switch_core_session *session = data->objs[0]; switch_core_session *session = data->objs[0];
@ -742,7 +742,7 @@ SWITCH_DECLARE(void) switch_core_service_session(switch_core_session *session,
switch_core_session_launch_thread(session, switch_core_service_thread, thread_session); switch_core_session_launch_thread(session, switch_core_service_thread, thread_session);
} }
SWITCH_DECLARE(switch_memory_pool *) switch_core_session_get_pool(switch_core_session *session) SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session *session)
{ {
return session->pool; return session->pool;
} }
@ -830,7 +830,7 @@ SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session *session,
} }
SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup) SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, char *todup)
{ {
char *duped = NULL; char *duped = NULL;
switch_size_t len; switch_size_t len;
@ -887,7 +887,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s
char *endpoint_name, char *endpoint_name,
switch_caller_profile *caller_profile, switch_caller_profile *caller_profile,
switch_core_session **new_session, switch_core_session **new_session,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
struct switch_io_event_hook_outgoing_channel *ptr; struct switch_io_event_hook_outgoing_channel *ptr;
switch_status status = SWITCH_STATUS_FALSE; switch_status status = SWITCH_STATUS_FALSE;
@ -984,7 +984,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_se
return status; return status;
} }
SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event *event) SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event_t *event)
{ {
struct switch_io_event_hook_queue_event *ptr; struct switch_io_event_hook_queue_event *ptr;
@ -1711,7 +1711,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switc
} }
SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool **pool) SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool_t **pool)
{ {
assert(runtime.memory_pool != NULL); assert(runtime.memory_pool != NULL);
@ -1723,7 +1723,7 @@ SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool **p
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool **pool) SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool_t **pool)
{ {
apr_pool_destroy(*pool); apr_pool_destroy(*pool);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
@ -1779,7 +1779,7 @@ static void switch_core_standard_on_ring(switch_core_session *session)
static void switch_core_standard_on_execute(switch_core_session *session) static void switch_core_standard_on_execute(switch_core_session *session)
{ {
switch_caller_extension *extension; switch_caller_extension *extension;
switch_event *event; switch_event_t *event;
const switch_application_interface *application_interface; const switch_application_interface *application_interface;
@ -1898,7 +1898,7 @@ static void print_trace (void)
static int handle_fatality(int sig) static int handle_fatality(int sig)
{ {
switch_thread_id thread_id; switch_thread_id_t thread_id;
jmp_buf *env; jmp_buf *env;
if (sig && (thread_id = switch_thread_self()) && (env = (jmp_buf *) apr_hash_get(runtime.stack_table, &thread_id, sizeof(thread_id)))) { if (sig && (thread_id = switch_thread_self()) && (env = (jmp_buf *) apr_hash_get(runtime.stack_table, &thread_id, sizeof(thread_id)))) {
@ -1919,7 +1919,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
const switch_endpoint_interface *endpoint_interface; const switch_endpoint_interface *endpoint_interface;
const switch_state_handler_table *driver_state_handler = NULL; const switch_state_handler_table *driver_state_handler = NULL;
const switch_state_handler_table *application_state_handler = NULL; const switch_state_handler_table *application_state_handler = NULL;
switch_thread_id thread_id = switch_thread_self(); switch_thread_id_t thread_id = switch_thread_self();
jmp_buf env; jmp_buf env;
int sig; int sig;
@ -1930,7 +1930,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
#endif #endif
if ((sig = setjmp(env)) != 0) { if ((sig = setjmp(env)) != 0) {
switch_event *event; switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_SESSION_CRASH) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_SESSION_CRASH) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event); switch_channel_event_set_data(session->channel, event);
@ -2258,8 +2258,8 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session) SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session)
{ {
switch_memory_pool *pool; switch_memory_pool_t *pool;
switch_event *event; switch_event_t *event;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Close Channel %s\n", switch_channel_get_name((*session)->channel)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Close Channel %s\n", switch_channel_get_name((*session)->channel));
@ -2275,7 +2275,7 @@ SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session)
} }
SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash **hash, switch_memory_pool *pool) SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash_t **hash, switch_memory_pool_t *pool)
{ {
assert(pool != NULL); assert(pool != NULL);
@ -2286,31 +2286,31 @@ SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash **hash, switch_m
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash *hash) SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash_t *hash)
{ {
assert(hash != NULL); assert(hash != NULL);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash *hash, char *key, void *data) SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash_t *hash, char *key, void *data)
{ {
apr_hash_set(hash, switch_core_strdup(apr_hash_pool_get(hash), key), APR_HASH_KEY_STRING, data); apr_hash_set(hash, switch_core_strdup(apr_hash_pool_get(hash), key), APR_HASH_KEY_STRING, data);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash *hash, char *key, void *data) SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash_t *hash, char *key, void *data)
{ {
apr_hash_set(hash, key, APR_HASH_KEY_STRING, data); apr_hash_set(hash, key, APR_HASH_KEY_STRING, data);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash *hash, char *key) SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash_t *hash, char *key)
{ {
apr_hash_set(hash, key, APR_HASH_KEY_STRING, NULL); apr_hash_set(hash, key, APR_HASH_KEY_STRING, NULL);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key) SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t *hash, char *key)
{ {
return apr_hash_get(hash, key, APR_HASH_KEY_STRING); return apr_hash_get(hash, key, APR_HASH_KEY_STRING);
} }
@ -2329,9 +2329,9 @@ SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key)
*/ */
SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void *obj, switch_memory_pool *pool) SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void *obj, switch_memory_pool_t *pool)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
switch_core_thread_session *ts; switch_core_thread_session *ts;
int mypool; int mypool;
@ -2359,7 +2359,7 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void
} }
static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread, void *obj) static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thread, void *obj)
{ {
switch_core_session *session = obj; switch_core_session *session = obj;
session->thread = thread; session->thread = thread;
@ -2383,7 +2383,7 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread
SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *session) SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *session)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr;; switch_threadattr_t *thd_attr;;
switch_threadattr_create(&thd_attr, session->pool); switch_threadattr_create(&thd_attr, session->pool);
switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_detach_set(thd_attr, 1);
@ -2399,7 +2399,7 @@ SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *sess
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, switch_thread_start_t func, SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, switch_thread_start_t func,
void *obj) void *obj)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
switch_threadattr_create(&thd_attr, session->pool); switch_threadattr_create(&thd_attr, session->pool);
switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_detach_set(thd_attr, 1);
@ -2410,7 +2410,7 @@ SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *sess
} }
SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool *pool, switch_size_t memory) SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size_t memory)
{ {
void *ptr = NULL; void *ptr = NULL;
assert(pool != NULL); assert(pool != NULL);
@ -2427,9 +2427,9 @@ SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool *pool, switch_size_t
} }
SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface, SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
switch_memory_pool *usepool; switch_memory_pool_t *usepool;
switch_core_session *session; switch_core_session *session;
switch_uuid_t uuid; switch_uuid_t uuid;
@ -2483,7 +2483,7 @@ SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_e
return session; return session;
} }
SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool *pool) SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t *pool)
{ {
const switch_endpoint_interface *endpoint_interface; const switch_endpoint_interface *endpoint_interface;
@ -2522,7 +2522,7 @@ static switch_status switch_core_sql_persistant_execute(switch_core_db *db, char
return status; return status;
} }
static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread *thread, void *obj) static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, void *obj)
{ {
void *pop; void *pop;
uint32_t itterations = 0; uint32_t itterations = 0;
@ -2587,7 +2587,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread *thread, vo
static void switch_core_sql_thread_launch(void) static void switch_core_sql_thread_launch(void)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr;; switch_threadattr_t *thd_attr;;
assert(runtime.memory_pool != NULL); assert(runtime.memory_pool != NULL);
@ -2600,7 +2600,7 @@ static void switch_core_sql_thread_launch(void)
} }
static void core_event_handler(switch_event *event) static void core_event_handler(switch_event_t *event)
{ {
char buf[1024]; char buf[1024];
char *sql = NULL; char *sql = NULL;

View File

@ -30,18 +30,19 @@
* *
*/ */
#include <switch_event.h> #include <switch_event.h>
#include <switch.h>
static switch_event_node *EVENT_NODES[SWITCH_EVENT_ALL + 1] = { NULL }; static switch_event_node *EVENT_NODES[SWITCH_EVENT_ALL + 1] = { NULL };
static switch_mutex_t *BLOCK = NULL; static switch_mutex_t *BLOCK = NULL;
static switch_mutex_t *POOL_LOCK = NULL; static switch_mutex_t *POOL_LOCK = NULL;
static switch_memory_pool *RUNTIME_POOL = NULL; static switch_memory_pool_t *RUNTIME_POOL = NULL;
//static switch_memory_pool *APOOL = NULL; //static switch_memory_pool_t *APOOL = NULL;
//static switch_memory_pool *BPOOL = NULL; //static switch_memory_pool_t *BPOOL = NULL;
static switch_memory_pool *THRUNTIME_POOL = NULL; static switch_memory_pool_t *THRUNTIME_POOL = NULL;
static switch_queue_t *EVENT_QUEUE[3] = {0,0,0}; static switch_queue_t *EVENT_QUEUE[3] = {0,0,0};
static int POOL_COUNT_MAX = 2000; static int POOL_COUNT_MAX = 2000;
static switch_hash *CUSTOM_HASH = NULL; static switch_hash_t *CUSTOM_HASH = NULL;
static int THREAD_RUNNING = 0; static int THREAD_RUNNING = 0;
#if 0 #if 0
@ -75,11 +76,17 @@ static void *locked_dup(char *str)
#define DUP(str) locked_dup(str) #define DUP(str) locked_dup(str)
#endif #endif
#ifndef ALLOC
#define ALLOC(size) malloc(size) #define ALLOC(size) malloc(size)
#endif
#ifndef DUP
#define DUP(str) strdup(str) #define DUP(str) strdup(str)
#endif
#ifndef FREE
#define FREE(ptr) if (ptr) free(ptr) #define FREE(ptr) if (ptr) free(ptr)
#endif
/* make sure this is synced with the switch_event_t enum in switch_types.h /* make sure this is synced with the switch_event_types_t enum in switch_types.h
also never put any new ones before EVENT_ALL also never put any new ones before EVENT_ALL
*/ */
static char *EVENT_NAMES[] = { static char *EVENT_NAMES[] = {
@ -107,7 +114,7 @@ static char *EVENT_NAMES[] = {
}; };
static int switch_events_match(switch_event *event, switch_event_node *node) static int switch_events_match(switch_event_t *event, switch_event_node *node)
{ {
int match = 0; int match = 0;
@ -146,9 +153,9 @@ static int switch_events_match(switch_event *event, switch_event_node *node)
return match; return match;
} }
static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread *thread, void *obj) static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, void *obj)
{ {
switch_event *out_event = NULL; switch_event_t *out_event = NULL;
switch_queue_t *queue = NULL; switch_queue_t *queue = NULL;
switch_queue_t *queues[3] = {0,0,0}; switch_queue_t *queues[3] = {0,0,0};
void *pop; void *pop;
@ -204,9 +211,9 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread *thread, void
return NULL; return NULL;
} }
SWITCH_DECLARE(void) switch_event_deliver(switch_event **event) SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event)
{ {
switch_event_t e; switch_event_types_t e;
switch_event_node *node; switch_event_node *node;
for (e = (*event)->event_id;; e = SWITCH_EVENT_ALL) { for (e = (*event)->event_id;; e = SWITCH_EVENT_ALL) {
@ -231,7 +238,7 @@ SWITCH_DECLARE(switch_status) switch_event_running(void)
return THREAD_RUNNING ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; return THREAD_RUNNING ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
} }
SWITCH_DECLARE(char *) switch_event_name(switch_event_t event) SWITCH_DECLARE(char *) switch_event_name(switch_event_types_t event)
{ {
assert(BLOCK != NULL); assert(BLOCK != NULL);
assert(RUNTIME_POOL != NULL); assert(RUNTIME_POOL != NULL);
@ -282,9 +289,9 @@ SWITCH_DECLARE(switch_status) switch_event_shutdown(void)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool *pool) SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool_t *pool)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr;; switch_threadattr_t *thd_attr;;
switch_threadattr_create(&thd_attr, pool); switch_threadattr_create(&thd_attr, pool);
switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_detach_set(thd_attr, 1);
@ -322,8 +329,8 @@ SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool *pool)
} }
SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event_t **event,
switch_event_t event_id, switch_event_types_t event_id,
char *subclass_name) char *subclass_name)
{ {
@ -331,10 +338,10 @@ SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event,
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
if ((*event = ALLOC(sizeof(switch_event))) == 0) { if ((*event = ALLOC(sizeof(switch_event_t))) == 0) {
return SWITCH_STATUS_MEMERR; return SWITCH_STATUS_MEMERR;
} }
memset(*event, 0, sizeof(switch_event)); memset(*event, 0, sizeof(switch_event_t));
(*event)->event_id = event_id; (*event)->event_id = event_id;
@ -345,16 +352,16 @@ SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event,
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, switch_priority_t priority) SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event_t *event, switch_priority_t priority)
{ {
event->priority = priority; event->priority = priority;
switch_event_add_header(event, SWITCH_STACK_TOP, "priority", switch_priority_name(priority)); switch_event_add_header(event, SWITCH_STACK_TOP, "priority", switch_priority_name(priority));
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header_name) SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *header_name)
{ {
switch_event_header *hp; switch_event_header_t *hp;
if (header_name) { if (header_name) {
for (hp = event->headers; hp; hp = hp->next) { for (hp = event->headers; hp; hp = hp->next) {
if (!strcasecmp(hp->name, header_name)) { if (!strcasecmp(hp->name, header_name)) {
@ -365,7 +372,7 @@ SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header
return NULL; return NULL;
} }
SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switch_stack_t stack, char *header_name, SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name,
char *fmt, ...) char *fmt, ...)
{ {
int ret = 0; int ret = 0;
@ -379,7 +386,7 @@ SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switc
if (ret == -1) { if (ret == -1) {
return SWITCH_STATUS_MEMERR; return SWITCH_STATUS_MEMERR;
} else { } else {
switch_event_header *header, *hp; switch_event_header_t *header, *hp;
if ((header = ALLOC(sizeof(*header))) == 0) { if ((header = ALLOC(sizeof(*header))) == 0) {
return SWITCH_STATUS_MEMERR; return SWITCH_STATUS_MEMERR;
@ -407,7 +414,7 @@ SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switc
} }
SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *fmt, ...) SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event_t *event, char *fmt, ...)
{ {
int ret = 0; int ret = 0;
char data[2048]; char data[2048];
@ -425,10 +432,10 @@ SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *f
} }
} }
SWITCH_DECLARE(void) switch_event_destroy(switch_event **event) SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event)
{ {
switch_event *ep = *event; switch_event_t *ep = *event;
switch_event_header *hp, *this; switch_event_header_t *hp, *this;
for (hp = ep->headers; hp;) { for (hp = ep->headers; hp;) {
this = hp; this = hp;
@ -442,9 +449,9 @@ SWITCH_DECLARE(void) switch_event_destroy(switch_event **event)
*event = NULL; *event = NULL;
} }
SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_event *todup) SWITCH_DECLARE(switch_status) switch_event_dup(switch_event_t **event, switch_event_t *todup)
{ {
switch_event_header *header, *hp, *hp2; switch_event_header_t *header, *hp, *hp2;
if (switch_event_create_subclass(event, todup->event_id, todup->subclass->name) != SWITCH_STATUS_SUCCESS) { if (switch_event_create_subclass(event, todup->event_id, todup->subclass->name) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
@ -476,10 +483,10 @@ SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_even
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event *event, char *buf, switch_size_t buflen, char *fmt, ...) SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event_t *event, char *buf, switch_size_t buflen, char *fmt, ...)
{ {
switch_size_t len = 0; switch_size_t len = 0;
switch_event_header *hp; switch_event_header_t *hp;
char *data = NULL, *body = NULL; char *data = NULL, *body = NULL;
int ret = 0; int ret = 0;
va_list ap; va_list ap;
@ -529,7 +536,7 @@ SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event *event, char *
} }
SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event **event, SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event_t **event,
void *user_data) void *user_data)
{ {
@ -572,7 +579,7 @@ SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func,
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_t event, char *subclass_name, SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name,
switch_event_callback_t callback, void *user_data) switch_event_callback_t callback, void *user_data)
{ {
switch_event_node *event_node; switch_event_node *event_node;

View File

@ -268,7 +268,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session,
switch_timer timer; switch_timer timer;
switch_core_thread_session thread_session; switch_core_thread_session thread_session;
switch_codec codec; switch_codec codec;
switch_memory_pool *pool = switch_core_session_get_pool(session); switch_memory_pool_t *pool = switch_core_session_get_pool(session);
char *codec_name; char *codec_name;
int stream_id; int stream_id;
switch_status status = SWITCH_STATUS_SUCCESS; switch_status status = SWITCH_STATUS_SUCCESS;
@ -502,7 +502,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session
switch_timer timer; switch_timer timer;
switch_core_thread_session thread_session; switch_core_thread_session thread_session;
switch_codec codec; switch_codec codec;
switch_memory_pool *pool = switch_core_session_get_pool(session); switch_memory_pool_t *pool = switch_core_session_get_pool(session);
char *codec_name; char *codec_name;
int x; int x;
int stream_id; int stream_id;
@ -700,7 +700,7 @@ struct audio_bridge_data {
int running; int running;
}; };
static void *audio_bridge_thread(switch_thread *thread, void *obj) static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
{ {
struct switch_core_thread_session *his_thread, *data = obj; struct switch_core_thread_session *his_thread, *data = obj;
int *stream_id_p; int *stream_id_p;
@ -988,7 +988,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
} }
if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) { if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
switch_event *event; switch_event_t *event;
switch_core_session_message msg = {0}; switch_core_session_message msg = {0};
switch_channel_set_state(peer_channel, CS_HOLD); switch_channel_set_state(peer_channel, CS_HOLD);

View File

@ -42,22 +42,22 @@ struct switch_loadable_module {
}; };
struct switch_loadable_module_container { struct switch_loadable_module_container {
switch_hash *module_hash; switch_hash_t *module_hash;
switch_hash *endpoint_hash; switch_hash_t *endpoint_hash;
switch_hash *codec_hash; switch_hash_t *codec_hash;
switch_hash *dialplan_hash; switch_hash_t *dialplan_hash;
switch_hash *timer_hash; switch_hash_t *timer_hash;
switch_hash *application_hash; switch_hash_t *application_hash;
switch_hash *api_hash; switch_hash_t *api_hash;
switch_hash *file_hash; switch_hash_t *file_hash;
switch_hash *speech_hash; switch_hash_t *speech_hash;
switch_hash *directory_hash; switch_hash_t *directory_hash;
switch_memory_pool *pool; switch_memory_pool_t *pool;
}; };
static struct switch_loadable_module_container loadable_modules; static struct switch_loadable_module_container loadable_modules;
static void *switch_loadable_module_exec(switch_thread *thread, void *obj) static void *switch_loadable_module_exec(switch_thread_t *thread, void *obj)
{ {
@ -75,7 +75,7 @@ static void *switch_loadable_module_exec(switch_thread *thread, void *obj)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread ended for %s\n", module->interface->module_name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread ended for %s\n", module->interface->module_name);
if (ts->pool) { if (ts->pool) {
switch_memory_pool *pool = ts->pool; switch_memory_pool_t *pool = ts->pool;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying Pool for %s\n", module->interface->module_name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying Pool for %s\n", module->interface->module_name);
switch_core_destroy_memory_pool(&pool); switch_core_destroy_memory_pool(&pool);
} }
@ -567,7 +567,7 @@ SWITCH_DECLARE(switch_directory_interface *) switch_loadable_module_get_director
return switch_core_hash_find(loadable_modules.directory_hash, name); return switch_core_hash_find(loadable_modules.directory_hash, name);
} }
SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool *pool, switch_codec_interface **array, SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, switch_codec_interface **array,
int arraylen) int arraylen)
{ {
switch_hash_index_t *hi; switch_hash_index_t *hi;
@ -608,7 +608,7 @@ SWITCH_DECLARE(switch_status) switch_api_execute(char *cmd, char *arg, char *ret
{ {
switch_api_interface *api; switch_api_interface *api;
switch_status status; switch_status status;
switch_event *event; switch_event_t *event;
if ((api = switch_loadable_module_get_api_interface(cmd)) != 0) { if ((api = switch_loadable_module_get_api_interface(cmd)) != 0) {
status = api->function(arg, retbuf, len); status = api->function(arg, retbuf, len);

View File

@ -53,7 +53,7 @@ struct switch_log_binding {
typedef struct switch_log_binding switch_log_binding; typedef struct switch_log_binding switch_log_binding;
static switch_memory_pool *LOG_POOL = NULL; static switch_memory_pool_t *LOG_POOL = NULL;
static switch_log_binding *BINDINGS = NULL; static switch_log_binding *BINDINGS = NULL;
static switch_mutex_t *BINDLOCK = NULL; static switch_mutex_t *BINDLOCK = NULL;
static switch_queue_t *LOG_QUEUE = NULL; static switch_queue_t *LOG_QUEUE = NULL;
@ -111,7 +111,7 @@ SWITCH_DECLARE(switch_status) switch_log_bind_logger(switch_log_function functio
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static void *SWITCH_THREAD_FUNC log_thread(switch_thread *thread, void *obj) static void *SWITCH_THREAD_FUNC log_thread(switch_thread_t *thread, void *obj)
{ {
/* To Be or Not To Be */ /* To Be or Not To Be */
@ -212,7 +212,7 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file,
} }
if (channel == SWITCH_CHANNEL_ID_EVENT) { if (channel == SWITCH_CHANNEL_ID_EVENT) {
switch_event *event; switch_event_t *event;
if (switch_event_running() == SWITCH_STATUS_SUCCESS && switch_event_create(&event, SWITCH_EVENT_LOG) == SWITCH_STATUS_SUCCESS) { if (switch_event_running() == SWITCH_STATUS_SUCCESS && switch_event_create(&event, SWITCH_EVENT_LOG) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Data", "%s", data); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Data", "%s", data);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-File", "%s", filep); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-File", "%s", filep);
@ -250,9 +250,9 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file,
} }
SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool *pool) SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool_t *pool)
{ {
switch_thread *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr;; switch_threadattr_t *thd_attr;;
assert(pool != NULL); assert(pool != NULL);

View File

@ -30,6 +30,7 @@
* *
*/ */
#include <switch_resample.h> #include <switch_resample.h>
#include <switch.h>
#include <libresample.h> #include <libresample.h>
#define NORMFACT (float)0x8000 #define NORMFACT (float)0x8000
#define MAXSAMPLE (float)0x7FFF #define MAXSAMPLE (float)0x7FFF
@ -46,12 +47,12 @@
SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler **new_resampler, SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler_t **new_resampler,
int from_rate, int from_rate,
switch_size_t from_size, switch_size_t from_size,
int to_rate, uint32_t to_size, switch_memory_pool *pool) int to_rate, uint32_t to_size, switch_memory_pool_t *pool)
{ {
switch_audio_resampler *resampler; switch_audio_resampler_t *resampler;
double lto_rate, lfrom_rate; double lto_rate, lfrom_rate;
if ((resampler = switch_core_alloc(pool, sizeof(*resampler))) == 0) { if ((resampler = switch_core_alloc(pool, sizeof(*resampler))) == 0) {
@ -77,7 +78,7 @@ SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler **ne
} }
SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler *resampler, float *src, int srclen, float *dst, SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler_t *resampler, float *src, int srclen, float *dst,
uint32_t dstlen, int last) uint32_t dstlen, int last)
{ {
int o = 0, srcused = 0, srcpos = 0, out = 0; int o = 0, srcused = 0, srcpos = 0, out = 0;
@ -100,7 +101,7 @@ SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler *resampl
return out; return out;
} }
SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler *resampler) SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler_t *resampler)
{ {
resample_close(resampler->resampler); resample_close(resampler->resampler);
} }

View File

@ -99,7 +99,7 @@ struct switch_rtp {
uint32_t ts; uint32_t ts;
uint32_t flags; uint32_t flags;
switch_memory_pool *pool; switch_memory_pool_t *pool;
switch_sockaddr_t *from_addr; switch_sockaddr_t *from_addr;
char *ice_user; char *ice_user;
@ -117,7 +117,7 @@ struct switch_rtp {
static int global_init = 0; static int global_init = 0;
static switch_status ice_out(switch_rtp *rtp_session) static switch_status ice_out(switch_rtp_t *rtp_session)
{ {
assert(rtp_session != NULL); assert(rtp_session != NULL);
@ -149,7 +149,7 @@ static switch_status ice_out(switch_rtp *rtp_session)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static void handle_ice(switch_rtp *rtp_session, void *data, switch_size_t len) static void handle_ice(switch_rtp_t *rtp_session, void *data, switch_size_t len)
{ {
switch_stun_packet_t *packet; switch_stun_packet_t *packet;
switch_stun_packet_attribute_t *attr; switch_stun_packet_attribute_t *attr;
@ -199,7 +199,7 @@ static void handle_ice(switch_rtp *rtp_session, void *data, switch_size_t len)
} }
SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool *pool) SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool)
{ {
if (global_init) { if (global_init) {
return; return;
@ -225,7 +225,7 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void)
} }
SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err) SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err)
{ {
*err = "Success"; *err = "Success";
@ -256,7 +256,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp *rtp_sessi
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err) SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err)
{ {
*err = "Success"; *err = "Success";
@ -270,16 +270,16 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_sess
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session, SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp_t **new_rtp_session,
switch_payload_t payload, switch_payload_t payload,
uint32_t packet_size, uint32_t packet_size,
uint32_t ms_per_packet, uint32_t ms_per_packet,
switch_rtp_flag_t flags, switch_rtp_flag_t flags,
char *crypto_key, char *crypto_key,
const char **err, const char **err,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
switch_rtp *rtp_session = NULL; switch_rtp_t *rtp_session = NULL;
srtp_policy_t policy; srtp_policy_t policy;
char key[MAX_KEY_LEN]; char key[MAX_KEY_LEN];
uint32_t ssrc = rand() & 0xffff; uint32_t ssrc = rand() & 0xffff;
@ -390,7 +390,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session,
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host,
switch_port_t rx_port, switch_port_t rx_port,
char *tx_host, char *tx_host,
switch_port_t tx_port, switch_port_t tx_port,
@ -400,9 +400,9 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host,
switch_rtp_flag_t flags, switch_rtp_flag_t flags,
char *crypto_key, char *crypto_key,
const char **err, const char **err,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
switch_rtp *rtp_session; switch_rtp_t *rtp_session;
if (switch_rtp_create(&rtp_session, payload, packet_size, ms_per_packet, flags, crypto_key, err, pool) != SWITCH_STATUS_SUCCESS) { if (switch_rtp_create(&rtp_session, payload, packet_size, ms_per_packet, flags, crypto_key, err, pool) != SWITCH_STATUS_SUCCESS) {
return NULL; return NULL;
@ -420,7 +420,7 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host,
} }
SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, char *login, char *rlogin) SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp_t *rtp_session, char *login, char *rlogin)
{ {
char ice_user[80]; char ice_user[80];
char user_ice[80]; char user_ice[80];
@ -439,14 +439,14 @@ SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, c
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp *rtp_session) SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp_t *rtp_session)
{ {
apr_socket_shutdown(rtp_session->sock, APR_SHUTDOWN_READWRITE); apr_socket_shutdown(rtp_session->sock, APR_SHUTDOWN_READWRITE);
switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO); switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO);
} }
SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp **rtp_session) SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session)
{ {
switch_rtp_kill_socket(*rtp_session); switch_rtp_kill_socket(*rtp_session);
switch_socket_close((*rtp_session)->sock); switch_socket_close((*rtp_session)->sock);
@ -463,58 +463,58 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp **rtp_session)
return; return;
} }
SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp *rtp_session) SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp_t *rtp_session)
{ {
return rtp_session->sock; return rtp_session->sock;
} }
SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp *rtp_session, uint16_t packet_size) SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp_t *rtp_session, uint16_t packet_size)
{ {
rtp_session->packet_size = packet_size; rtp_session->packet_size = packet_size;
} }
SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp *rtp_session) SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp_t *rtp_session)
{ {
return rtp_session->packet_size; return rtp_session->packet_size;
} }
SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp *rtp_session, switch_payload_t payload) SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp_t *rtp_session, switch_payload_t payload)
{ {
rtp_session->payload = payload; rtp_session->payload = payload;
} }
SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp *rtp_session) SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp_t *rtp_session)
{ {
return rtp_session->payload; return rtp_session->payload;
} }
SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, switch_rtp_invalid_handler on_invalid) SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp_t *rtp_session, switch_rtp_invalid_handler on_invalid)
{ {
rtp_session->invalid_handler = on_invalid; rtp_session->invalid_handler = on_invalid;
} }
SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags) SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags)
{ {
switch_set_flag(rtp_session, flags); switch_set_flag(rtp_session, flags);
} }
SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags) SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags)
{ {
return (uint8_t) switch_test_flag(rtp_session, flags); return (uint8_t) switch_test_flag(rtp_session, flags);
} }
SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags) SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags)
{ {
switch_clear_flag(rtp_session, flags); switch_clear_flag(rtp_session, flags);
} }
static int rtp_common_read(switch_rtp *rtp_session, switch_payload_t *payload_type, switch_frame_flag *flags) static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag *flags)
{ {
switch_size_t bytes; switch_size_t bytes;
switch_status status; switch_status status;
@ -606,7 +606,7 @@ static int rtp_common_read(switch_rtp *rtp_session, switch_payload_t *payload_ty
return (int) bytes; return (int) bytes;
} }
SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags) SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags)
{ {
int bytes = rtp_common_read(rtp_session, payload_type, flags); int bytes = rtp_common_read(rtp_session, payload_type, flags);
@ -625,7 +625,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *dat
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_session, switch_frame *frame) SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame *frame)
{ {
int bytes = rtp_common_read(rtp_session, &frame->payload, &frame->flags); int bytes = rtp_common_read(rtp_session, &frame->payload, &frame->flags);
@ -650,7 +650,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_ses
} }
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags) SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp_t *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags)
{ {
int bytes = rtp_common_read(rtp_session, payload_type, flags); int bytes = rtp_common_read(rtp_session, payload_type, flags);
@ -667,7 +667,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session,
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint8_t m, switch_payload_t payload, switch_frame_flag *flags) static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint8_t m, switch_payload_t payload, switch_frame_flag *flags)
{ {
switch_size_t bytes; switch_size_t bytes;
uint8_t packetize = (rtp_session->packet_size > datalen && (payload == rtp_session->payload)) ? 1 : 0; uint8_t packetize = (rtp_session->packet_size > datalen && (payload == rtp_session->payload)) ? 1 : 0;
@ -777,7 +777,7 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale
send_msg->header.m = 1; send_msg->header.m = 1;
rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0; rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0;
if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_TALK)) { if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_TALK)) {
switch_event *event; switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_TALK) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_TALK) == SWITCH_STATUS_SUCCESS) {
switch_channel *channel = switch_core_session_get_channel(rtp_session->vad_data.session); switch_channel *channel = switch_core_session_get_channel(rtp_session->vad_data.session);
switch_channel_event_set_data(channel, event); switch_channel_event_set_data(channel, event);
@ -794,7 +794,7 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale
switch_clear_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_TALKING); switch_clear_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_TALKING);
rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0; rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0;
if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_NOTALK)) { if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_NOTALK)) {
switch_event *event; switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_NOTALK) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_NOTALK) == SWITCH_STATUS_SUCCESS) {
switch_channel *channel = switch_core_session_get_channel(rtp_session->vad_data.session); switch_channel *channel = switch_core_session_get_channel(rtp_session->vad_data.session);
switch_channel_event_set_data(channel, event); switch_channel_event_set_data(channel, event);
@ -842,7 +842,7 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale
} }
SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session) SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp_t *rtp_session)
{ {
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD)) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD)) {
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
@ -852,7 +852,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session)
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags) SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags)
{ {
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD)) { if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD)) {
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
@ -890,7 +890,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp *rtp_session, swi
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags) SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags)
{ {
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) {
@ -907,7 +907,7 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32
} }
SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame *frame, uint32_t ts) SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame *frame, uint32_t ts)
{ {
uint8_t fwd = (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_RAW_WRITE) && switch_test_flag(frame, SFF_RAW_RTP)) ? 1 : 0; uint8_t fwd = (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_RAW_WRITE) && switch_test_flag(frame, SFF_RAW_RTP)) ? 1 : 0;
uint8_t packetize = (rtp_session->packet_size > frame->datalen && (frame->payload == rtp_session->payload)) ? 1 : 0; uint8_t packetize = (rtp_session->packet_size > frame->datalen && (frame->payload == rtp_session->payload)) ? 1 : 0;
@ -935,7 +935,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame
} }
SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp *rtp_session, void *data, uint16_t datalen, uint8_t m, uint8_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags) SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, void *data, uint16_t datalen, uint8_t m, uint8_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags)
{ {
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) {
@ -949,17 +949,17 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp *rtp_session, void *data,
return rtp_common_write(rtp_session, data, datalen, m, payload, flags); return rtp_common_write(rtp_session, data, datalen, m, payload, flags);
} }
SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp *rtp_session) SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp_t *rtp_session)
{ {
return rtp_session->send_msg.header.ssrc; return rtp_session->send_msg.header.ssrc;
} }
SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp *rtp_session, void *private_data) SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp_t *rtp_session, void *private_data)
{ {
rtp_session->private_data = private_data; rtp_session->private_data = private_data;
} }
SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp *rtp_session) SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp_t *rtp_session)
{ {
return rtp_session->private_data; return rtp_session->private_data;
} }

View File

@ -273,7 +273,7 @@ SWITCH_DECLARE(switch_status) switch_stun_lookup (char **ip,
char *stunip, char *stunip,
switch_port_t stunport, switch_port_t stunport,
char **err, char **err,
switch_memory_pool *pool) switch_memory_pool_t *pool)
{ {
switch_sockaddr_t *local_addr = NULL, *remote_addr = NULL, *from_addr = NULL; switch_sockaddr_t *local_addr = NULL, *remote_addr = NULL, *from_addr = NULL;

View File

@ -134,7 +134,7 @@ SWITCH_DECLARE(char *) switch_cut_path(char *in)
} }
SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock, SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock,
switch_int16_t flags, switch_memory_pool *pool) switch_int16_t flags, switch_memory_pool_t *pool)
{ {
switch_pollset_t *pollset; switch_pollset_t *pollset;