part 2 of many standardizing typedefed types to end in _t

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1294 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2006-04-29 06:05:03 +00:00
parent e92ca062aa
commit 73a3adac8f
53 changed files with 959 additions and 956 deletions

View File

@ -60,53 +60,53 @@ struct switch_buffer;
* \param max_len length required by the buffer
* \return status
*/
SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer **buffer, switch_size_t max_len);
SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer_t **buffer, switch_size_t max_len);
/*! \brief Get the length of a switch_buffer
* \param buffer any buffer of type switch_buffer
/*! \brief Get the length of a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \return int size of the buffer.
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer *buffer);
SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer_t *buffer);
/*! \brief Get the freespace of a switch_buffer
* \param buffer any buffer of type switch_buffer
/*! \brief Get the freespace of a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \return int freespace in the buffer.
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer *buffer);
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer_t *buffer);
/*! \brief Get the in use amount of a switch_buffer
* \param buffer any buffer of type switch_buffer
/*! \brief Get the in use amount of a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \return int ammount of buffer curently in use
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer *buffer);
SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer_t *buffer);
/*! \brief Read data from a switch_buffer up to the ammount of datalen if it is available. Remove read data from buffer.
* \param buffer any buffer of type switch_buffer
/*! \brief Read data from a switch_buffer_t up to the ammount of datalen if it is available. Remove read data from buffer.
* \param buffer any buffer of type switch_buffer_t
* \param data pointer to the read data to be returned
* \param datalen amount of data to be returned
* \return int ammount of data actually read
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer *buffer, void *data, switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datalen);
/*! \brief Write data into a switch_buffer up to the length of datalen
* \param buffer any buffer of type switch_buffer
/*! \brief Write data into a switch_buffer_t up to the length of datalen
* \param buffer any buffer of type switch_buffer_t
* \param data pointer to the data to be written
* \param datalen amount of data to be written
* \return int amount of buffer used after the write, or 0 if no space available
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer *buffer, void *data, switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer_t *buffer, void *data, switch_size_t datalen);
/*! \brief Remove data from the buffer
* \param buffer any buffer of type switch_buffer
* \param buffer any buffer of type switch_buffer_t
* \param datalen amount of data to be removed
* \return int size of buffer, or 0 if unable to toss that much data
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_toss(switch_buffer *buffer, switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_toss(switch_buffer_t *buffer, switch_size_t datalen);
/*! \brief Remove all data from the buffer
* \param buffer any buffer of type switch_buffer
* \param buffer any buffer of type switch_buffer_t
*/
SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer *buffer);
SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer_t *buffer);
/** @} */
END_EXTERN_C

View File

@ -105,11 +105,11 @@ struct switch_caller_extension {
/*! The number of the extension */
char *extension_number;
/*! Pointer to the current application for this extension */
struct switch_caller_application *current_application;
switch_caller_application_t *current_application;
/*! Pointer to the last application for this extension */
struct switch_caller_application *last_application;
switch_caller_application_t *last_application;
/*! Pointer to the entire stack of applications for this extension */
struct switch_caller_application *applications;
switch_caller_application_t *applications;
};
/*!
@ -119,7 +119,7 @@ struct switch_caller_extension {
\param extension_number extension number
\return a new extension object allocated from the session's memory pool
*/
SWITCH_DECLARE(switch_caller_extension *) switch_caller_extension_new(switch_core_session *session,
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session,
char *extension_name,
char *extension_number
);
@ -131,8 +131,8 @@ SWITCH_DECLARE(switch_caller_extension *) switch_caller_extension_new(switch_cor
\param application_name the name of the application
\param extra_data optional argument to the application
*/
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session *session,
switch_caller_extension *caller_extension,
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
switch_caller_extension_t *caller_extension,
char *application_name,
char *extra_data);
@ -151,7 +151,7 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session
\param destination_number destination number
\return a new profile object allocated from the session's memory pool
*/
SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool_t *pool,
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memory_pool_t *pool,
char *dialplan,
char *caller_id_name,
char *caller_id_number,
@ -169,8 +169,8 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_
\param tocopy the existing profile
*/
SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_session *session,
switch_caller_profile *tocopy);
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_core_session_t *session,
switch_caller_profile_t *tocopy);
/*!
\brief Add headers to an existing event in regards to a specific profile
@ -179,7 +179,7 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_
\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_t *event);
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_t *caller_profile, char *prefix, switch_event_t *event);
END_EXTERN_C

View File

@ -64,17 +64,17 @@ typedef struct switch_channel_timetable switch_channel_timetable_t;
\param channel channel to retrieve state from
\return current state of channel
*/
SWITCH_DECLARE(switch_channel_state) switch_channel_get_state(switch_channel *channel);
SWITCH_DECLARE(switch_channel_state) switch_channel_get_state(switch_channel_t *channel);
/*!
\brief Determine if a channel is ready for io
\param channel channel to test
\return true if the channel is ready
*/
SWITCH_DECLARE(unsigned int) switch_channel_ready(switch_channel *channel);
SWITCH_DECLARE(unsigned int) switch_channel_ready(switch_channel_t *channel);
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_channel *channel,
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_channel_t *channel,
const char *file,
const char *func,
int line,
@ -100,7 +100,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(char *str);
\param channel the channel
\return the code
*/
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel *channel);
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel_t *channel);
/*!
\brief return a cause string for a given cause
@ -114,7 +114,7 @@ SWITCH_DECLARE(char *) switch_channel_cause2str(switch_call_cause_t cause);
\param channel channel to retrieve timetable from
\return a pointer to the channel's timetable (created, answered, etc..)
*/
SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch_channel *channel);
SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch_channel_t *channel);
/*!
\brief Allocate a new channel
@ -122,7 +122,7 @@ SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch
\param pool memory_pool to use for allocation
\return SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool_t *pool);
SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel_t **channel, switch_memory_pool_t *pool);
/*!
\brief Connect a newly allocated channel to a session object and setup it's initial state
@ -131,8 +131,8 @@ SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, swi
\param state the initial state of the channel
\param flags the initial channel flags
*/
SWITCH_DECLARE(switch_status) switch_channel_init(switch_channel *channel,
switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_channel_init(switch_channel_t *channel,
switch_core_session_t *session,
switch_channel_state state,
uint32_t flags);
@ -141,42 +141,42 @@ SWITCH_DECLARE(switch_status) switch_channel_init(switch_channel *channel,
\param channel channel to assign the profile to
\param caller_profile the profile to assign
*/
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel *channel, switch_caller_profile *caller_profile);
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
/*!
\brief Retrive the given channel's caller profile
\param channel channel to retrive the profile from
\return the requested profile
*/
SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_caller_profile(switch_channel *channel);
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_caller_profile(switch_channel_t *channel);
/*!
\brief Set the given channel's originator caller profile
\param channel channel to assign the profile to
\param caller_profile the profile to assign
*/
SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel *channel, switch_caller_profile *caller_profile);
SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
/*!
\brief Retrive the given channel's originator caller profile
\param channel channel to retrive the profile from
\return the requested profile
*/
SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_originator_caller_profile(switch_channel *channel);
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_profile(switch_channel_t *channel);
/*!
\brief Set the given channel's originatee caller profile
\param channel channel to assign the profile to
\param caller_profile the profile to assign
*/
SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel *channel, switch_caller_profile *caller_profile);
SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
/*!
\brief Retrive the given channel's originatee caller profile
\param channel channel to retrive the profile from
\return the requested profile
*/
SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_originatee_caller_profile(switch_channel *channel);
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originatee_caller_profile(switch_channel_t *channel);
/*!
@ -184,7 +184,7 @@ SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_originatee_caller_pro
\param channel channel to retrive the unique id from
\return the unique id
*/
SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel *channel);
SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel_t *channel);
/*!
\brief Set a variable on a given channel
@ -193,7 +193,7 @@ SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel *channel);
\param value the vaule of the variable
\returns SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE(switch_status) switch_channel_set_variable(switch_channel *channel, char *varname, char *value);
SWITCH_DECLARE(switch_status) switch_channel_set_variable(switch_channel_t *channel, char *varname, char *value);
/*!
\brief Retrieve a variable from a given channel
@ -201,21 +201,21 @@ SWITCH_DECLARE(switch_status) switch_channel_set_variable(switch_channel *channe
\param varname the name of the variable
\return the value of the requested variable
*/
SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel *channel, char *varname);
SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, char *varname);
/*!
\brief Assign a caller extension to a given channel
\param channel channel to assign extension to
\param caller_extension extension to assign
*/
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel *channel, switch_caller_extension *caller_extension);
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension);
/*!
\brief Retrieve caller extension from a given channel
\param channel channel to retrieve extension from
\return the requested extension
*/
SWITCH_DECLARE(switch_caller_extension *) switch_channel_get_caller_extension(switch_channel *channel);
SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_caller_extension(switch_channel_t *channel);
/*!
\brief Test for presence of given flag(s) on a given channel
@ -223,23 +223,23 @@ SWITCH_DECLARE(switch_caller_extension *) switch_channel_get_caller_extension(sw
\param flags or'd list of channel flags to test
\return TRUE if flags were present
*/
SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel *channel, switch_channel_flag flags);
SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag flags);
/*!
\brief Set given flag(s) on a given channel
\param channel channel on which to set flag(s)
\param flags or'd list of flags to set
*/
SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel *channel, switch_channel_flag flags);
SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag flags);
/*!
\brief Clear given flag(s) from a channel
\param channel channel to clear flags from
\param flags or'd list of flags to clear
*/
SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel *channel, switch_channel_flag flags);
SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag flags);
SWITCH_DECLARE(switch_status) switch_channel_perform_answer(switch_channel *channel,
SWITCH_DECLARE(switch_status) switch_channel_perform_answer(switch_channel_t *channel,
const char *file,
const char *func,
int line);
@ -252,7 +252,7 @@ SWITCH_DECLARE(switch_status) switch_channel_perform_answer(switch_channel *chan
SWITCH_DECLARE(switch_status) switch_channel_perform_pre_answer(switch_channel *channel,
SWITCH_DECLARE(switch_status) switch_channel_perform_pre_answer(switch_channel_t *channel,
const char *file,
const char *func,
int line);
@ -269,14 +269,14 @@ SWITCH_DECLARE(switch_status) switch_channel_perform_pre_answer(switch_channel *
\param state_handler table of state handler functions
\return the index number/priority of the table negative value indicates failure
*/
SWITCH_DECLARE(int) switch_channel_add_state_handler(switch_channel *channel, const switch_state_handler_table *state_handler);
SWITCH_DECLARE(int) switch_channel_add_state_handler(switch_channel_t *channel, const switch_state_handler_table_t *state_handler);
/*!
\brief clear a state handler table from a given channel
\param channel channel from which to clear the state handler table
\param state_handler table of state handler functions
*/
SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel *channel, const switch_state_handler_table *state_handler);
SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel_t *channel, const switch_state_handler_table_t *state_handler);
/*!
\brief Retrieve an state handler tablefrom a given channel at given index level
@ -284,7 +284,7 @@ SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel *channel,
\param index the index of the state handler table (start from 0)
\return given channel's state handler table at given index or NULL if requested index does not exist.
*/
SWITCH_DECLARE(const switch_state_handler_table *) switch_channel_get_state_handler(switch_channel *channel, int index);
SWITCH_DECLARE(const switch_state_handler_table_t *) switch_channel_get_state_handler(switch_channel_t *channel, int index);
/*!
\brief Set private data on channel
@ -292,14 +292,14 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_channel_get_state_hand
\param private_info void pointer to private data
\return SWITCH_STATUS_SUCCESS if data was set
*/
SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private_info);
SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel_t *channel, void *private_info);
/*!
\brief Retrieve private from a given channel
\param channel channel to retrieve data from
\return void pointer to channel's private data
*/
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel *channel);
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel);
/*!
\brief Assign a name to a given channel
@ -307,17 +307,17 @@ SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel *channel);
\param name name to assign
\return SWITCH_STATUS_SUCCESS if name was assigned
*/
SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel *channel, char *name);
SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel_t *channel, char *name);
/*!
\brief Retrieve the name of a given channel
\param channel channel to get name of
\return the channel's name
*/
SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel *channel);
SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel);
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channel *channel,
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channel_t *channel,
const char *file,
const char *func,
int line,
@ -336,7 +336,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channe
\param channel channel to test
\return number of digits in the queue
*/
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel *channel);
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel);
/*!
\brief Queue DTMF on a given channel
@ -344,7 +344,7 @@ SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel *channel);
\param dtmf string of digits to queue
\return SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE(switch_status) switch_channel_queue_dtmf(switch_channel *channel, char *dtmf);
SWITCH_DECLARE(switch_status) switch_channel_queue_dtmf(switch_channel_t *channel, char *dtmf);
/*!
\brief Retrieve DTMF digits from a given channel
@ -353,7 +353,7 @@ SWITCH_DECLARE(switch_status) switch_channel_queue_dtmf(switch_channel *channel,
\param len max size in bytes of the buffer
\return number of bytes read into the buffer
*/
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_t *channel, char *dtmf, switch_size_t len);
/*!
\brief Render the name of the provided state enum
@ -367,12 +367,12 @@ SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state stat
\param channel channel to add information about
\param event event to add information to
*/
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event_t *event);
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, switch_event_t *event);
// These may go away
SWITCH_DECLARE(switch_status) switch_channel_set_raw_mode (switch_channel *channel, int freq, int bits, int channels, int ms, int kbps);
SWITCH_DECLARE(switch_status) switch_channel_get_raw_mode (switch_channel *channel, int *freq, int *bits, int *channels, int *ms, int *kbps);
SWITCH_DECLARE(switch_status) switch_channel_set_raw_mode (switch_channel_t *channel, int freq, int bits, int channels, int ms, int kbps);
SWITCH_DECLARE(switch_status) switch_channel_get_raw_mode (switch_channel_t *channel, int *freq, int *bits, int *channels, int *ms, int *kbps);
/** @} */
END_EXTERN_C

View File

@ -84,25 +84,25 @@ struct switch_config {
/*!
\brief Open a configuration file
\param cfg (switch_config *) config handle to use
\param cfg (switch_config_t *) config handle to use
\param file_path path to the file
\return 1 (true) on success 0 (false) on failure
*/
SWITCH_DECLARE(int) switch_config_open_file(switch_config *cfg, char *file_path);
SWITCH_DECLARE(int) switch_config_open_file(switch_config_t *cfg, char *file_path);
/*!
\brief Close a previously opened configuration file
\param cfg (switch_config *) config handle to use
\param cfg (switch_config_t *) config handle to use
*/
SWITCH_DECLARE(void) switch_config_close_file(switch_config *cfg);
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t *cfg);
/*!
\brief Retrieve next name/value pair from configuration file
\param cfg (switch_config *) config handle to use
\param cfg (switch_config_t *) config handle to use
\param var pointer to aim at the new variable name
\param val pointer to aim at the new value
*/
SWITCH_DECLARE(int) switch_config_next_pair(switch_config *cfg, char **var, char **val);
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t *cfg, char **var, char **val);
END_EXTERN_C

View File

@ -50,7 +50,7 @@ struct switch_core_session_message {
/*! uuid of the sender (for replies)*/
char *from;
/*! enumeration of the type of message */
switch_core_session_message_t message_id;
switch_core_session_message_types_t message_id;
/*! optional numeric arg*/
int numeric_arg;
@ -121,19 +121,19 @@ SWITCH_DECLARE(switch_status) switch_core_destroy(void);
\param session the session to acquire from
\return success if it is safe to read from the session
*/
SWITCH_DECLARE(switch_status) switch_core_session_read_lock(switch_core_session *session);
SWITCH_DECLARE(switch_status) switch_core_session_read_lock(switch_core_session_t *session);
/*!
\brief Acquire a write lock on the session
\param session the session to acquire from
*/
SWITCH_DECLARE(void) switch_core_session_write_lock(switch_core_session *session);
SWITCH_DECLARE(void) switch_core_session_write_lock(switch_core_session_t *session);
/*!
\brief Unlock a read or write lock on as given session
\param session the session
*/
SWITCH_DECLARE(void) switch_core_session_rwunlock(switch_core_session *session);
SWITCH_DECLARE(void) switch_core_session_rwunlock(switch_core_session_t *session);
///\}
///\defgroup sh State Handlers
@ -144,14 +144,14 @@ SWITCH_DECLARE(void) switch_core_session_rwunlock(switch_core_session *session);
\param state_handler a state handler to add
\return the current index/priority of this handler
*/
SWITCH_DECLARE(int) switch_core_add_state_handler(const switch_state_handler_table *state_handler);
SWITCH_DECLARE(int) switch_core_add_state_handler(const switch_state_handler_table_t *state_handler);
/*!
\brief Access a state handler
\param index the desired index to access
\return the desired state handler table or NULL when it does not exist.
*/
SWITCH_DECLARE(const switch_state_handler_table *) switch_core_get_state_handler(int index);
SWITCH_DECLARE(const switch_state_handler_table_t *) switch_core_get_state_handler(int index);
///\}
@ -174,13 +174,13 @@ SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool
\brief Start the session's state machine
\param session the session on which to start the state machine
*/
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session);
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session);
/*!
\brief determine if the session's state machine is running
\param session the session on which to check
*/
SWITCH_DECLARE(unsigned int) switch_core_session_runing(switch_core_session *session);
SWITCH_DECLARE(unsigned int) switch_core_session_runing(switch_core_session_t *session);
/*!
\brief Allocate memory from the main pool with no intention of returning it
@ -205,7 +205,7 @@ SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size
\return a void pointer to the newly allocated memory
\note the memory will be in scope as long as the session exists
*/
SWITCH_DECLARE(void *) switch_core_session_alloc(switch_core_session *session, switch_size_t memory);
SWITCH_DECLARE(void *) switch_core_session_alloc(switch_core_session_t *session, switch_size_t memory);
/*!
\brief Copy a string using permenant memory allocation
@ -220,7 +220,7 @@ SWITCH_DECLARE(char *) switch_core_permenant_strdup(char *todup);
\param todup the string to duplicate
\return a pointer to the newly duplicated string
*/
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session *session, char *todup);
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session_t *session, char *todup);
/*!
\brief Copy a string using memory allocation from a given pool
@ -236,7 +236,7 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, char *todu
\return the session's pool
\note to be used sparingly
*/
SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session *session);
SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session_t *session);
///\}
///\defgroup sessm Session Creation / Management
@ -248,14 +248,14 @@ SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_
\param pool the pool to use for the allocation (a new one will be used if NULL)
\return the newly created session
*/
SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface, switch_memory_pool_t *pool);
SWITCH_DECLARE(switch_core_session_t *) 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
\param session pointer to a pointer of the session to destroy
\return
*/
SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session);
SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session_t **session);
/*!
\brief Allocate and return a new session from the core based on a given endpoint module name
@ -263,32 +263,32 @@ SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session);
\param pool the pool to use
\return the newly created session
*/
SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t *pool);
SWITCH_DECLARE(switch_core_session_t *) 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
\param session the session to activate the state machine on
*/
SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *session);
SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session_t *session);
/*!
\brief Retrieve a pointer to the channel object associated with a given session
\param session the session to retrieve from
\return a pointer to the channel object
*/
SWITCH_DECLARE(switch_channel *) switch_core_session_get_channel(switch_core_session *session);
SWITCH_DECLARE(switch_channel_t *) switch_core_session_get_channel(switch_core_session_t *session);
/*!
\brief Signal a session's state machine thread that a state change has occured
*/
SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session *session);
SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session);
/*!
\brief Retrieve the unique identifier from a session
\param session the session to retrieve the uuid from
\return a string representing the uuid
*/
SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session *session);
SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session_t *session);
/*!
\brief Locate a session based on it's uuiid
@ -296,15 +296,15 @@ SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session *session
\return the session or NULL
\note if the session was located it will have a read lock obtained which will need to be released with switch_core_session_rwunlock()
*/
SWITCH_DECLARE(switch_core_session *) switch_core_session_locate(char *uuid_str);
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(char *uuid_str);
/*!
\brief Send a message to another session using it's uuid
\param uuid_str the unique id of the session you want to send a message to
\param message the switch_core_session_message object to send
\param message the switch_core_session_message_t object to send
\return the status returned by the message handler
*/
SWITCH_DECLARE (switch_status) switch_core_session_message_send(char *uuid_str, switch_core_session_message *message);
SWITCH_DECLARE (switch_status) switch_core_session_message_send(char *uuid_str, switch_core_session_message_t *message);
/*!
\brief Queue an event on another session using its uuid
@ -319,7 +319,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, swi
\param session the session to retrieve from
\return a pointer to the private data
*/
SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *session);
SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session_t *session);
/*!
\brief Add private user data to a session
@ -327,7 +327,7 @@ SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *sess
\param private_info the used data to add
\return SWITCH_STATUS_SUCCESS if data is added
*/
SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private_info);
SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session_t *session, void *private_info);
/*!
\brief Add a logical stream to a session
@ -335,7 +335,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_sessio
\param private_info an optional pointer to private data for the new stream
\return the stream id of the new stream
*/
SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private_info);
SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session_t *session, void *private_info);
/*!
\brief Retreive a logical stream from a session
@ -343,14 +343,14 @@ SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session,
\param index the index to retrieve
\return the stream
*/
SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session *session, int index);
SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session_t *session, int index);
/*!
\brief Determine the number of logical streams a session has
\param session the session to query
\return the total number of logical streams
*/
SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session *session);
SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session_t *session);
/*!
\brief Launch a thread designed to exist within the scope of a given session
@ -358,13 +358,13 @@ SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session *se
\param func a function to execute in the thread
\param obj an arguement
*/
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, void *(*func)(switch_thread_t *, void *), void *obj);
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *session, void *(*func)(switch_thread_t *, void *), void *obj);
/*!
\brief Signal a thread using a thread session to terminate
\param thread_session the thread_session to indicate to
*/
SWITCH_DECLARE(void) switch_core_thread_session_end(switch_core_thread_session *thread_session);
SWITCH_DECLARE(void) switch_core_thread_session_end(switch_core_thread_session_t *thread_session);
/*!
\brief Launch a service thread on a session to drop inbound data
@ -372,7 +372,7 @@ SWITCH_DECLARE(void) switch_core_thread_session_end(switch_core_thread_session *
\param stream_id which logical media channel to use
\param thread_session the thread_session to use
*/
SWITCH_DECLARE(void) switch_core_service_session(switch_core_session *session, switch_core_thread_session *thread_session, int stream_id);
SWITCH_DECLARE(void) switch_core_service_session(switch_core_session_t *session, switch_core_thread_session_t *thread_session, int stream_id);
/*!
\brief Request an outgoing session spawned from an existing session using a desired endpoing module
@ -383,10 +383,10 @@ SWITCH_DECLARE(void) switch_core_service_session(switch_core_session *session, s
\param pool optional existing memory pool to donate to the session
\return SWITCH_STATUS_SUCCESS if the session was created
*/
SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_session_t *session,
char *endpoint_name,
switch_caller_profile *caller_profile,
switch_core_session **new_session,
switch_caller_profile_t *caller_profile,
switch_core_session_t **new_session,
switch_memory_pool_t *pool);
/*!
@ -394,7 +394,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s
\param session the session to answer the channel of
\return SWITCH_STATUS_SUCCESS if the channel was answered
*/
SWITCH_DECLARE(switch_status) switch_core_session_answer_channel(switch_core_session *session);
SWITCH_DECLARE(switch_status) switch_core_session_answer_channel(switch_core_session_t *session);
/*!
\brief Receive a message on a given session
@ -402,7 +402,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_answer_channel(switch_core_ses
\param message the message to recieve
\return the status returned by the message handler
*/
SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_session *session, switch_core_session_message *message);
SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_session_t *session, switch_core_session_message_t *message);
/*!
\brief Queue an event on 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
\return the status returned by the message handler
*/
SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event_t *event);
SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session_t *session, switch_event_t *event);
/*!
\brief Read a frame from a session
@ -420,7 +420,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_sessio
\param stream_id which logical media channel to use
\return SWITCH_STATUS_SUCCESS a the frame was read
*/
SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session *session, switch_frame **frame, int timeout, int stream_id);
SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, int stream_id);
/*!
\brief Write a frame to a session
@ -430,7 +430,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session
\param stream_id which logical media channel to use
\return SWITCH_STATUS_SUCCESS a the frame was written
*/
SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_session *session, switch_frame *frame, int timeout, int stream_id);
SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, int stream_id);
/*!
\brief Send a signal to a channel
@ -438,7 +438,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_sessio
\param sig signal to send
\return status returned by the session's signal handler
*/
SWITCH_DECLARE(switch_status) switch_core_session_perform_kill_channel(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_perform_kill_channel(switch_core_session_t *session,
const char *file,
const char *func,
int line,
@ -458,7 +458,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_perform_kill_channel(switch_co
\param stream_id which logical media channel to use
\return SWITCH_STATUS_SUCCESS if data is available for read within timeframe specified
*/
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_read(switch_core_session *session, int timeout, int stream_id);
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_read(switch_core_session_t *session, int timeout, int stream_id);
/*!
\brief Wait for a session to be ready for output
@ -467,7 +467,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_waitfor_read(switch_core_sessi
\param stream_id which logical media channel to use
\return SWITCH_STATUS_SUCCESS if the session is available for write within timeframe specified
*/
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_write(switch_core_session *session, int timeout, int stream_id);
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_write(switch_core_session_t *session, int timeout, int stream_id);
/*!
\brief Send DTMF to a session
@ -475,7 +475,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_waitfor_write(switch_core_sess
\param dtmf string to send to the session
\return SWITCH_STATUS_SUCCESS if the dtmf was written
*/
SWITCH_DECLARE(switch_status) switch_core_session_send_dtmf(switch_core_session *session, char *dtmf);
SWITCH_DECLARE(switch_status) switch_core_session_send_dtmf(switch_core_session_t *session, char *dtmf);
/*!
\brief Add an event hook to be executed when a session requests an outgoing extension
@ -483,7 +483,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_send_dtmf(switch_core_session
\param outgoing_channel hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_outgoing(switch_core_session *session, switch_outgoing_channel_hook outgoing_channel);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_outgoing(switch_core_session_t *session, switch_outgoing_channel_hook outgoing_channel);
///\}
///\defgroup shooks Session Hook Callbacks
@ -495,7 +495,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_outgoing(switch
\param answer_channel hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_answer_channel(switch_core_session *session, switch_answer_channel_hook answer_channel);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_answer_channel(switch_core_session_t *session, switch_answer_channel_hook answer_channel);
/*!
\brief Add an event hook to be executed when a session sends a message
@ -503,7 +503,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_answer_channel(
\param receive_message hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_receive_message(switch_core_session *session, switch_receive_message_hook receive_message);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_receive_message(switch_core_session_t *session, switch_receive_message_hook receive_message);
/*!
\brief Add an event hook to be executed when a session reads a frame
@ -511,7 +511,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_receive_message
\param read_frame hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_read_frame(switch_core_session *session, switch_read_frame_hook read_frame);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_read_frame(switch_core_session_t *session, switch_read_frame_hook read_frame);
/*!
\brief Add an event hook to be executed when a session writes a frame
@ -519,7 +519,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_read_frame(swit
\param write_frame hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_write_frame(switch_core_session *session, switch_write_frame_hook write_frame);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_write_frame(switch_core_session_t *session, switch_write_frame_hook write_frame);
/*!
\brief Add an event hook to be executed when a session kills a channel
@ -527,7 +527,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_write_frame(swi
\param kill_channel hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_kill_channel(switch_core_session *session, switch_kill_channel_hook kill_channel);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_kill_channel(switch_core_session_t *session, switch_kill_channel_hook kill_channel);
/*!
\brief Add an event hook to be executed when a session waits for a read event
@ -535,7 +535,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_kill_channel(sw
\param waitfor_read hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_read(switch_core_session *session, switch_waitfor_read_hook waitfor_read);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_read(switch_core_session_t *session, switch_waitfor_read_hook waitfor_read);
/*!
\brief Add an event hook to be executed when a session waits for a write event
@ -543,7 +543,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_read(sw
\param waitfor_write hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_write(switch_core_session *session, switch_waitfor_write_hook waitfor_write);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_write(switch_core_session_t *session, switch_waitfor_write_hook waitfor_write);
/*!
\brief Add an event hook to be executed when a session sends dtmf
@ -551,7 +551,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_write(s
\param send_dtmf hook to bind
\return SWITCH_STATUS_SUCCESS on suceess
*/
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switch_core_session *session, switch_send_dtmf_hook send_dtmf);
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switch_core_session_t *session, switch_send_dtmf_hook send_dtmf);
///\}
///\defgroup hashf Hash Functions
@ -620,21 +620,21 @@ SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t *hash, char *key);
\param pool the memory pool to use for allocation
\return
*/
SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
/*!
\brief Wait for one cycle on an existing timer
\param timer the timer to wait on
\return the newest sample count
*/
SWITCH_DECLARE(int) switch_core_timer_next(switch_timer *timer);
SWITCH_DECLARE(int) switch_core_timer_next(switch_timer_t *timer);
/*!
\brief Destroy an allocated timer
\param timer timer to destroy
\return SWITCH_STATUS_SUCCESS after destruction
*/
SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer *timer);
SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer_t *timer);
///\}
///\defgroup codecs Codec Functions
@ -652,13 +652,13 @@ SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer *timer);
\param pool the memory pool to use
\return SWITCH_STATUS_SUCCESS if the handle is allocated
*/
SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec,
SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec_t *codec,
char *codec_name,
uint32_t rate,
int ms,
int channels,
uint32_t flags,
const switch_codec_settings *codec_settings,
const switch_codec_settings_t *codec_settings,
switch_memory_pool_t *pool);
/*!
@ -675,8 +675,8 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec,
\return SWITCH_STATUS_SUCCESS if the data was encoded
\note encoded_data_len will be rewritten to the in-use size of encoded_data
*/
SWITCH_DECLARE(switch_status) switch_core_codec_encode(switch_codec *codec,
switch_codec *other_codec,
SWITCH_DECLARE(switch_status) switch_core_codec_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -699,8 +699,8 @@ SWITCH_DECLARE(switch_status) switch_core_codec_encode(switch_codec *codec,
\return SWITCH_STATUS_SUCCESS if the data was decoded
\note decoded_data_len will be rewritten to the in-use size of decoded_data
*/
SWITCH_DECLARE(switch_status) switch_core_codec_decode(switch_codec *codec,
switch_codec *other_codec,
SWITCH_DECLARE(switch_status) switch_core_codec_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -714,7 +714,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_decode(switch_codec *codec,
\param codec the codec handle to destroy
\return SWITCH_STATUS_SUCCESS if the codec was destroyed
*/
SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec);
SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec_t *codec);
/*!
\brief Assign the read codec to a given session
@ -722,14 +722,14 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec);
\param codec the codec to add
\return SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE(switch_status) switch_core_session_set_read_codec(switch_core_session *session, switch_codec *codec);
SWITCH_DECLARE(switch_status) switch_core_session_set_read_codec(switch_core_session_t *session, switch_codec_t *codec);
/*!
\brief Retrieve the read codec from a given session
\param session session to retrieve from
\return a pointer to the codec
*/
SWITCH_DECLARE(switch_codec *) switch_core_session_get_read_codec(switch_core_session *session);
SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_read_codec(switch_core_session_t *session);
/*!
\brief Assign the write codec to a given session
@ -737,14 +737,14 @@ SWITCH_DECLARE(switch_codec *) switch_core_session_get_read_codec(switch_core_se
\param codec the codec to add
\return SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE(switch_status) switch_core_session_set_write_codec(switch_core_session *session, switch_codec *codec);
SWITCH_DECLARE(switch_status) switch_core_session_set_write_codec(switch_core_session_t *session, switch_codec_t *codec);
/*!
\brief Retrieve the write codec from a given session
\param session session to retrieve from
\return a pointer to the codec
*/
SWITCH_DECLARE(switch_codec *) switch_core_session_get_write_codec(switch_core_session *session);
SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_write_codec(switch_core_session_t *session);
///\}
///\defgroup db Database Functions
@ -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
\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_t *pool);
SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle_t *fh, char *file_path, unsigned int flags, switch_memory_pool_t *pool);
/*!
\brief Read media from a file handle
@ -786,7 +786,7 @@ SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char
\param len the max size of the buffer
\return SWITCH_STATUS_SUCCESS with len adjusted to the bytes read if successful
*/
SWITCH_DECLARE(switch_status) switch_core_file_read(switch_file_handle *fh, void *data, switch_size_t *len);
SWITCH_DECLARE(switch_status) switch_core_file_read(switch_file_handle_t *fh, void *data, switch_size_t *len);
/*!
\brief Write media to a file handle
@ -795,7 +795,7 @@ SWITCH_DECLARE(switch_status) switch_core_file_read(switch_file_handle *fh, void
\param len the amount of data to write from the buffer
\return SWITCH_STATUS_SUCCESS with len adjusted to the bytes written if successful
*/
SWITCH_DECLARE(switch_status) switch_core_file_write(switch_file_handle *fh, void *data, switch_size_t *len);
SWITCH_DECLARE(switch_status) switch_core_file_write(switch_file_handle_t *fh, void *data, switch_size_t *len);
/*!
\brief Seek a position in a file
@ -805,14 +805,14 @@ SWITCH_DECLARE(switch_status) switch_core_file_write(switch_file_handle *fh, voi
\param whence the indicator (see traditional seek)
\return SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position
*/
SWITCH_DECLARE(switch_status) switch_core_file_seek(switch_file_handle *fh, unsigned int *cur_pos, int64_t samples, int whence);
SWITCH_DECLARE(switch_status) switch_core_file_seek(switch_file_handle_t *fh, unsigned int *cur_pos, int64_t samples, int whence);
/*!
\brief Close an open file handle
\param fh the file handle to close
\return SWITCH_STATUS_SUCCESS if the file handle was closed
*/
SWITCH_DECLARE(switch_status) switch_core_file_close(switch_file_handle *fh);
SWITCH_DECLARE(switch_status) switch_core_file_close(switch_file_handle_t *fh);
///\}
///\defgroup speech ASR/TTS Functions

View File

@ -88,7 +88,7 @@ struct switch_event {
/*! the owner of the event */
char *owner;
/*! the subclass of the event */
switch_event_subclass *subclass;
switch_event_subclass_t *subclass;
/*! the event headers */
switch_event_header_t *headers;
/*! the body of the event */
@ -107,7 +107,7 @@ struct switch_event_node {
/*! the event id enumeration to bind to */
switch_event_types_t event_id;
/*! the event subclass to bind to for custom events */
switch_event_subclass *subclass;
switch_event_subclass_t *subclass;
/*! a callback function to execute when the event is triggered */
switch_event_callback_t callback;
/*! private data */

View File

@ -43,7 +43,7 @@ BEGIN_EXTERN_C
/*! \brief An abstraction of a data frame */
struct switch_frame {
/*! a pointer to the codec information */
switch_codec *codec;
switch_codec_t *codec;
/*! the originating source of the frame */
const char *source;
/*! the raw packet */

View File

@ -58,7 +58,7 @@ BEGIN_EXTERN_C
\param buflen the size of buf
\return SWITCH_STATUS_SUCCESS to keep the collection moving.
*/
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_callback(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_callback(switch_core_session_t *session,
switch_dtmf_callback_function dtmf_callback,
void *buf,
unsigned int buflen);
@ -75,7 +75,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_callback(switch_core_ses
\param poll_channel flag to specify if you want the function to poll the channel while running
\return SWITCH_STATUS_SUCCESS to keep the collection moving.
*/
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_session_t *session,
char *buf,
unsigned int buflen,
unsigned int maxdigits,
@ -96,8 +96,8 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_sessio
\return SWITCH_STATUS_SUCCESS if all is well
\note passing a NULL dtmf_callback nad a not NULL buf indicates to copy any dtmf to buf and stop playback.
*/
SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session,
switch_file_handle *fh,
SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session_t *session,
switch_file_handle_t *fh,
char *file,
char *timer_name,
switch_dtmf_callback_function dtmf_callback,
@ -117,8 +117,8 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session,
\return SWITCH_STATUS_SUCCESS if all is well
\note passing a NULL dtmf_callback nad a not NULL buf indicates to copy any dtmf to buf and stop recording.
*/
SWITCH_DECLARE(switch_status) switch_ivr_record_file(switch_core_session *session,
switch_file_handle *fh,
SWITCH_DECLARE(switch_status) switch_ivr_record_file(switch_core_session_t *session,
switch_file_handle_t *fh,
char *file,
switch_dtmf_callback_function dtmf_callback,
void *buf,
@ -138,7 +138,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_record_file(switch_core_session *sessio
\param buflen the len of buf
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session_t *session,
char *tts_name,
char *voice_name,
char *timer_name,
@ -158,8 +158,8 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session
\param peer_session_data data to pass to the DTMF callback for peer_session
\return SWITCH_STATUS_SUCCESS if all is well
*/
SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_session *session,
switch_core_session *peer_session,
SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_session_t *session,
switch_core_session_t *peer_session,
unsigned int timelimit,
switch_dtmf_callback_function dtmf_callback,
void *session_data,
@ -173,7 +173,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
\param dialplan the new dialplan (OPTIONAL, may be NULL)
\param context the new context (OPTIONAL, may be NULL)
*/
SWITCH_DECLARE(switch_status) switch_ivr_session_transfer(switch_core_session *session, char *extension, char *dialplan, char *context);
SWITCH_DECLARE(switch_status) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context);
/** @} */

View File

@ -126,7 +126,7 @@ SWITCH_DECLARE(switch_status) switch_loadable_module_build_dynamic(char *filenam
\param name the name of the dialplan
\return the desired dialplan interface
*/
SWITCH_DECLARE(switch_status) switch_loadable_module_load_dynamic(switch_loadable_module *new_module);
SWITCH_DECLARE(switch_status) switch_loadable_module_load_dynamic(switch_loadable_module_t *new_module);
/*!
\brief Retrieve the timer interface by it's registered name

View File

@ -159,25 +159,25 @@ struct switch_io_event_hooks {
/*! \brief A table of i/o routines that an endpoint interface can implement */
struct switch_io_routines {
/*! 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_t *);
switch_status (*outgoing_channel)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t *);
/*! answers the given session's channel */
switch_status (*answer_channel)(switch_core_session *);
switch_status (*answer_channel)(switch_core_session_t *);
/*! read a frame from a session */
switch_status (*read_frame)(switch_core_session *, switch_frame **, int, switch_io_flag, int);
switch_status (*read_frame)(switch_core_session_t *, switch_frame_t **, int, switch_io_flag, int);
/*! write a frame to a session */
switch_status (*write_frame)(switch_core_session *, switch_frame *, int, switch_io_flag, int);
switch_status (*write_frame)(switch_core_session_t *, switch_frame_t *, int, switch_io_flag, int);
/*! send a kill signal to the session's channel */
switch_status (*kill_channel)(switch_core_session *, int);
switch_status (*kill_channel)(switch_core_session_t *, int);
/*! wait for the session's channel to be ready to read audio */
switch_status (*waitfor_read)(switch_core_session *, int, int);
switch_status (*waitfor_read)(switch_core_session_t *, int, int);
/*! wait for the session's channel to be ready to write audio */
switch_status (*waitfor_write)(switch_core_session *, int, int);
switch_status (*waitfor_write)(switch_core_session_t *, int, int);
/*! send a string of DTMF digits to a session's channel */
switch_status (*send_dtmf)(switch_core_session *, char *);
switch_status (*send_dtmf)(switch_core_session_t *, char *);
/*! receive a message from another session*/
switch_status (*receive_message)(switch_core_session *, switch_core_session_message *);
switch_status (*receive_message)(switch_core_session_t *, switch_core_session_message_t *);
/*! queue a message for another session*/
switch_status (*queue_event)(switch_core_session *, switch_event_t *);
switch_status (*queue_event)(switch_core_session_t *, switch_event_t *);
};
/*! \brief Abstraction of an module endpoint interface
@ -194,7 +194,7 @@ struct switch_endpoint_interface {
const switch_io_routines *io_routines;
/*! state machine methods */
const switch_state_handler_table *state_handler;
const switch_state_handler_table_t *state_handler;
/*! private information */
void *private_info;
@ -226,11 +226,11 @@ struct switch_timer_interface {
/*! the name of the interface */
const char *interface_name;
/*! function to allocate the timer */
switch_status (*timer_init)(switch_timer *);
switch_status (*timer_init)(switch_timer_t *);
/*! function to wait for one cycle to pass */
switch_status (*timer_next)(switch_timer *);
switch_status (*timer_next)(switch_timer_t *);
/*! function to deallocate the timer */
switch_status (*timer_destroy)(switch_timer *);
switch_status (*timer_destroy)(switch_timer_t *);
const struct switch_timer_interface *next;
};
@ -248,15 +248,15 @@ struct switch_file_interface {
/*! the name of the interface */
const char *interface_name;
/*! function to open the file */
switch_status (*file_open)(switch_file_handle *, char *file_path);
switch_status (*file_open)(switch_file_handle_t *, char *file_path);
/*! function to close the file */
switch_status (*file_close)(switch_file_handle *);
switch_status (*file_close)(switch_file_handle_t *);
/*! function to read from the file */
switch_status (*file_read)(switch_file_handle *, void *data, switch_size_t *len);
switch_status (*file_read)(switch_file_handle_t *, void *data, switch_size_t *len);
/*! function to write from the file */
switch_status (*file_write)(switch_file_handle *, void *data, switch_size_t *len);
switch_status (*file_write)(switch_file_handle_t *, void *data, switch_size_t *len);
/*! function to seek to a certian position in the file */
switch_status (*file_seek)(switch_file_handle *, unsigned int *cur_pos, int64_t samples, int whence);
switch_status (*file_seek)(switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence);
/*! list of supported file extensions */
char **extens;
const struct switch_file_interface *next;
@ -291,7 +291,7 @@ struct switch_file_handle {
/*! private data for the format module to store handle specific info */
void *private_info;
int64_t pos;
switch_buffer *audio_buffer;
switch_buffer_t *audio_buffer;
};
@ -412,9 +412,9 @@ struct switch_codec {
/*! the codec interface table this handle uses */
const struct switch_codec_interface *codec_interface;
/*! the specific implementation of the above codec */
const struct switch_codec_implementation *implementation;
const switch_codec_implementation_t *implementation;
/*! codec settings for this handle */
struct switch_codec_settings codec_settings;
switch_codec_settings_t codec_settings;
/*! flags to modify behaviour */
uint32_t flags;
/*! the handle's memory pool*/
@ -444,10 +444,10 @@ struct switch_codec_implementation {
/*! max number of frames to send in one network packet */
int max_frames_per_packet;
/*! function to initialize a codec handle using this implementation */
switch_status (*init)(switch_codec *, switch_codec_flag, const switch_codec_settings *codec_settings);
switch_status (*init)(switch_codec_t *, switch_codec_flag, const switch_codec_settings_t *codec_settings);
/*! function to encode raw data into encoded data */
switch_status (*encode)(switch_codec *codec,
switch_codec *other_codec,
switch_status (*encode)(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -456,8 +456,8 @@ struct switch_codec_implementation {
uint32_t *encoded_rate,
unsigned int *flag);
/*! function to decode encoded data into raw data */
switch_status (*decode)(switch_codec *codec,
switch_codec *other_codec,
switch_status (*decode)(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -466,7 +466,7 @@ struct switch_codec_implementation {
uint32_t *decoded_rate,
unsigned int *flag);
/*! deinitalize a codec handle using this implementation */
switch_status (*destroy)(switch_codec *);
switch_status (*destroy)(switch_codec_t *);
const struct switch_codec_implementation *next;
};
@ -481,7 +481,7 @@ struct switch_codec_interface {
/*! the IANA code name */
char *iananame;
/*! a list of codec implementations related to the codec */
const switch_codec_implementation *implementations;
const switch_codec_implementation_t *implementations;
const struct switch_codec_interface *next;
};

View File

@ -245,7 +245,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp_t *rtp_session
\param frame a frame to populate with information
\return the number of bytes read
*/
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame *frame);
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame_t *frame);
/*!
\brief Write data to a given RTP session
@ -266,7 +266,7 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint
\param flags flags for control
\return SWITCH_STAUTS_SUCCESS on success
*/
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);
SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session_t *session, switch_codec_t *codec, switch_vad_flag_t flags);
/*!
\brief Disable VAD on an RTP Session
@ -282,7 +282,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp_t *rtp_session);
\param ts then number of bytes to increment the timestamp by
\return the number of bytes written
*/
SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame *frame, uint32_t ts);
SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame_t *frame, uint32_t ts);
/*!
\brief Write data with a specified payload and sequence number to a given RTP session

View File

@ -164,7 +164,7 @@ typedef enum {
} switch_ivr_option_t;
/*!
\enum switch_core_session_message_t
\enum switch_core_session_message_types_t
\brief Possible types of messages for inter-session communication
<pre>
SWITCH_MESSAGE_REDIRECT_AUDIO - Indication to redirect audio to another location if possible
@ -180,7 +180,7 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_PROGRESS,
SWITCH_MESSAGE_INDICATE_BRIDGE,
SWITCH_MESSAGE_INDICATE_UNBRIDGE
} switch_core_session_message_t;
} switch_core_session_message_types_t;
/*!
@ -595,33 +595,28 @@ typedef enum {
typedef uint8_t switch_payload_t;
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_t;
typedef struct switch_event_header switch_event_header_t;
typedef struct switch_event switch_event_t;
typedef struct switch_event_subclass switch_event_subclass;
typedef struct switch_event_node switch_event_node;
typedef struct switch_loadable_module switch_loadable_module;
typedef struct switch_frame switch_frame;
typedef struct switch_channel switch_channel;
typedef struct switch_endpoint_interface switch_endpoint_interface;
typedef struct switch_timer_interface switch_timer_interface;
typedef struct switch_dialplan_interface switch_dialplan_interface;
typedef struct switch_codec_interface switch_codec_interface;
typedef struct switch_application_interface switch_application_interface;
typedef struct switch_api_interface switch_api_interface;
typedef struct switch_file_interface switch_file_interface;
typedef struct switch_file_handle switch_file_handle;
typedef struct switch_core_session switch_core_session;
typedef struct switch_loadable_module_interface switch_loadable_module_interface;
typedef struct switch_caller_profile switch_caller_profile;
typedef struct switch_caller_step switch_caller_step;
typedef struct switch_caller_extension switch_caller_extension;
typedef struct switch_caller_application switch_caller_application;
typedef struct switch_state_handler_table switch_state_handler_table;
typedef struct switch_timer switch_timer;
typedef struct switch_codec switch_codec;
typedef struct switch_core_thread_session switch_core_thread_session;
typedef struct switch_codec_implementation switch_codec_implementation;
typedef struct switch_event_subclass switch_event_subclass_t;
typedef struct switch_event_node switch_event_node_t;
typedef struct switch_loadable_module switch_loadable_module_t;
typedef struct switch_frame switch_frame_t;
typedef struct switch_channel switch_channel_t;
typedef struct switch_file_handle switch_file_handle_t;
typedef struct switch_core_session switch_core_session_t;
typedef struct switch_caller_profile switch_caller_profile_t;
typedef struct switch_caller_extension switch_caller_extension_t;
typedef struct switch_caller_application switch_caller_application_t;
typedef struct switch_state_handler_table switch_state_handler_table_t;
typedef struct switch_timer switch_timer_t;
typedef struct switch_codec switch_codec_t;
typedef struct switch_core_thread_session switch_core_thread_session_t;
typedef struct switch_codec_implementation switch_codec_implementation_t;
typedef struct switch_buffer switch_buffer_t;
typedef struct switch_codec_settings switch_codec_settings_t;
typedef struct switch_config switch_config_t;
typedef struct switch_io_event_hook_outgoing_channel switch_io_event_hook_outgoing_channel;
typedef struct switch_io_event_hook_answer_channel switch_io_event_hook_answer_channel;
typedef struct switch_io_event_hook_receive_message switch_io_event_hook_receive_message;
@ -634,29 +629,37 @@ typedef struct switch_io_event_hook_waitfor_write switch_io_event_hook_waitfor_w
typedef struct switch_io_event_hook_send_dtmf switch_io_event_hook_send_dtmf;
typedef struct switch_io_routines switch_io_routines;
typedef struct switch_io_event_hooks switch_io_event_hooks;
typedef struct switch_buffer switch_buffer;
typedef struct switch_codec_settings switch_codec_settings;
typedef struct switch_config switch_config;
typedef struct switch_speech_handle switch_speech_handle;
typedef struct switch_speech_interface switch_speech_interface;
typedef struct switch_directory_handle switch_directory_handle;
typedef struct switch_loadable_module_interface switch_loadable_module_interface;
typedef struct switch_endpoint_interface switch_endpoint_interface;
typedef struct switch_timer_interface switch_timer_interface;
typedef struct switch_dialplan_interface switch_dialplan_interface;
typedef struct switch_codec_interface switch_codec_interface;
typedef struct switch_application_interface switch_application_interface;
typedef struct switch_api_interface switch_api_interface;
typedef struct switch_file_interface switch_file_interface;
typedef struct switch_speech_interface switch_speech_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_t *, char *);
typedef void (*switch_event_callback_t)(switch_event_t *);
typedef switch_caller_extension *(*switch_dialplan_hunt_function)(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_answer_channel_hook)(switch_core_session *);
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_t *);
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_kill_channel_hook)(switch_core_session *, int);
typedef switch_status (*switch_waitfor_read_hook)(switch_core_session *, int, int);
typedef switch_status (*switch_waitfor_write_hook)(switch_core_session *, int, int);
typedef switch_status (*switch_send_dtmf_hook)(switch_core_session *, char *);
typedef switch_caller_extension_t *(*switch_dialplan_hunt_function)(switch_core_session_t *);
typedef switch_status (*switch_state_handler)(switch_core_session_t *);
typedef switch_status (*switch_outgoing_channel_hook)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t *);
typedef switch_status (*switch_answer_channel_hook)(switch_core_session_t *);
typedef switch_status (*switch_receive_message_hook)(switch_core_session_t *, switch_core_session_message_t *);
typedef switch_status (*switch_queue_event_hook)(switch_core_session_t *, switch_event_t *);
typedef switch_status (*switch_read_frame_hook)(switch_core_session_t *, switch_frame_t **, int, switch_io_flag, int);
typedef switch_status (*switch_write_frame_hook)(switch_core_session_t *, switch_frame_t *, int, switch_io_flag, int);
typedef switch_status (*switch_kill_channel_hook)(switch_core_session_t *, int);
typedef switch_status (*switch_waitfor_read_hook)(switch_core_session_t *, int, int);
typedef switch_status (*switch_waitfor_write_hook)(switch_core_session_t *, int, int);
typedef switch_status (*switch_send_dtmf_hook)(switch_core_session_t *, char *);
typedef switch_status (*switch_api_function)(char *in, char *out, switch_size_t outlen);
typedef switch_status (*switch_dtmf_callback_function)(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen);
typedef switch_status (*switch_dtmf_callback_function)(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen);
typedef int (*switch_core_db_callback_func)(void *pArg, int argc, char **argv, char **columnNames);
typedef switch_status (*switch_module_load_t) (switch_loadable_module_interface **, char *);
typedef switch_status (*switch_module_reload_t) (void);

View File

@ -36,11 +36,11 @@
static const char modname[] = "mod_bridgecall";
static void audio_bridge_function(switch_core_session *session, char *data)
static void audio_bridge_function(switch_core_session_t *session, char *data)
{
switch_channel *caller_channel;
switch_core_session *peer_session;
switch_caller_profile *caller_profile, *caller_caller_profile;
switch_channel_t *caller_channel;
switch_core_session_t *peer_session;
switch_caller_profile_t *caller_profile, *caller_caller_profile;
char chan_type[128] = { '\0' }, *chan_data;
unsigned int timelimit = 60; /* probably a useful option to pass in when there's time */
caller_channel = switch_core_session_get_channel(session);

View File

@ -43,10 +43,10 @@ static switch_status load_function(char *mod, char *out, size_t outlen)
static switch_status kill_function(char *dest, char *out, size_t outlen)
{
switch_core_session *session = NULL;
switch_core_session_t *session = NULL;
if ((session = switch_core_session_locate(dest))) {
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_core_session_kill_channel(session, SWITCH_SIG_KILL);
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
switch_core_session_rwunlock(session);
@ -61,7 +61,7 @@ static switch_status kill_function(char *dest, char *out, size_t outlen)
static switch_status transfer_function(char *cmd, char *out, size_t outlen)
{
switch_core_session *session = NULL;
switch_core_session_t *session = NULL;
char *argv[4] = {0};
int argc = 0;
@ -98,7 +98,7 @@ static switch_status transfer_function(char *cmd, char *out, size_t outlen)
static switch_status pause_function(char *cmd, char *out, size_t outlen)
{
switch_core_session *session = NULL;
switch_core_session_t *session = NULL;
char *argv[4] = {0};
int argc = 0;
@ -111,7 +111,7 @@ static switch_status pause_function(char *cmd, char *out, size_t outlen)
char *dest = argv[1];
if ((session = switch_core_session_locate(uuid))) {
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
if (!strcasecmp(dest, "on")) {
switch_channel_set_flag(channel, CF_HOLD);

View File

@ -33,9 +33,9 @@
static const char modname[] = "mod_echo";
static void echo_function(switch_core_session *session, char *data)
static void echo_function(switch_core_session_t *session, char *data)
{
switch_channel *channel;
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);

View File

@ -39,7 +39,7 @@ static const char modname[] = "mod_ivrtest";
dtmf handler function you can hook up to be executed when a digit is dialed during playback
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
*/
static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
static switch_status on_dtmf(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
@ -49,7 +49,7 @@ static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf
}
static void disast_function(switch_core_session *session, char *data)
static void disast_function(switch_core_session_t *session, char *data)
{
void *x = NULL;
memset((void *) x, 0, 1000);
@ -57,10 +57,10 @@ static void disast_function(switch_core_session *session, char *data)
}
static void dirtest_function(switch_core_session *session, char *data)
static void dirtest_function(switch_core_session_t *session, char *data)
{
char *var, *val;
switch_channel *channel;
switch_channel_t *channel;
switch_directory_handle dh;
channel = switch_core_session_get_channel(session);
@ -90,7 +90,7 @@ static void dirtest_function(switch_core_session *session, char *data)
}
static switch_status show_dtmf(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
static switch_status show_dtmf(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
@ -99,10 +99,10 @@ static switch_status show_dtmf(switch_core_session *session, char *dtmf, void *b
}
static void tts_function(switch_core_session *session, char *data)
static void tts_function(switch_core_session_t *session, char *data)
{
switch_channel *channel;
switch_codec *codec;
switch_channel_t *channel;
switch_codec_t *codec;
char *mydata, *text = NULL, *voice_name = NULL, *tts_name = NULL;
char buf[10] = "";
char *argv[3];
@ -134,11 +134,11 @@ static void tts_function(switch_core_session *session, char *data)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Done\n");
}
static void ivrtest_function(switch_core_session *session, char *data)
static void ivrtest_function(switch_core_session_t *session, char *data)
{
switch_channel *channel;
switch_channel_t *channel;
switch_status status = SWITCH_STATUS_SUCCESS;
switch_codec *codec;
switch_codec_t *codec;
char buf[10] = "";
char term;
char say[128] = "";
@ -182,9 +182,9 @@ static void ivrtest_function(switch_core_session *session, char *data)
}
static switch_status my_on_hangup(switch_core_session *session)
static switch_status my_on_hangup(switch_core_session_t *session)
{
switch_channel *channel;
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -194,7 +194,7 @@ static switch_status my_on_hangup(switch_core_session *session)
}
static const switch_state_handler_table state_handlers = {
static const switch_state_handler_table_t state_handlers = {
/*.on_init */ NULL,
/*.on_ring */ NULL,
/*.on_execute */ NULL,

View File

@ -37,7 +37,7 @@ static const char modname[] = "mod_playback";
dtmf handler function you can hook up to be executed when a digit is dialed during playback
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
*/
static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
static switch_status on_dtmf(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
@ -49,9 +49,9 @@ static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf
}
static void playback_function(switch_core_session *session, char *data)
static void playback_function(switch_core_session_t *session, char *data)
{
switch_channel *channel;
switch_channel_t *channel;
char *timer_name = NULL;
char *file_name = NULL;
@ -73,9 +73,9 @@ static void playback_function(switch_core_session *session, char *data)
}
static void record_function(switch_core_session *session, char *data)
static void record_function(switch_core_session_t *session, char *data)
{
switch_channel *channel;
switch_channel_t *channel;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);

View File

@ -47,7 +47,7 @@ typedef struct {
swift_params *params;
swift_voice *voice;
switch_mutex_t *audio_lock;
switch_buffer *audio_buffer;
switch_buffer_t *audio_buffer;
int done;
int done_gen;
} cepstral_t;

View File

@ -36,8 +36,8 @@
static const char modname[] = "mod_g711codec";
static switch_status switch_g711u_init(switch_codec *codec, switch_codec_flag flags,
const struct switch_codec_settings *codec_settings)
static switch_status switch_g711u_init(switch_codec_t *codec, switch_codec_flag flags,
const switch_codec_settings_t *codec_settings)
{
int encoding, decoding;
@ -52,8 +52,8 @@ static switch_status switch_g711u_init(switch_codec *codec, switch_codec_flag fl
}
static switch_status switch_g711u_encode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_g711u_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -76,8 +76,8 @@ static switch_status switch_g711u_encode(switch_codec *codec,
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_g711u_decode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_g711u_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -105,14 +105,14 @@ static switch_status switch_g711u_decode(switch_codec *codec,
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_g711u_destroy(switch_codec *codec)
static switch_status switch_g711u_destroy(switch_codec_t *codec)
{
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_g711a_init(switch_codec *codec, switch_codec_flag flags,
const struct switch_codec_settings *codec_settings)
static switch_status switch_g711a_init(switch_codec_t *codec, switch_codec_flag flags,
const switch_codec_settings_t *codec_settings)
{
int encoding, decoding;
@ -127,8 +127,8 @@ static switch_status switch_g711a_init(switch_codec *codec, switch_codec_flag fl
}
static switch_status switch_g711a_encode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_g711a_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -151,8 +151,8 @@ static switch_status switch_g711a_encode(switch_codec *codec,
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_g711a_decode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_g711a_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -180,7 +180,7 @@ static switch_status switch_g711a_decode(switch_codec *codec,
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_g711a_destroy(switch_codec *codec)
static switch_status switch_g711a_destroy(switch_codec_t *codec)
{
return SWITCH_STATUS_SUCCESS;
}
@ -189,7 +189,7 @@ static switch_status switch_g711a_destroy(switch_codec *codec)
#if 0
static const switch_codec_implementation g711u_8k_60ms_implementation = {
static const switch_codec_implementation_t g711u_8k_60ms_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 19200,
/*.microseconds_per_frame */ 60000,
@ -206,7 +206,7 @@ static const switch_codec_implementation g711u_8k_60ms_implementation = {
};
static const switch_codec_implementation g711u_8k_30ms_implementation = {
static const switch_codec_implementation_t g711u_8k_30ms_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 96000,
/*.microseconds_per_frame */ 30000,
@ -224,7 +224,7 @@ static const switch_codec_implementation g711u_8k_30ms_implementation = {
};
#endif
static const switch_codec_implementation g711u_16k_implementation = {
static const switch_codec_implementation_t g711u_16k_implementation = {
/*.samples_per_second */ 16000,
/*.bits_per_second */ 128000,
/*.microseconds_per_frame */ 20000,
@ -240,7 +240,7 @@ static const switch_codec_implementation g711u_16k_implementation = {
/*.destroy */ switch_g711u_destroy,
};
static const switch_codec_implementation g711u_8k_implementation = {
static const switch_codec_implementation_t g711u_8k_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 64000,
/*.microseconds_per_frame */ 20000,
@ -258,7 +258,7 @@ static const switch_codec_implementation g711u_8k_implementation = {
};
static const switch_codec_implementation g711a_8k_implementation = {
static const switch_codec_implementation_t g711a_8k_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 64000,
/*.microseconds_per_frame */ 20000,

View File

@ -42,8 +42,8 @@ struct g729_context {
};
static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag flags,
const struct switch_codec_settings *codec_settings)
static switch_status switch_g729_init(switch_codec_t *codec, switch_codec_flag flags,
const switch_codec_settings_t *codec_settings)
{
struct g729_context *context = NULL;
@ -72,7 +72,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla
}
static switch_status switch_g729_destroy(switch_codec *codec)
static switch_status switch_g729_destroy(switch_codec_t *codec)
{
codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS;
@ -80,8 +80,8 @@ static switch_status switch_g729_destroy(switch_codec *codec)
static switch_status switch_g729_encode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_g729_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
@ -127,8 +127,8 @@ static switch_status switch_g729_encode(switch_codec *codec,
static switch_status switch_g729_decode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_g729_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
@ -218,7 +218,7 @@ static switch_status switch_g729_decode(switch_codec *codec,
/* Registration */
static const switch_codec_implementation g729_10ms_8k_implementation = {
static const switch_codec_implementation_t g729_10ms_8k_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 32000,
/*.microseconds_per_frame */ 10000,
@ -234,7 +234,7 @@ static const switch_codec_implementation g729_10ms_8k_implementation = {
/*.destroy */ switch_g729_destroy,
};
static const switch_codec_implementation g729_8k_implementation = {
static const switch_codec_implementation_t g729_8k_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 64000,
/*.microseconds_per_frame */ 20000,

View File

@ -36,8 +36,8 @@ struct gsm_context {
gsm encoder;
gsm decoder;
};
static switch_status switch_gsm_init(switch_codec *codec, switch_codec_flag flags,
const struct switch_codec_settings *codec_settings)
static switch_status switch_gsm_init(switch_codec_t *codec, switch_codec_flag flags,
const switch_codec_settings_t *codec_settings)
{
struct gsm_context *context;
int encoding, decoding;
@ -55,7 +55,7 @@ static switch_status switch_gsm_init(switch_codec *codec, switch_codec_flag flag
codec->private_info = context;
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_gsm_destroy(switch_codec *codec)
static switch_status switch_gsm_destroy(switch_codec_t *codec)
{
struct gsm_context *context = codec->private_info;
int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE);
@ -67,7 +67,7 @@ static switch_status switch_gsm_destroy(switch_codec *codec)
codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_gsm_encode(switch_codec *codec, switch_codec *other_codec, void *decoded_data,
static switch_status switch_gsm_encode(switch_codec_t *codec, switch_codec_t *other_codec, void *decoded_data,
uint32_t decoded_data_len, uint32_t decoded_rate, void *encoded_data,
uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag)
{
@ -96,7 +96,7 @@ static switch_status switch_gsm_encode(switch_codec *codec, switch_codec *other_
}
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_gsm_decode(switch_codec *codec, switch_codec *other_codec, void *encoded_data,
static switch_status switch_gsm_decode(switch_codec_t *codec, switch_codec_t *other_codec, void *encoded_data,
uint32_t encoded_data_len, uint32_t encoded_rate, void *decoded_data,
uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag)
{
@ -132,7 +132,7 @@ static switch_status switch_gsm_decode(switch_codec *codec, switch_codec *other_
/* Registration */
static const switch_codec_implementation gsm_8k_implementation = {
static const switch_codec_implementation_t gsm_8k_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 13200,
/*.microseconds_per_frame */ 20000,

View File

@ -44,8 +44,8 @@ struct ilbc_context {
uint16_t dbytes;
};
static switch_status switch_ilbc_init(switch_codec *codec, switch_codec_flag flags,
const struct switch_codec_settings *codec_settings)
static switch_status switch_ilbc_init(switch_codec_t *codec, switch_codec_flag flags,
const switch_codec_settings_t *codec_settings)
{
struct ilbc_context *context;
int encoding, decoding;
@ -86,15 +86,15 @@ static switch_status switch_ilbc_init(switch_codec *codec, switch_codec_flag fla
}
static switch_status switch_ilbc_destroy(switch_codec *codec)
static switch_status switch_ilbc_destroy(switch_codec_t *codec)
{
codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_ilbc_encode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_ilbc_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -136,8 +136,8 @@ static switch_status switch_ilbc_encode(switch_codec *codec,
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_ilbc_decode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_ilbc_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -185,7 +185,7 @@ static switch_status switch_ilbc_decode(switch_codec *codec,
/* Registration */
static const switch_codec_implementation ilbc_8k_30ms_implementation = {
static const switch_codec_implementation_t ilbc_8k_30ms_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ NO_OF_BYTES_30MS*8*8000/BLOCKL_30MS,
/*.microseconds_per_frame */ 30000,
@ -201,7 +201,7 @@ static const switch_codec_implementation ilbc_8k_30ms_implementation = {
/*.destroy */ switch_ilbc_destroy
};
static const switch_codec_implementation ilbc_8k_20ms_implementation = {
static const switch_codec_implementation_t ilbc_8k_20ms_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS,
/*.microseconds_per_frame */ 20000,
@ -219,7 +219,7 @@ static const switch_codec_implementation ilbc_8k_20ms_implementation = {
};
static const switch_codec_implementation ilbc_8k_20ms_nonext_implementation = {
static const switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS,
/*.microseconds_per_frame */ 20000,

View File

@ -34,8 +34,8 @@
static const char modname[] = "mod_rawaudio";
static switch_status switch_raw_init(switch_codec *codec, switch_codec_flag flags,
const struct switch_codec_settings *codec_settings)
static switch_status switch_raw_init(switch_codec_t *codec, switch_codec_flag flags,
const switch_codec_settings_t *codec_settings)
{
int encoding, decoding;
@ -49,8 +49,8 @@ static switch_status switch_raw_init(switch_codec *codec, switch_codec_flag flag
}
}
static switch_status switch_raw_encode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_raw_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -67,8 +67,8 @@ static switch_status switch_raw_encode(switch_codec *codec,
return SWITCH_STATUS_NOOP;
}
static switch_status switch_raw_decode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_raw_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -84,13 +84,13 @@ static switch_status switch_raw_decode(switch_codec *codec,
}
static switch_status switch_raw_destroy(switch_codec *codec)
static switch_status switch_raw_destroy(switch_codec_t *codec)
{
return SWITCH_STATUS_SUCCESS;
}
static const switch_codec_implementation raw_32k_implementation = {
static const switch_codec_implementation_t raw_32k_implementation = {
/*.samples_per_second = */ 32000,
/*.bits_per_second = */ 512000,
/*.microseconds_per_frame = */ 20000,
@ -106,7 +106,7 @@ static const switch_codec_implementation raw_32k_implementation = {
/*.destroy = */ switch_raw_destroy
};
static const switch_codec_implementation raw_22k_implementation = {
static const switch_codec_implementation_t raw_22k_implementation = {
/*.samples_per_second = */ 22050,
/*.bits_per_second = */ 352800,
/*.microseconds_per_frame = */ 20000,
@ -123,7 +123,7 @@ static const switch_codec_implementation raw_22k_implementation = {
/*.next = */ &raw_32k_implementation
};
static const switch_codec_implementation raw_16k_implementation = {
static const switch_codec_implementation_t raw_16k_implementation = {
/*.samples_per_second = */ 16000,
/*.bits_per_second = */ 256000,
/*.microseconds_per_frame = */ 20000,
@ -140,7 +140,7 @@ static const switch_codec_implementation raw_16k_implementation = {
/*.next = */ &raw_22k_implementation
};
static const switch_codec_implementation raw_8k_implementation = {
static const switch_codec_implementation_t raw_8k_implementation = {
/*.samples_per_second = */ 8000,
/*.bits_per_second = */ 128000,
/*.microseconds_per_frame = */ 20000,
@ -158,7 +158,7 @@ static const switch_codec_implementation raw_8k_implementation = {
};
static const switch_codec_implementation raw_8k_30ms_implementation = {
static const switch_codec_implementation_t raw_8k_30ms_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 128000,
/*.microseconds_per_frame */ 30000,

View File

@ -35,7 +35,7 @@
static const char modname[] = "mod_speexcodec";
static const struct switch_codec_settings default_codec_settings = {
static const switch_codec_settings_t default_codec_settings = {
/*.quality */ 5,
/*.complexity */ 5,
/*.enhancement */ 1,
@ -55,7 +55,7 @@ static const struct switch_codec_settings default_codec_settings = {
};
struct speex_context {
switch_codec *codec;
switch_codec_t *codec;
unsigned int flags;
/* Encoder */
@ -72,8 +72,8 @@ struct speex_context {
int decoder_mode;
};
static switch_status switch_speex_init(switch_codec *codec, switch_codec_flag flags,
const struct switch_codec_settings *codec_settings)
static switch_status switch_speex_init(switch_codec_t *codec, switch_codec_flag flags,
const switch_codec_settings_t *codec_settings)
{
struct speex_context *context = NULL;
int encoding, decoding;
@ -157,8 +157,8 @@ static switch_status switch_speex_init(switch_codec *codec, switch_codec_flag fl
}
}
static switch_status switch_speex_encode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_speex_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -212,8 +212,8 @@ static switch_status switch_speex_encode(switch_codec *codec,
return SWITCH_STATUS_SUCCESS;
}
static switch_status switch_speex_decode(switch_codec *codec,
switch_codec *other_codec,
static switch_status switch_speex_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -239,7 +239,7 @@ static switch_status switch_speex_decode(switch_codec *codec,
}
static switch_status switch_speex_destroy(switch_codec *codec)
static switch_status switch_speex_destroy(switch_codec_t *codec)
{
int encoding, decoding;
struct speex_context *context = codec->private_info;
@ -267,7 +267,7 @@ static switch_status switch_speex_destroy(switch_codec *codec)
}
/* Registration */
static const switch_codec_implementation speex_32k_implementation = {
static const switch_codec_implementation_t speex_32k_implementation = {
/*.samples_per_second */ 32000,
/*.bits_per_second */ 512000,
/*.nanoseconds_per_frame */ 20000,
@ -283,7 +283,7 @@ static const switch_codec_implementation speex_32k_implementation = {
/*.destroy */ switch_speex_destroy
};
static const switch_codec_implementation speex_16k_implementation = {
static const switch_codec_implementation_t speex_16k_implementation = {
/*.samples_per_second */ 16000,
/*.bits_per_second */ 256000,
/*.nanoseconds_per_frame */ 20000,
@ -300,7 +300,7 @@ static const switch_codec_implementation speex_16k_implementation = {
/*.next */ &speex_32k_implementation
};
static const switch_codec_implementation speex_8k_implementation = {
static const switch_codec_implementation_t speex_8k_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 128000,
/*.nanoseconds_per_frame */ 20000,

View File

@ -38,13 +38,13 @@
static const char modname[] = "mod_dialplan_demo";
static switch_caller_extension *demo_dialplan_hunt(switch_core_session *session)
static switch_caller_extension_t *demo_dialplan_hunt(switch_core_session_t *session)
{
switch_caller_profile *caller_profile;
switch_caller_extension *extension = NULL;
switch_channel *channel;
switch_caller_profile_t *caller_profile;
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
char *cf = "extensions.conf";
switch_config cfg;
switch_config_t cfg;
char *var, *val;
char app[1024];

View File

@ -54,7 +54,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_base, globals.base)
static void load_config(void)
{
char *cf = "dialplan_directory.conf";
switch_config cfg;
switch_config_t cfg;
char *var, *val;
if (!switch_config_open_file(&cfg, cf)) {
@ -82,11 +82,11 @@ static void load_config(void)
switch_config_close_file(&cfg);
}
static switch_caller_extension *directory_dialplan_hunt(switch_core_session *session)
static switch_caller_extension_t *directory_dialplan_hunt(switch_core_session_t *session)
{
switch_caller_profile *caller_profile;
switch_caller_extension *extension = NULL;
switch_channel *channel;
switch_caller_profile_t *caller_profile;
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
char *var, *val;
char filter[256];
switch_directory_handle dh;

View File

@ -42,13 +42,13 @@ static const char modname[] = "mod_pcre";
re = NULL;\
}
static switch_caller_extension *dialplan_hunt(switch_core_session *session)
static switch_caller_extension_t *dialplan_hunt(switch_core_session_t *session)
{
switch_caller_profile *caller_profile;
switch_caller_extension *extension = NULL;
switch_channel *channel;
switch_caller_profile_t *caller_profile;
switch_caller_extension_t *extension = NULL;
switch_channel_t *channel;
char *cf = "regextensions.conf";
switch_config cfg;
switch_config_t cfg;
char *var, *val;
char app[1024] = "";
int catno = -1;

View File

@ -96,12 +96,12 @@ struct mdl_profile {
struct private_object {
unsigned int flags;
switch_codec read_codec;
switch_codec write_codec;
struct switch_frame read_frame;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_frame_t read_frame;
struct mdl_profile *profile;
switch_core_session *session;
switch_caller_profile *caller_profile;
switch_core_session_t *session;
switch_caller_profile_t *caller_profile;
unsigned short samprate;
switch_mutex_t *mutex;
switch_codec_interface *codecs[SWITCH_MAX_CODECS];
@ -149,18 +149,18 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string)
static switch_status channel_on_init(switch_core_session *session);
static switch_status channel_on_hangup(switch_core_session *session);
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_transmit(switch_core_session *session);
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
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_on_init(switch_core_session_t *session);
static switch_status channel_on_hangup(switch_core_session_t *session);
static switch_status channel_on_ring(switch_core_session_t *session);
static switch_status channel_on_loopback(switch_core_session_t *session);
static switch_status channel_on_transmit(switch_core_session_t *session);
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool);
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
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_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id);
static switch_status channel_kill_channel(switch_core_session *session, int sig);
static switch_status channel_kill_channel(switch_core_session_t *session, int sig);
static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *msg);
static ldl_status handle_response(ldl_handle_t *handle, char *id);
static switch_status load_config(void);
@ -230,7 +230,7 @@ static void handle_thread_launch(ldl_handle_t *handle)
static int activate_rtp(struct private_object *tech_pvt)
{
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
const char *err;
int ms = 20;
@ -308,7 +308,7 @@ static int activate_rtp(struct private_object *tech_pvt)
static int do_candidates(struct private_object *tech_pvt, int force)
{
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
assert(channel != NULL);
if (switch_test_flag(tech_pvt, TFLAG_DO_CAND)) {
@ -399,7 +399,7 @@ static char *lame(char *in)
static int do_describe(struct private_object *tech_pvt, int force)
{
ldl_payload_t payloads[5];
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
assert(channel != NULL);
if (switch_test_flag(tech_pvt, TFLAG_DO_DESC)) {
@ -451,9 +451,9 @@ static int do_describe(struct private_object *tech_pvt, int force)
static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, void *obj)
{
switch_core_session *session = obj;
switch_core_session_t *session = obj;
switch_channel *channel;
switch_channel_t *channel;
struct private_object *tech_pvt = NULL;
switch_time_t started;
switch_time_t now;
@ -530,7 +530,7 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, vo
}
static void negotiate_thread_launch(switch_core_session *session)
static void negotiate_thread_launch(switch_core_session_t *session)
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL;
@ -548,9 +548,9 @@ static void negotiate_thread_launch(switch_core_session *session)
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
*/
static switch_status channel_on_init(switch_core_session *session)
static switch_status channel_on_init(switch_core_session_t *session)
{
switch_channel *channel;
switch_channel_t *channel;
struct private_object *tech_pvt = NULL;
tech_pvt = switch_core_session_get_private(session);
@ -567,9 +567,9 @@ static switch_status channel_on_init(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_ring(switch_core_session *session)
static switch_status channel_on_ring(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -583,10 +583,10 @@ static switch_status channel_on_ring(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_execute(switch_core_session *session)
static switch_status channel_on_execute(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -601,9 +601,9 @@ static switch_status channel_on_execute(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_hangup(switch_core_session *session)
static switch_status channel_on_hangup(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -640,9 +640,9 @@ static switch_status channel_on_hangup(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_kill_channel(switch_core_session *session, int sig)
static switch_status channel_kill_channel(switch_core_session_t *session, int sig)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
if ((channel = switch_core_session_get_channel(session))) {
@ -664,19 +664,19 @@ static switch_status channel_kill_channel(switch_core_session *session, int sig)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_loopback(switch_core_session *session)
static switch_status channel_on_loopback(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_transmit(switch_core_session *session)
static switch_status channel_on_transmit(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_waitfor_read(switch_core_session *session, int ms, int stream_id)
static switch_status channel_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -686,7 +686,7 @@ static switch_status channel_waitfor_read(switch_core_session *session, int ms,
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_waitfor_write(switch_core_session *session, int ms, int stream_id)
static switch_status channel_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -697,7 +697,7 @@ static switch_status channel_waitfor_write(switch_core_session *session, int ms,
}
static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
static switch_status channel_send_dtmf(switch_core_session_t *session, char *dtmf)
{
struct private_object *tech_pvt = NULL;
//char *digit;
@ -709,13 +709,13 @@ static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
switch_io_flag flags, int stream_id)
{
struct private_object *tech_pvt = NULL;
uint32_t bytes = 0;
switch_size_t samples = 0, frames = 0, ms = 0;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
switch_payload_t payload = 0;
switch_status status;
@ -806,11 +806,11 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
switch_status status = SWITCH_STATUS_SUCCESS;
int bytes = 0, samples = 0, frames = 0;
@ -914,10 +914,10 @@ static switch_status channel_write_frame(switch_core_session *session, switch_fr
return status;
}
static switch_status channel_answer_channel(switch_core_session *session)
static switch_status channel_answer_channel(switch_core_session_t *session)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -934,9 +934,9 @@ static switch_status channel_answer_channel(switch_core_session *session)
}
static switch_status channel_receive_message(switch_core_session *session, switch_core_session_message *msg)
static switch_status channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)
{
switch_channel *channel;
switch_channel_t *channel;
struct private_object *tech_pvt;
channel = switch_core_session_get_channel(session);
@ -966,7 +966,7 @@ static switch_status channel_receive_message(switch_core_session *session, switc
return SWITCH_STATUS_SUCCESS;
}
static const switch_state_handler_table channel_event_handlers = {
static const switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@ -1008,13 +1008,13 @@ static const switch_loadable_module_interface channel_module_interface = {
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
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,
switch_core_session **new_session, switch_memory_pool_t *pool)
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool)
{
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_caller_profile *caller_profile = NULL;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile = NULL;
struct mdl_profile *mdl_profile = NULL;
ldl_session_t *dlsession = NULL;
char *profile_name;
@ -1181,7 +1181,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
static switch_status load_config(void)
{
switch_config cfg;
switch_config_t cfg;
char *var, *val;
char *cf = "dingaling.conf";
struct mdl_profile *profile = NULL;
@ -1282,8 +1282,8 @@ static switch_status load_config(void)
static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *msg)
{
struct mdl_profile *profile = NULL;
switch_core_session *session = NULL;
switch_channel *channel = NULL;
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
assert(dlsession != NULL);

View File

@ -98,11 +98,11 @@ static struct {
struct private_object {
unsigned int flags;
switch_core_session *session;
switch_frame read_frame;
switch_codec read_codec;
switch_codec write_codec;
switch_caller_profile *caller_profile;
switch_core_session_t *session;
switch_frame_t read_frame;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_caller_profile_t *caller_profile;
int cid;
int did;
int tid;
@ -145,19 +145,19 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_rtpip, globals.rtpip)
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string)
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_sipip, globals.sipip)
static switch_status exosip_on_init(switch_core_session *session);
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_transmit(switch_core_session *session);
static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
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_on_init(switch_core_session_t *session);
static switch_status exosip_on_hangup(switch_core_session_t *session);
static switch_status exosip_on_loopback(switch_core_session_t *session);
static switch_status exosip_on_transmit(switch_core_session_t *session);
static switch_status exosip_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool);
static switch_status exosip_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
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_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id);
static int config_exosip(int reload);
static switch_status parse_sdp_media(sdp_media_t * media, char **dname, char **drate, char **dpayload);
static switch_status exosip_kill_channel(switch_core_session *session, int sig);
static switch_status exosip_kill_channel(switch_core_session_t *session, int sig);
static switch_status activate_rtp(struct private_object *tech_pvt);
static void deactivate_rtp(struct private_object *tech_pvt);
static void sdp_add_rfc2833(struct osip_rfc3264 *cnf, int rate);
@ -173,7 +173,7 @@ static struct private_object *get_pvt_by_call_id(int id)
return tech_pvt;
}
static switch_status exosip_on_execute(switch_core_session *session)
static switch_status exosip_on_execute(switch_core_session_t *session)
{
return SWITCH_STATUS_SUCCESS;
}
@ -223,10 +223,10 @@ State methods they get called when the state changes to the specific state
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
*/
static switch_status exosip_on_init(switch_core_session *session)
static switch_status exosip_on_init(switch_core_session_t *session)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
char from_uri[512] = "", port[7] = "", *buf = NULL, tmp[512] = "";
osip_message_t *invite = NULL;
@ -320,7 +320,7 @@ static switch_status exosip_on_init(switch_core_session *session)
if (num_codecs > 0) {
int i;
static const switch_codec_implementation *imp;
static const switch_codec_implementation_t *imp;
for (i = 0; i < num_codecs; i++) {
int x = 0;
@ -382,9 +382,9 @@ static switch_status exosip_on_init(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status exosip_on_ring(switch_core_session *session)
static switch_status exosip_on_ring(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -398,10 +398,10 @@ static switch_status exosip_on_ring(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status exosip_on_hangup(switch_core_session *session)
static switch_status exosip_on_hangup(switch_core_session_t *session)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
int i;
channel = switch_core_session_get_channel(session);
@ -427,13 +427,13 @@ static switch_status exosip_on_hangup(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status exosip_on_loopback(switch_core_session *session)
static switch_status exosip_on_loopback(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "EXOSIP LOOPBACK\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status exosip_on_transmit(switch_core_session *session)
static switch_status exosip_on_transmit(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "EXOSIP TRANSMIT\n");
return SWITCH_STATUS_SUCCESS;
@ -462,7 +462,7 @@ static void deactivate_rtp(struct private_object *tech_pvt)
static switch_status activate_rtp(struct private_object *tech_pvt)
{
int bw, ms;
switch_channel *channel;
switch_channel_t *channel;
const char *err;
char *key = NULL;
@ -526,7 +526,7 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
switch_set_flag(tech_pvt, TFLAG_VAD);
}
} else {
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", err);
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_set_flag(tech_pvt, TFLAG_BYE);
@ -537,10 +537,10 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
return SWITCH_STATUS_SUCCESS;
}
static switch_status exosip_answer_channel(switch_core_session *session)
static switch_status exosip_answer_channel(switch_core_session_t *session)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
assert(session != NULL);
@ -571,12 +571,12 @@ static switch_status exosip_answer_channel(switch_core_session *session)
}
static switch_status exosip_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
static switch_status exosip_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
switch_io_flag flags, int stream_id)
{
struct private_object *tech_pvt = NULL;
size_t bytes = 0, samples = 0, frames = 0, ms = 0;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
int payload = 0;
switch_time_t now, started = switch_time_now(), last_act = switch_time_now();
unsigned int elapsed;
@ -699,11 +699,11 @@ static switch_status exosip_read_frame(switch_core_session *session, switch_fram
}
static switch_status exosip_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
static switch_status exosip_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
switch_status status = SWITCH_STATUS_SUCCESS;
int bytes = 0, samples = 0, frames = 0;
@ -811,10 +811,10 @@ static switch_status exosip_write_frame(switch_core_session *session, switch_fra
static switch_status exosip_kill_channel(switch_core_session *session, int sig)
static switch_status exosip_kill_channel(switch_core_session_t *session, int sig)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -833,10 +833,10 @@ static switch_status exosip_kill_channel(switch_core_session *session, int sig)
}
static switch_status exosip_waitfor_read(switch_core_session *session, int ms, int stream_id)
static switch_status exosip_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -848,10 +848,10 @@ static switch_status exosip_waitfor_read(switch_core_session *session, int ms, i
}
static switch_status exosip_waitfor_write(switch_core_session *session, int ms, int stream_id)
static switch_status exosip_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -863,7 +863,7 @@ static switch_status exosip_waitfor_write(switch_core_session *session, int ms,
}
static switch_status exosip_send_dtmf(switch_core_session *session, char *digits)
static switch_status exosip_send_dtmf(switch_core_session_t *session, char *digits)
{
struct private_object *tech_pvt;
char *c;
@ -891,9 +891,9 @@ static switch_status exosip_send_dtmf(switch_core_session *session, char *digits
return SWITCH_STATUS_SUCCESS;
}
static switch_status exosip_receive_message(switch_core_session *session, switch_core_session_message *msg)
static switch_status exosip_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)
{
switch_channel *channel;
switch_channel_t *channel;
struct private_object *tech_pvt;
channel = switch_core_session_get_channel(session);
@ -919,7 +919,7 @@ static switch_status exosip_receive_message(switch_core_session *session, switch
case SWITCH_MESSAGE_INDICATE_PROGRESS:
if (msg) {
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -969,7 +969,7 @@ static const switch_io_routines exosip_io_routines = {
/*.receive_message*/ exosip_receive_message
};
static const switch_state_handler_table exosip_event_handlers = {
static const switch_state_handler_table_t exosip_event_handlers = {
/*.on_init */ exosip_on_init,
/*.on_ring */ exosip_on_ring,
/*.on_execute */ exosip_on_execute,
@ -995,12 +995,12 @@ static const switch_loadable_module_interface exosip_module_interface = {
/*.application_interface */ NULL
};
static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
switch_core_session **new_session, switch_memory_pool_t *pool)
static switch_status exosip_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool)
{
if ((*new_session = switch_core_session_request(&exosip_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_channel_t *channel;
switch_core_session_add_stream(*new_session, NULL);
if ((tech_pvt =
@ -1018,7 +1018,7 @@ static switch_status exosip_outgoing_channel(switch_core_session *session, switc
if (outbound_profile) {
char name[128];
switch_caller_profile *caller_profile = NULL;
switch_caller_profile_t *caller_profile = NULL;
if (*outbound_profile->destination_number == '!') {
@ -1113,13 +1113,13 @@ static void sdp_add_rfc2833(struct osip_rfc3264 *cnf, int rate)
static switch_status exosip_create_call(eXosip_event_t * event)
{
switch_core_session *session;
switch_core_session_t *session;
sdp_message_t *remote_sdp = NULL;
sdp_connection_t *conn = NULL;
sdp_media_t *remote_med = NULL, *audio_tab[10], *video_tab[10], *t38_tab[10], *app_tab[10];
char local_sdp_str[8192] = "", port[8] = "";
int mline = 0, pos = 0;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
char name[128];
char *dpayload, *dname = NULL, *drate = NULL;
char *remote_sdp_str = NULL;
@ -1262,7 +1262,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
if (num_codecs > 0) {
int i;
static const switch_codec_implementation *imp;
static const switch_codec_implementation_t *imp;
@ -1396,7 +1396,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
static void destroy_call_by_event(eXosip_event_t *event)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
switch_call_cause_t cause;
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
@ -1482,7 +1482,7 @@ static void handle_answer(eXosip_event_t * event)
sdp_media_t *remote_med = NULL;
struct private_object *tech_pvt;
char *dpayload = NULL, *dname = NULL, *drate = NULL;
switch_channel *channel;
switch_channel_t *channel;
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
@ -1713,7 +1713,7 @@ static void log_event(eXosip_event_t * je)
static int config_exosip(int reload)
{
switch_config cfg;
switch_config_t cfg;
char *var, *val;
char *cf = "exosip.conf";

View File

@ -79,13 +79,13 @@ static struct {
struct private_object {
unsigned int flags;
switch_codec read_codec;
switch_codec write_codec;
struct switch_frame read_frame;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_frame_t read_frame;
unsigned char databuf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
switch_core_session *session;
switch_core_session_t *session;
struct iax_session *iax_session;
switch_caller_profile *caller_profile;
switch_caller_profile_t *caller_profile;
unsigned int codec;
unsigned int codecs;
unsigned short samprate;
@ -211,7 +211,7 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
char *dname = NULL;
//int rate = 8000;
//int codec_ms = 20;
switch_channel *channel;
switch_channel_t *channel;
switch_codec_interface *codecs[SWITCH_MAX_CODECS];
int num_codecs = 0;
unsigned int local_cap = 0, mixed_cap = 0, chosen = 0, leading = 0;
@ -390,18 +390,18 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_init(switch_core_session *session);
static switch_status channel_on_hangup(switch_core_session *session);
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_transmit(switch_core_session *session);
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
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_on_init(switch_core_session_t *session);
static switch_status channel_on_hangup(switch_core_session_t *session);
static switch_status channel_on_ring(switch_core_session_t *session);
static switch_status channel_on_loopback(switch_core_session_t *session);
static switch_status channel_on_transmit(switch_core_session_t *session);
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool);
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
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_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id);
static switch_status channel_kill_channel(switch_core_session *session, int sig);
static switch_status channel_kill_channel(switch_core_session_t *session, int sig);
static void iax_err_cb(const char *s)
@ -422,9 +422,9 @@ State methods they get called when the state changes to the specific state
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
*/
static switch_status channel_on_init(switch_core_session *session)
static switch_status channel_on_init(switch_core_session_t *session)
{
switch_channel *channel;
switch_channel_t *channel;
struct private_object *tech_pvt = NULL;
tech_pvt = switch_core_session_get_private(session);
@ -449,9 +449,9 @@ static switch_status channel_on_init(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_ring(switch_core_session *session)
static switch_status channel_on_ring(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -465,10 +465,10 @@ static switch_status channel_on_ring(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_execute(switch_core_session *session)
static switch_status channel_on_execute(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -483,9 +483,9 @@ static switch_status channel_on_execute(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_hangup(switch_core_session *session)
static switch_status channel_on_hangup(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -519,9 +519,9 @@ static switch_status channel_on_hangup(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_kill_channel(switch_core_session *session, int sig)
static switch_status channel_kill_channel(switch_core_session_t *session, int sig)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -541,19 +541,19 @@ static switch_status channel_kill_channel(switch_core_session *session, int sig)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_loopback(switch_core_session *session)
static switch_status channel_on_loopback(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_transmit(switch_core_session *session)
static switch_status channel_on_transmit(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_waitfor_read(switch_core_session *session, int ms, int stream_id)
static switch_status channel_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -563,7 +563,7 @@ static switch_status channel_waitfor_read(switch_core_session *session, int ms,
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_waitfor_write(switch_core_session *session, int ms, int stream_id)
static switch_status channel_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -574,7 +574,7 @@ static switch_status channel_waitfor_write(switch_core_session *session, int ms,
}
static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
static switch_status channel_send_dtmf(switch_core_session_t *session, char *dtmf)
{
struct private_object *tech_pvt = NULL;
char *digit;
@ -590,10 +590,10 @@ static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
switch_io_flag flags, int stream_id)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
switch_time_t started = switch_time_now();
unsigned int elapsed;
@ -636,12 +636,12 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
return SWITCH_STATUS_FALSE;
}
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
//switch_frame *pframe;
//switch_frame_t *pframe;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -665,10 +665,10 @@ static switch_status channel_write_frame(switch_core_session *session, switch_fr
}
static switch_status channel_answer_channel(switch_core_session *session)
static switch_status channel_answer_channel(switch_core_session_t *session)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -682,7 +682,7 @@ static switch_status channel_answer_channel(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static const switch_state_handler_table channel_event_handlers = {
static const switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@ -723,13 +723,13 @@ static const switch_loadable_module_interface channel_module_interface = {
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
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,
switch_core_session **new_session, switch_memory_pool_t *pool)
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool)
{
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_caller_profile *caller_profile;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
unsigned int req = 0, cap = 0;
unsigned short samprate = 0;
@ -817,7 +817,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
static switch_status load_config(void)
{
switch_config cfg;
switch_config_t cfg;
char *var, *val;
char *cf = "iax.conf";
@ -949,7 +949,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
case IAX_EVENT_ANSWER:
// the other side answered our call
if (tech_pvt) {
switch_channel *channel;
switch_channel_t *channel;
if ((channel = switch_core_session_get_channel(tech_pvt->session)) != 0) {
if (switch_channel_test_flag(channel, CF_ANSWERED)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "WTF Mutiple Answer %s?\n",
@ -972,13 +972,13 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
iaxevent->ies.calling_name, iaxevent->ies.format, iaxevent->ies.capability);
if (iaxevent) {
switch_core_session *session;
switch_core_session_t *session;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n",
iaxevent->ies.calling_name);
if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_channel_t *channel;
switch_core_session_add_stream(session, NULL);
if ((tech_pvt =
@ -1036,7 +1036,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
case IAX_EVENT_BUSY:
case IAX_EVENT_HANGUP:
if (tech_pvt) {
switch_channel *channel;
switch_channel_t *channel;
switch_clear_flag(tech_pvt, TFLAG_IO);
switch_clear_flag(tech_pvt, TFLAG_VOICE);
@ -1058,7 +1058,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
break;
case IAX_EVENT_VOICE:
if (tech_pvt && (tech_pvt->read_frame.datalen = iaxevent->datalen) != 0) {
switch_channel *channel;
switch_channel_t *channel;
if (((channel = switch_core_session_get_channel(tech_pvt->session)) != 0)
&& switch_channel_get_state(channel) <= CS_HANGUP) {
int bytes, frames;
@ -1086,7 +1086,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
break;
case IAX_EVENT_DTMF:
if (tech_pvt) {
switch_channel *channel;
switch_channel_t *channel;
if ((channel = switch_core_session_get_channel(tech_pvt->session)) != 0) {
char str[2] = { (char)iaxevent->subclass };
if (globals.debug) {

View File

@ -80,12 +80,12 @@ static struct {
struct private_object {
unsigned int flags;
switch_codec read_codec;
switch_codec write_codec;
struct switch_frame read_frame;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_frame_t read_frame;
unsigned char databuf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
switch_core_session *session;
switch_caller_profile *caller_profile;
switch_core_session_t *session;
switch_caller_profile_t *caller_profile;
char call_id[50];
PaError err;
PABLIO_Stream *audio_in;
@ -98,19 +98,19 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_cid_name, globals.cid_name)
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_cid_num, globals.cid_num)
static switch_status channel_on_init(switch_core_session *session);
static switch_status channel_on_hangup(switch_core_session *session);
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_transmit(switch_core_session *session);
static switch_status channel_outgoing_channel(switch_core_session *session,
switch_caller_profile *outbound_profile,
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_on_init(switch_core_session_t *session);
static switch_status channel_on_hangup(switch_core_session_t *session);
static switch_status channel_on_ring(switch_core_session_t *session);
static switch_status channel_on_loopback(switch_core_session_t *session);
static switch_status channel_on_transmit(switch_core_session_t *session);
static switch_status channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool);
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
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_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id);
static switch_status channel_kill_channel(switch_core_session *session, int sig);
static switch_status channel_kill_channel(switch_core_session_t *session, int sig);
static switch_status engage_device(struct private_object *tech_pvt);
static int dump_info(void);
static switch_status load_config(void);
@ -126,9 +126,9 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
*/
static switch_status channel_on_init(switch_core_session *session)
static switch_status channel_on_init(switch_core_session_t *session)
{
switch_channel *channel;
switch_channel_t *channel;
struct private_object *tech_pvt = NULL;
tech_pvt = switch_core_session_get_private(session);
@ -148,9 +148,9 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_ring(switch_core_session *session)
static switch_status channel_on_ring(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -164,10 +164,10 @@ static switch_status channel_on_ring(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_execute(switch_core_session *session)
static switch_status channel_on_execute(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -196,9 +196,9 @@ static void deactivate_audio_device(struct private_object *tech_pvt)
switch_mutex_unlock(globals.device_lock);
}
static switch_status channel_on_hangup(switch_core_session *session)
static switch_status channel_on_hangup(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -220,9 +220,9 @@ static switch_status channel_on_hangup(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_kill_channel(switch_core_session *session, int sig)
static switch_status channel_kill_channel(switch_core_session_t *session, int sig)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -241,15 +241,15 @@ static switch_status channel_kill_channel(switch_core_session *session, int sig)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_loopback(switch_core_session *session)
static switch_status channel_on_loopback(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_on_transmit(switch_core_session *session)
static switch_status channel_on_transmit(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
switch_time_t last;
int waitsec = 5 * 1000000;
@ -291,7 +291,7 @@ static switch_status channel_on_transmit(switch_core_session *session)
}
static switch_status channel_waitfor_read(switch_core_session *session, int ms, int stream_id)
static switch_status channel_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -301,7 +301,7 @@ static switch_status channel_waitfor_read(switch_core_session *session, int ms,
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_waitfor_write(switch_core_session *session, int ms, int stream_id)
static switch_status channel_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -312,7 +312,7 @@ static switch_status channel_waitfor_write(switch_core_session *session, int ms,
}
static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
static switch_status channel_send_dtmf(switch_core_session_t *session, char *dtmf)
{
struct private_object *tech_pvt = NULL;
@ -324,10 +324,10 @@ static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
return SWITCH_STATUS_SUCCESS;
}
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
switch_io_flag flags, int stream_id)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
int samples;
switch_status status = SWITCH_STATUS_FALSE;
@ -358,10 +358,10 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
return status;
}
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
switch_status status = SWITCH_STATUS_FALSE;
channel = switch_core_session_get_channel(session);
@ -384,10 +384,10 @@ static switch_status channel_write_frame(switch_core_session *session, switch_fr
}
static switch_status channel_answer_channel(switch_core_session *session)
static switch_status channel_answer_channel(switch_core_session_t *session)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -434,7 +434,7 @@ static struct switch_api_interface channel_api_interface = {
/*.next */ &channel_hup_interface
};
static const switch_state_handler_table channel_event_handlers = {
static const switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@ -475,13 +475,13 @@ static const switch_loadable_module_interface channel_module_interface = {
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
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,
switch_core_session **new_session, switch_memory_pool_t *pool)
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool)
{
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_caller_profile *caller_profile;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
switch_core_session_add_stream(*new_session, NULL);
if ((tech_pvt =
@ -554,7 +554,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
static switch_status load_config(void)
{
switch_config cfg;
switch_config_t cfg;
char *var, *val;
char *cf = "portaudio.conf";
@ -715,7 +715,7 @@ static switch_status engage_device(struct private_object *tech_pvt)
int sample_rate = globals.sample_rate;
int codec_ms = 20;
switch_channel *channel;
switch_channel_t *channel;
channel = switch_core_session_get_channel(tech_pvt->session);
assert(channel != NULL);
@ -782,7 +782,7 @@ static switch_status engage_device(struct private_object *tech_pvt)
static switch_status place_call(char *dest, char *out, size_t outlen)
{
switch_core_session *session;
switch_core_session_t *session;
switch_status status = SWITCH_STATUS_FALSE;
if (!dest) {
@ -794,7 +794,7 @@ static switch_status place_call(char *dest, char *out, size_t outlen)
if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_channel_t *channel;
switch_core_session_add_stream(session, NULL);
if ((tech_pvt = (struct private_object *) switch_core_session_alloc(session, sizeof(struct private_object))) != 0) {
@ -834,7 +834,7 @@ static switch_status place_call(char *dest, char *out, size_t outlen)
static switch_status hup_call(char *callid, char *out, size_t outlen)
{
struct private_object *tech_pvt;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
char tmp[50];
if (callid && !strcasecmp(callid, "last")) {
@ -878,7 +878,7 @@ static switch_status hup_call(char *callid, char *out, size_t outlen)
static switch_status send_dtmf(char *callid, char *out, size_t outlen)
{
struct private_object *tech_pvt = NULL;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
char *dtmf;
if ((dtmf = strchr(callid, ' ')) != 0) {
@ -902,7 +902,7 @@ static switch_status send_dtmf(char *callid, char *out, size_t outlen)
static switch_status answer_call(char *callid, char *out, size_t outlen)
{
struct private_object *tech_pvt = NULL;
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
if ((tech_pvt = switch_core_hash_find(globals.call_hash, callid)) != 0) {
channel = switch_core_session_get_channel(tech_pvt->session);
@ -918,7 +918,7 @@ static switch_status answer_call(char *callid, char *out, size_t outlen)
static void print_info(struct private_object *tech_pvt, char *out, size_t outlen)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(tech_pvt->session);
assert(channel != NULL);

View File

@ -130,10 +130,10 @@ struct woomera_profile {
struct private_object {
char *name;
switch_frame frame;
switch_codec read_codec;
switch_codec write_codec;
switch_core_session *session;
switch_frame_t frame;
switch_codec_t read_codec;
switch_codec_t write_codec;
switch_core_session_t *session;
switch_pollfd_t read_poll;
switch_pollfd_t write_poll;
switch_pollfd_t command_poll;
@ -152,7 +152,7 @@ struct private_object {
switch_time_t started;
int timeout;
char dtmfbuf[WOOMERA_STRLEN];
switch_caller_profile *caller_profile;
switch_caller_profile_t *caller_profile;
struct woomera_event_queue event_queue;
};
@ -163,18 +163,18 @@ typedef struct woomera_event_queue woomera_event_queue;
static woomera_profile default_profile;
static switch_status woomerachan_on_init(switch_core_session *session);
static switch_status woomerachan_on_hangup(switch_core_session *session);
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_transmit(switch_core_session *session);
static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
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_on_init(switch_core_session_t *session);
static switch_status woomerachan_on_hangup(switch_core_session_t *session);
static switch_status woomerachan_on_ring(switch_core_session_t *session);
static switch_status woomerachan_on_loopback(switch_core_session_t *session);
static switch_status woomerachan_on_transmit(switch_core_session_t *session);
static switch_status woomerachan_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool);
static switch_status woomerachan_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
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_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id);
static switch_status woomerachan_kill_channel(switch_core_session *session, int sig);
static switch_status woomerachan_kill_channel(switch_core_session_t *session, int sig);
static void tech_destroy(private_object * tech_pvt);
static void woomera_printf(woomera_profile * profile, switch_socket_t *socket, char *fmt, ...);
static char *woomera_message_header(woomera_message * wmsg, char *key);
@ -195,9 +195,9 @@ static int tech_activate(private_object * tech_pvt);
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
*/
static switch_status woomerachan_on_init(switch_core_session *session)
static switch_status woomerachan_on_init(switch_core_session_t *session)
{
switch_channel *channel;
switch_channel_t *channel;
struct private_object *tech_pvt = NULL;
int rate = 8000;
@ -239,9 +239,9 @@ static switch_status woomerachan_on_init(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status woomerachan_on_ring(switch_core_session *session)
static switch_status woomerachan_on_ring(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -255,10 +255,10 @@ static switch_status woomerachan_on_ring(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status woomerachan_on_execute(switch_core_session *session)
static switch_status woomerachan_on_execute(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -273,9 +273,9 @@ static switch_status woomerachan_on_execute(switch_core_session *session)
return SWITCH_STATUS_SUCCESS;
}
static switch_status woomerachan_on_hangup(switch_core_session *session)
static switch_status woomerachan_on_hangup(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -311,9 +311,9 @@ static void udp_socket_close(struct private_object *tech_pvt)
}
static switch_status woomerachan_kill_channel(switch_core_session *session, int sig)
static switch_status woomerachan_kill_channel(switch_core_session_t *session, int sig)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
channel = switch_core_session_get_channel(session);
@ -336,19 +336,19 @@ static switch_status woomerachan_kill_channel(switch_core_session *session, int
return SWITCH_STATUS_SUCCESS;
}
static switch_status woomerachan_on_loopback(switch_core_session *session)
static switch_status woomerachan_on_loopback(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERACHAN LOOPBACK\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status woomerachan_on_transmit(switch_core_session *session)
static switch_status woomerachan_on_transmit(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERACHAN TRANSMIT\n");
return SWITCH_STATUS_SUCCESS;
}
static switch_status woomerachan_waitfor_read(switch_core_session *session, int ms, int stream_id)
static switch_status woomerachan_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -358,7 +358,7 @@ static switch_status woomerachan_waitfor_read(switch_core_session *session, int
return switch_socket_waitfor(&tech_pvt->read_poll, ms) ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
}
static switch_status woomerachan_waitfor_write(switch_core_session *session, int ms, int stream_id)
static switch_status woomerachan_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
{
struct private_object *tech_pvt = NULL;
@ -369,12 +369,12 @@ static switch_status woomerachan_waitfor_write(switch_core_session *session, int
// return switch_socket_waitfor(&tech_pvt->write_poll, ms);
}
static switch_status woomerachan_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
static switch_status woomerachan_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
switch_io_flag flags, int stream_id)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
switch_frame *pframe;
switch_frame_t *pframe;
switch_size_t len;
channel = switch_core_session_get_channel(session);
@ -404,13 +404,13 @@ static switch_status woomerachan_read_frame(switch_core_session *session, switch
return SWITCH_STATUS_FALSE;
}
static switch_status woomerachan_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
static switch_status woomerachan_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
switch_io_flag flags, int stream_id)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
switch_size_t len;
//switch_frame *pframe;
//switch_frame_t *pframe;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -432,7 +432,7 @@ static switch_status woomerachan_write_frame(switch_core_session *session, switc
return SWITCH_STATUS_GENERR;
}
static const switch_state_handler_table woomerachan_event_handlers = {
static const switch_state_handler_table_t woomerachan_event_handlers = {
/*.on_init */ woomerachan_on_init,
/*.on_ring */ woomerachan_on_ring,
/*.on_execute */ woomerachan_on_execute,
@ -472,12 +472,12 @@ static const switch_loadable_module_interface woomerachan_module_interface = {
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
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,
switch_core_session **new_session, switch_memory_pool_t *pool)
static switch_status woomerachan_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool)
{
if ((*new_session = switch_core_session_request(&woomerachan_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_channel_t *channel;
switch_core_session_add_stream(*new_session, NULL);
if ((tech_pvt =
@ -495,7 +495,7 @@ static switch_status woomerachan_outgoing_channel(switch_core_session *session,
if (outbound_profile) {
char name[128];
switch_caller_profile *caller_profile;
switch_caller_profile_t *caller_profile;
snprintf(name, sizeof(name), "Woomera/%s-%04x", outbound_profile->destination_number, rand() & 0xffff);
switch_channel_set_name(channel, name);
@ -928,8 +928,8 @@ static int tech_activate(private_object * tech_pvt)
static void *woomera_channel_thread_run(switch_thread_t *thread, void *obj)
{
switch_core_session *session = obj;
switch_channel *channel = NULL;
switch_core_session_t *session = obj;
switch_channel_t *channel = NULL;
struct private_object *tech_pvt = NULL;
woomera_message wmsg;
int res = 0;
@ -1227,7 +1227,7 @@ static void *woomera_thread_run(void *obj)
if (!strcasecmp(wmsg.command, "INCOMING")) {
char *name;
switch_core_session *session;
switch_core_session_t *session;
if ((name = woomera_message_header(&wmsg, "Remote-Address")) == 0) {
name = woomera_message_header(&wmsg, "Channel-Name");
@ -1236,7 +1236,7 @@ static void *woomera_thread_run(void *obj)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n", name);
if ((session = switch_core_session_request(&woomerachan_endpoint_interface, NULL)) != 0) {
struct private_object *tech_pvt;
switch_channel *channel;
switch_channel_t *channel;
switch_core_session_add_stream(session, NULL);
@ -1301,7 +1301,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename)
{
switch_config cfg;
switch_config_t cfg;
char *var, *val;
struct woomera_profile *profile = &default_profile;
char *cf = "woomera.conf";

View File

@ -50,7 +50,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_address, globals.address)
static switch_status load_config(void)
{
switch_config cfg;
switch_config_t cfg;
switch_status status = SWITCH_STATUS_SUCCESS;
char *var, *val;
char *cf = "event_multicast.conf";

View File

@ -72,7 +72,7 @@ static void *torture_thread(switch_thread_t *thread, void *obj)
{
int y = 0;
int z = 0;
switch_core_thread_session *ts = obj;
switch_core_thread_session_t *ts = obj;
switch_event_t *event;
z = THREADS++;

View File

@ -97,7 +97,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_jid, globals.jid)
static switch_status load_config(void)
{
switch_config cfg;
switch_config_t cfg;
switch_status status = SWITCH_STATUS_FALSE;
char *var, *val;
char *cf = "xmpp_event.conf";

View File

@ -193,7 +193,7 @@ static void event_handler(switch_event_t *event)
static switch_status load_config(void)
{
switch_config cfg;
switch_config_t cfg;
switch_status status = SWITCH_STATUS_SUCCESS;
char *var, *val;
char *cf = "zeroconf.conf";

View File

@ -41,7 +41,7 @@ struct sndfile_context {
typedef struct sndfile_context sndfile_context;
static switch_status sndfile_file_open(switch_file_handle *handle, char *path)
static switch_status sndfile_file_open(switch_file_handle_t *handle, char *path)
{
sndfile_context *context;
int mode = 0;
@ -144,7 +144,7 @@ static switch_status sndfile_file_open(switch_file_handle *handle, char *path)
return SWITCH_STATUS_SUCCESS;
}
static switch_status sndfile_file_close(switch_file_handle *handle)
static switch_status sndfile_file_close(switch_file_handle_t *handle)
{
sndfile_context *context = handle->private_info;
@ -153,7 +153,7 @@ static switch_status sndfile_file_close(switch_file_handle *handle)
return SWITCH_STATUS_SUCCESS;
}
static switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sample, int64_t samples, int whence)
static switch_status sndfile_file_seek(switch_file_handle_t *handle, unsigned int *cur_sample, int64_t samples, int whence)
{
sndfile_context *context = handle->private_info;
@ -169,7 +169,7 @@ static switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int
}
static switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t *len)
static switch_status sndfile_file_read(switch_file_handle_t *handle, void *data, size_t *len)
{
size_t inlen = *len;
sndfile_context *context = handle->private_info;
@ -191,7 +191,7 @@ static switch_status sndfile_file_read(switch_file_handle *handle, void *data, s
return SWITCH_STATUS_SUCCESS;
}
static switch_status sndfile_file_write(switch_file_handle *handle, void *data, size_t *len)
static switch_status sndfile_file_write(switch_file_handle_t *handle, void *data, size_t *len)
{
size_t inlen = *len;
sndfile_context *context = handle->private_info;

View File

@ -63,7 +63,7 @@ static PerlInterpreter *clone_perl(void)
}
static void perl_function(switch_core_session *session, char *data)
static void perl_function(switch_core_session_t *session, char *data)
{
char *uuid = switch_core_session_get_uuid(session);
char code[1024];

View File

@ -64,44 +64,44 @@ void fs_console_clean(char *msg)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, msg);
}
struct switch_core_session *fs_core_session_locate(char *uuid)
switch_core_session_t *fs_core_session_locate(char *uuid)
{
return switch_core_session_locate(uuid);
}
void fs_channel_answer(struct switch_core_session *session)
void fs_channel_answer(switch_core_session_t *session)
{
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_answer(channel);
}
void fs_channel_pre_answer(struct switch_core_session *session)
void fs_channel_pre_answer(switch_core_session_t *session)
{
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_pre_answer(channel);
}
void fs_channel_hangup(struct switch_core_session *session)
void fs_channel_hangup(switch_core_session_t *session)
{
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
void fs_channel_set_variable(struct switch_core_session *session, char *var, char *val)
void fs_channel_set_variable(switch_core_session_t *session, char *var, char *val)
{
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_set_variable(channel, var, val);
}
void fs_channel_get_variable(struct switch_core_session *session, char *var)
void fs_channel_get_variable(switch_core_session_t *session, char *var)
{
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_get_variable(channel, var);
}
void fs_channel_set_state(struct switch_core_session *session, char *state)
void fs_channel_set_state(switch_core_session_t *session, char *state)
{
switch_channel *channel = switch_core_session_get_channel(session);
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_state fs_state = switch_channel_get_state(channel);
if (!strcmp(state, "EXECUTE")) {
@ -113,7 +113,7 @@ void fs_channel_set_state(struct switch_core_session *session, char *state)
switch_channel_set_state(channel, fs_state);
}
int fs_ivr_play_file(struct switch_core_session *session, char *file, char *timer_name)
int fs_ivr_play_file(switch_core_session_t *session, char *file, char *timer_name)
{
switch_status status;
if (switch_strlen_zero(timer_name)) {

View File

@ -106,7 +106,7 @@ struct dtmf_callback_state {
};
struct js_session {
switch_core_session *session;
switch_core_session_t *session;
JSContext *cx;
JSObject *obj;
unsigned int flags;
@ -116,13 +116,13 @@ struct teletone_obj {
teletone_generation_session_t ts;
JSContext *cx;
JSObject *obj;
switch_core_session *session;
switch_codec codec;
switch_buffer *audio_buffer;
switch_buffer *loop_buffer;
switch_core_session_t *session;
switch_codec_t codec;
switch_buffer_t *audio_buffer;
switch_buffer_t *loop_buffer;
switch_memory_pool_t *pool;
switch_timer *timer;
switch_timer timer_base;
switch_timer_t *timer;
switch_timer_t timer_base;
char code_buffer[1024];
char ret_val[1024];
unsigned int flags;
@ -175,12 +175,12 @@ static switch_status init_js(void)
return SWITCH_STATUS_SUCCESS;
}
static switch_status js_stream_dtmf_callback(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
static switch_status js_stream_dtmf_callback(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
{
char code[2048];
struct dtmf_callback_state *cb_state = buf;
struct js_session *jss = cb_state->session_state;
switch_file_handle *fh = cb_state->extra;
switch_file_handle_t *fh = cb_state->extra;
jsval rval;
char *ret;
@ -241,7 +241,7 @@ static switch_status js_stream_dtmf_callback(switch_core_session *session, char
switch_core_file_seek(fh, &pos, 0, SEEK_SET);
return SWITCH_STATUS_SUCCESS;
} else if (!strncasecmp(ret, "seek", 4)) {
switch_codec *codec;
switch_codec_t *codec;
unsigned int samps = 0;
unsigned int pos = 0;
char *p;
@ -283,12 +283,12 @@ static switch_status js_stream_dtmf_callback(switch_core_session *session, char
}
static switch_status js_record_dtmf_callback(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
static switch_status js_record_dtmf_callback(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
{
char code[2048];
struct dtmf_callback_state *cb_state = buf;
struct js_session *jss = cb_state->session_state;
switch_file_handle *fh = cb_state->extra;
switch_file_handle_t *fh = cb_state->extra;
jsval rval;
char *ret;
@ -344,7 +344,7 @@ static switch_status js_record_dtmf_callback(switch_core_session *session, char
}
static switch_status js_speak_dtmf_callback(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
static switch_status js_speak_dtmf_callback(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
{
char code[2048];
struct dtmf_callback_state *cb_state = buf;
@ -392,14 +392,14 @@ static switch_status js_speak_dtmf_callback(switch_core_session *session, char *
static JSBool session_recordfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel *channel;
switch_channel_t *channel;
char *file_name = NULL;
char *dtmf_callback = NULL;
void *bp = NULL;
int len = 0;
switch_dtmf_callback_function dtmf_func = NULL;
struct dtmf_callback_state cb_state = {0};
switch_file_handle fh;
switch_file_handle_t fh;
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@ -437,7 +437,7 @@ static JSBool session_recordfile(JSContext *cx, JSObject *obj, uintN argc, jsval
static JSBool session_streamfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel *channel;
switch_channel_t *channel;
char *file_name = NULL;
char *timer_name = NULL;
char *dtmf_callback = NULL;
@ -445,7 +445,7 @@ static JSBool session_streamfile(JSContext *cx, JSObject *obj, uintN argc, jsval
int len = 0;
switch_dtmf_callback_function dtmf_func = NULL;
struct dtmf_callback_state cb_state = {0};
switch_file_handle fh;
switch_file_handle_t fh;
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@ -489,13 +489,13 @@ static JSBool session_streamfile(JSContext *cx, JSObject *obj, uintN argc, jsval
static JSBool session_speak(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel *channel;
switch_channel_t *channel;
char *tts_name = NULL;
char *voice_name = NULL;
char *text = NULL;
char *dtmf_callback = NULL;
char *timer_name = NULL;
switch_codec *codec;
switch_codec_t *codec;
void *bp = NULL;
int len = 0;
struct dtmf_callback_state cb_state = {0};
@ -586,7 +586,7 @@ static JSBool session_get_digits(JSContext *cx, JSObject *obj, uintN argc, jsval
static JSBool session_answer(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel *channel;
switch_channel_t *channel;
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@ -598,7 +598,7 @@ static JSBool session_answer(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
static JSBool session_ready(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel *channel;
switch_channel_t *channel;
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@ -610,7 +610,7 @@ static JSBool session_ready(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
static JSBool session_wait_for_answer(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel *channel;
switch_channel_t *channel;
switch_time_t started;
unsigned int elapsed;
int32 timeout = 60;
@ -660,7 +660,7 @@ static JSBool session_execute(JSContext *cx, JSObject *obj, uintN argc, jsval *a
static JSBool session_hangup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel *channel;
switch_channel_t *channel;
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@ -852,8 +852,8 @@ static JSBool session_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval
struct js_session *jss = JS_GetPrivate(cx, obj);
int param = 0;
JSBool res = JS_TRUE;
switch_channel *channel;
switch_caller_profile *caller_profile;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
char *name;
channel = switch_core_session_get_channel(jss->session);
@ -928,7 +928,7 @@ JSClass session_class = {
};
static JSObject *new_js_session(JSContext *cx, JSObject *obj, switch_core_session *session, struct js_session *jss, char *name, int flags)
static JSObject *new_js_session(JSContext *cx, JSObject *obj, switch_core_session_t *session, struct js_session *jss, char *name, int flags)
{
JSObject *session_obj;
if ((session_obj = JS_DefineObject(cx, obj, name, &session_class, NULL, 0))) {
@ -969,8 +969,8 @@ static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
if (argc > 2) {
struct js_session *jss = NULL;
JSObject *session_obj;
switch_core_session *session = NULL, *peer_session = NULL;
switch_caller_profile *caller_profile = NULL;
switch_core_session_t *session = NULL, *peer_session = NULL;
switch_caller_profile_t *caller_profile = NULL;
char *channel_type = NULL;
char *dest = NULL;
char *dialplan = NULL;
@ -1053,7 +1053,7 @@ static void session_destroy(JSContext *cx, JSObject *obj)
if (cx && obj) {
if ((jss = JS_GetPrivate(cx, obj))) {
if (switch_test_flag(jss, S_HUP)) {
switch_channel *channel;
switch_channel_t *channel;
if (jss->session) {
channel = switch_core_session_get_channel(jss->session);
@ -1471,7 +1471,7 @@ static JSBool teletone_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
JSObject *session_obj;
struct teletone_obj *tto = NULL;
struct js_session *jss = NULL;
switch_codec *read_codec;
switch_codec_t *read_codec;
switch_memory_pool_t *pool;
char *timer_name = NULL;
@ -1601,13 +1601,13 @@ static JSBool teletone_generate(JSContext *cx, JSObject *obj, uintN argc, jsval
if (argc > 0) {
char *script;
switch_core_session *session;
switch_frame write_frame = {0};
switch_core_session_t *session;
switch_frame_t write_frame = {0};
unsigned char *fdata[1024];
switch_frame *read_frame;
switch_frame_t *read_frame;
int stream_id;
switch_core_thread_session thread_session;
switch_channel *channel;
switch_core_thread_session_t thread_session;
switch_channel_t *channel;
if (argc > 1) {
if (!JS_ValueToInt32(cx, argv[1], &loops)) {
@ -1676,7 +1676,7 @@ static JSBool teletone_generate(JSContext *cx, JSObject *obj, uintN argc, jsval
}
if ((write_frame.datalen = (uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
if (loops > 0) {
switch_buffer *tmp;
switch_buffer_t *tmp;
/* Switcharoo*/
tmp = tto->audio_buffer;
@ -2059,7 +2059,7 @@ static int env_init(JSContext *cx, JSObject *javascript_object)
return 1;
}
static void js_parse_and_execute(switch_core_session *session, char *input_code)
static void js_parse_and_execute(switch_core_session_t *session, char *input_code)
{
JSObject *javascript_global_object = NULL;
char buf[1024], *script, *arg, *argv[512];

View File

@ -80,7 +80,7 @@ static void add_mapping(char *var, char *val)
static switch_status config_logger(void)
{
switch_config cfg;
switch_config_t cfg;
char *var, *val;
char *cf = "console.conf";

View File

@ -48,7 +48,7 @@ struct timer_private {
#endif
};
static switch_status soft_timer_init(switch_timer *timer)
static switch_status soft_timer_init(switch_timer_t *timer)
{
struct timer_private *private;
@ -65,7 +65,7 @@ static switch_status soft_timer_init(switch_timer *timer)
return SWITCH_STATUS_SUCCESS;
}
static switch_status soft_timer_next(switch_timer *timer)
static switch_status soft_timer_next(switch_timer_t *timer)
{
struct timer_private *private = timer->private_info;
@ -91,7 +91,7 @@ static switch_status soft_timer_next(switch_timer *timer)
return SWITCH_STATUS_SUCCESS;
}
static switch_status soft_timer_destroy(switch_timer *timer)
static switch_status soft_timer_destroy(switch_timer_t *timer)
{
timer->private_info = NULL;
return SWITCH_STATUS_SUCCESS;

View File

@ -29,8 +29,8 @@
* switch_buffer.c -- Data Buffering Code
*
*/
#include <switch_buffer.h>
#include <switch.h>
#include <switch_buffer.h>
static uint32_t buffer_id = 0;
@ -41,11 +41,11 @@ struct switch_buffer {
uint32_t id;
};
SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer **buffer, switch_size_t max_len)
SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer_t **buffer, switch_size_t max_len)
{
switch_buffer *new_buffer;
switch_buffer_t *new_buffer;
if ((new_buffer = switch_core_alloc(pool, sizeof(switch_buffer))) != 0
if ((new_buffer = switch_core_alloc(pool, sizeof(switch_buffer_t))) != 0
&& (new_buffer->data = switch_core_alloc(pool, max_len)) != 0) {
new_buffer->datalen = max_len;
new_buffer->id = buffer_id++;
@ -55,7 +55,7 @@ SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, s
return SWITCH_STATUS_MEMERR;
}
SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer *buffer)
SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer_t *buffer)
{
assert(buffer != NULL);
@ -65,21 +65,21 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer *buffer)
}
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer *buffer)
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer_t *buffer)
{
assert(buffer != NULL);
return (switch_size_t) (buffer->datalen - buffer->used);
}
SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer *buffer)
SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer_t *buffer)
{
assert(buffer != NULL);
return buffer->used;
}
SWITCH_DECLARE(switch_size_t) switch_buffer_toss(switch_buffer *buffer, switch_size_t datalen)
SWITCH_DECLARE(switch_size_t) switch_buffer_toss(switch_buffer_t *buffer, switch_size_t datalen)
{
switch_size_t reading = 0;
@ -100,7 +100,7 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_toss(switch_buffer *buffer, switch_s
return buffer->datalen;
}
SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer *buffer, void *data, switch_size_t datalen)
SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datalen)
{
switch_size_t reading = 0;
@ -124,7 +124,7 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer *buffer, void *da
return reading;
}
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer *buffer, void *data, switch_size_t datalen)
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer_t *buffer, void *data, switch_size_t datalen)
{
switch_size_t freespace;
@ -144,7 +144,7 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer *buffer, void *d
return buffer->used;
}
SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer *buffer)
SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer_t *buffer)
{
assert(buffer != NULL);
assert(buffer->data != NULL);

View File

@ -29,10 +29,10 @@
* switch_caller.c -- Caller Identification
*
*/
#include <switch_caller.h>
#include <switch.h>
#include <switch_caller.h>
SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool_t *pool,
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memory_pool_t *pool,
char *dialplan,
char *caller_id_name,
char *caller_id_number,
@ -46,9 +46,9 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_
{
switch_caller_profile *profile = NULL;
switch_caller_profile_t *profile = NULL;
if ((profile = switch_core_alloc(pool, sizeof(switch_caller_profile))) != 0) {
if ((profile = switch_core_alloc(pool, sizeof(switch_caller_profile_t))) != 0) {
if (!context) {
context = "default";
}
@ -68,11 +68,11 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_
}
SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_session *session, switch_caller_profile *tocopy)
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_core_session_t *session, switch_caller_profile_t *tocopy)
{
switch_caller_profile *profile = NULL;
if ((profile = switch_core_session_alloc(session, sizeof(switch_caller_profile))) != 0) {
switch_caller_profile_t *profile = NULL;
if ((profile = switch_core_session_alloc(session, sizeof(switch_caller_profile_t))) != 0) {
profile->dialplan = switch_core_session_strdup(session, tocopy->dialplan);
profile->caller_id_name = switch_core_session_strdup(session, tocopy->caller_id_name);
profile->ani = switch_core_session_strdup(session, tocopy->ani);
@ -90,7 +90,7 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_
return profile;
}
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_t *caller_profile, char *prefix,
switch_event_t *event)
{
char header_name[1024];
@ -146,12 +146,12 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile
}
SWITCH_DECLARE(switch_caller_extension *) switch_caller_extension_new(switch_core_session *session,
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session,
char *extension_name, char *extension_number)
{
switch_caller_extension *caller_extension = NULL;
switch_caller_extension_t *caller_extension = NULL;
if ((caller_extension = switch_core_session_alloc(session, sizeof(switch_caller_extension))) != 0) {
if ((caller_extension = switch_core_session_alloc(session, sizeof(switch_caller_extension_t))) != 0) {
caller_extension->extension_name = switch_core_session_strdup(session, extension_name);
caller_extension->extension_number = switch_core_session_strdup(session, extension_number);
caller_extension->current_application = caller_extension->last_application = caller_extension->applications;
@ -161,15 +161,15 @@ SWITCH_DECLARE(switch_caller_extension *) switch_caller_extension_new(switch_cor
}
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session *session,
switch_caller_extension *caller_extension,
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
switch_caller_extension_t *caller_extension,
char *application_name, char *application_data)
{
switch_caller_application *caller_application = NULL;
switch_caller_application_t *caller_application = NULL;
assert(session != NULL);
if ((caller_application = switch_core_session_alloc(session, sizeof(switch_caller_application))) != 0) {
if ((caller_application = switch_core_session_alloc(session, sizeof(switch_caller_application_t))) != 0) {
caller_application->application_name = switch_core_session_strdup(session, application_name);
caller_application->application_data = switch_core_session_strdup(session, application_data);
if (!caller_extension->applications) {

View File

@ -29,8 +29,8 @@
* switch_channel.c -- Media Channel Interface
*
*/
#include <switch_channel.h>
#include <switch.h>
#include <switch_channel.h>
struct switch_cause_table {
const char *name;
@ -88,17 +88,17 @@ static struct switch_cause_table CAUSE_CHART[] = {
struct switch_channel {
char *name;
switch_buffer *dtmf_buffer;
switch_buffer_t *dtmf_buffer;
switch_mutex_t *dtmf_mutex;
switch_mutex_t *profile_mutex;
switch_core_session *session;
switch_core_session_t *session;
switch_channel_state state;
uint32_t flags;
switch_caller_profile *caller_profile;
switch_caller_profile *originator_caller_profile;
switch_caller_profile *originatee_caller_profile;
switch_caller_extension *caller_extension;
const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS];
switch_caller_profile_t *caller_profile;
switch_caller_profile_t *originator_caller_profile;
switch_caller_profile_t *originatee_caller_profile;
switch_caller_extension_t *caller_extension;
const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
int state_handler_index;
switch_hash_t *variables;
switch_channel_timetable_t *times;
@ -139,21 +139,21 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(char *str)
return cause;
}
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel *channel)
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel_t *channel)
{
return channel->hangup_cause;
}
SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch_channel *channel)
SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch_channel_t *channel)
{
return channel->times;
}
SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool_t *pool)
SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel_t **channel, switch_memory_pool_t *pool)
{
assert(pool != NULL);
if (((*channel) = switch_core_alloc(pool, sizeof(switch_channel))) == 0) {
if (((*channel) = switch_core_alloc(pool, sizeof(switch_channel_t))) == 0) {
return SWITCH_STATUS_MEMERR;
}
@ -166,7 +166,7 @@ SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, swi
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_status) switch_channel_set_raw_mode(switch_channel *channel, int freq, int bits, int channels,
SWITCH_DECLARE(switch_status) switch_channel_set_raw_mode(switch_channel_t *channel, int freq, int bits, int channels,
int ms, int kbps)
{
@ -182,7 +182,7 @@ SWITCH_DECLARE(switch_status) switch_channel_set_raw_mode(switch_channel *channe
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_status) switch_channel_get_raw_mode(switch_channel *channel, int *freq, int *bits, int *channels,
SWITCH_DECLARE(switch_status) switch_channel_get_raw_mode(switch_channel_t *channel, int *freq, int *bits, int *channels,
int *ms, int *kbps)
{
if (freq) {
@ -206,7 +206,7 @@ SWITCH_DECLARE(switch_status) switch_channel_get_raw_mode(switch_channel *channe
}
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel *channel)
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel)
{
switch_size_t has;
@ -218,7 +218,7 @@ SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel *channel)
return has;
}
SWITCH_DECLARE(switch_status) switch_channel_queue_dtmf(switch_channel *channel, char *dtmf)
SWITCH_DECLARE(switch_status) switch_channel_queue_dtmf(switch_channel_t *channel, char *dtmf)
{
switch_status status;
register switch_size_t len, inuse;
@ -241,7 +241,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_t *channel, char *dtmf, switch_size_t len)
{
switch_size_t bytes;
switch_event_t *event;
@ -264,8 +264,8 @@ SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf(switch_channel *channe
}
SWITCH_DECLARE(switch_status) switch_channel_init(switch_channel *channel,
switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_channel_init(switch_channel_t *channel,
switch_core_session_t *session,
switch_channel_state state, uint32_t flags)
{
assert(channel != NULL);
@ -276,25 +276,25 @@ SWITCH_DECLARE(switch_status) switch_channel_init(switch_channel *channel,
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel *channel, char *varname)
SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, char *varname)
{
return switch_core_hash_find(channel->variables, varname);
}
SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private_info)
SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel_t *channel, void *private_info)
{
assert(channel != NULL);
channel->private_info = private_info;
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel *channel)
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel)
{
assert(channel != NULL);
return channel->private_info;
}
SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel *channel, char *name)
SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel_t *channel, char *name)
{
assert(channel != NULL);
channel->name = NULL;
@ -307,13 +307,13 @@ SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel *channel, c
}
SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel *channel)
SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel)
{
assert(channel != NULL);
return channel->name;
}
SWITCH_DECLARE(switch_status) switch_channel_set_variable(switch_channel *channel, char *varname, char *value)
SWITCH_DECLARE(switch_status) switch_channel_set_variable(switch_channel_t *channel, char *varname, char *value)
{
assert(channel != NULL);
switch_core_hash_delete(channel->variables, varname);
@ -323,28 +323,28 @@ SWITCH_DECLARE(switch_status) switch_channel_set_variable(switch_channel *channe
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel *channel, switch_channel_flag flags)
SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag flags)
{
return switch_test_flag(channel, flags) ? 1 : 0;
}
SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel *channel, switch_channel_flag flags)
SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag flags)
{
switch_set_flag(channel, flags);
}
SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel *channel, switch_channel_flag flags)
SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag flags)
{
switch_clear_flag(channel, flags);
}
SWITCH_DECLARE(switch_channel_state) switch_channel_get_state(switch_channel *channel)
SWITCH_DECLARE(switch_channel_state) switch_channel_get_state(switch_channel_t *channel)
{
assert(channel != NULL);
return channel->state;
}
SWITCH_DECLARE(unsigned int) switch_channel_ready(switch_channel *channel)
SWITCH_DECLARE(unsigned int) switch_channel_ready(switch_channel_t *channel)
{
assert(channel != NULL);
return (channel->state > CS_RING && channel->state < CS_HANGUP) ? 1 : 0;
@ -367,7 +367,7 @@ SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state stat
return state_names[state];
}
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_channel *channel,
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_channel_t *channel,
const char *file,
const char *func,
int line,
@ -542,9 +542,9 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_cha
return channel->state;
}
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event_t *event)
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, switch_event_t *event)
{
switch_caller_profile *caller_profile, *originator_caller_profile, *originatee_caller_profile;
switch_caller_profile_t *caller_profile, *originator_caller_profile, *originatee_caller_profile;
switch_hash_index_t *hi;
void *val;
const void *var;
@ -589,7 +589,7 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, swit
}
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel *channel, switch_caller_profile *caller_profile)
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
{
switch_channel_timetable_t *times;
@ -626,9 +626,9 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel *channel,
switch_mutex_unlock(channel->profile_mutex);
}
SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_caller_profile(switch_channel *channel)
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_caller_profile(switch_channel_t *channel)
{
switch_caller_profile *profile;
switch_caller_profile_t *profile;
assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
@ -638,8 +638,8 @@ SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_caller_profile(switch
return profile;
}
SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel *channel,
switch_caller_profile *caller_profile)
SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel_t *channel,
switch_caller_profile_t *caller_profile)
{
assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
@ -648,8 +648,8 @@ SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel
switch_mutex_unlock(channel->profile_mutex);
}
SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel *channel,
switch_caller_profile *caller_profile)
SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel,
switch_caller_profile_t *caller_profile)
{
assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
@ -658,9 +658,9 @@ SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel
switch_mutex_unlock(channel->profile_mutex);
}
SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_originator_caller_profile(switch_channel *channel)
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_profile(switch_channel_t *channel)
{
switch_caller_profile *profile;
switch_caller_profile_t *profile;
assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
@ -670,16 +670,16 @@ SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_originator_caller_pro
return profile;
}
SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel *channel)
SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel_t *channel)
{
assert(channel != NULL);
assert(channel->session != NULL);
return switch_core_session_get_uuid(channel->session);
}
SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_originatee_caller_profile(switch_channel *channel)
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originatee_caller_profile(switch_channel_t *channel)
{
switch_caller_profile *profile;
switch_caller_profile_t *profile;
assert(channel != NULL);
switch_mutex_lock(channel->profile_mutex);
@ -689,8 +689,8 @@ SWITCH_DECLARE(switch_caller_profile *) switch_channel_get_originatee_caller_pro
return profile;
}
SWITCH_DECLARE(int) switch_channel_add_state_handler(switch_channel *channel,
const switch_state_handler_table *state_handler)
SWITCH_DECLARE(int) switch_channel_add_state_handler(switch_channel_t *channel,
const switch_state_handler_table_t *state_handler)
{
int index;
@ -705,7 +705,7 @@ SWITCH_DECLARE(int) switch_channel_add_state_handler(switch_channel *channel,
return index;
}
SWITCH_DECLARE(const switch_state_handler_table *) switch_channel_get_state_handler(switch_channel *channel, int index)
SWITCH_DECLARE(const switch_state_handler_table_t *) switch_channel_get_state_handler(switch_channel_t *channel, int index)
{
assert(channel != NULL);
@ -716,10 +716,10 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_channel_get_state_hand
return channel->state_handlers[index];
}
SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel *channel, const switch_state_handler_table *state_handler)
SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel_t *channel, const switch_state_handler_table_t *state_handler)
{
int index, i = 0;
const switch_state_handler_table *new_handlers[SWITCH_MAX_STATE_HANDLERS] = {0};
const switch_state_handler_table_t *new_handlers[SWITCH_MAX_STATE_HANDLERS] = {0};
assert(channel != NULL);
@ -738,15 +738,15 @@ SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel *channel,
}
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel *channel,
switch_caller_extension *caller_extension)
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel,
switch_caller_extension_t *caller_extension)
{
assert(channel != NULL);
channel->caller_extension = caller_extension;
}
SWITCH_DECLARE(switch_caller_extension *) switch_channel_get_caller_extension(switch_channel *channel)
SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_caller_extension(switch_channel_t *channel)
{
assert(channel != NULL);
@ -754,7 +754,7 @@ SWITCH_DECLARE(switch_caller_extension *) switch_channel_get_caller_extension(sw
}
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channel *channel,
SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channel_t *channel,
const char *file,
const char *func,
int line,
@ -786,12 +786,12 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channe
return channel->state;
}
SWITCH_DECLARE(switch_status) switch_channel_perform_pre_answer(switch_channel *channel,
SWITCH_DECLARE(switch_status) switch_channel_perform_pre_answer(switch_channel_t *channel,
const char *file,
const char *func,
int line)
{
switch_core_session_message msg;
switch_core_session_message_t msg;
char *uuid = switch_core_session_get_uuid(channel->session);
switch_status status;
@ -813,7 +813,7 @@ SWITCH_DECLARE(switch_status) switch_channel_perform_pre_answer(switch_channel *
return status;
}
SWITCH_DECLARE(switch_status) switch_channel_perform_answer(switch_channel *channel,
SWITCH_DECLARE(switch_status) switch_channel_perform_answer(switch_channel_t *channel,
const char *file,
const char *func,
int line)

View File

@ -29,10 +29,10 @@
* switch_config.c -- Configuration File Parser
*
*/
#include <switch_config.h>
#include <switch.h>
#include <switch_config.h>
SWITCH_DECLARE(int) switch_config_open_file(switch_config *cfg, char *file_path)
SWITCH_DECLARE(int) switch_config_open_file(switch_config_t *cfg, char *file_path)
{
FILE *f;
char *path = NULL;
@ -88,7 +88,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config *cfg, char *file_path)
}
SWITCH_DECLARE(void) switch_config_close_file(switch_config *cfg)
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t *cfg)
{
if (cfg->file) {
@ -100,7 +100,7 @@ SWITCH_DECLARE(void) switch_config_close_file(switch_config *cfg)
SWITCH_DECLARE(int) switch_config_next_pair(switch_config *cfg, char **var, char **val)
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t *cfg, char **var, char **val)
{
int ret = 0;
char *p, *end;

View File

@ -29,8 +29,8 @@
* switch_console.c -- Simple Console
*
*/
#include <switch_console.h>
#include <switch.h>
#include <switch_console.h>
#define CMD_BUFLEN 1024 * 1000
static int switch_console_process(char *cmd, char *retbuf, int retlen)

View File

@ -30,8 +30,8 @@
*
*/
#include <stdio.h>
#include <switch.h>
#include <stdio.h>
//#define DEBUG_ALLOC
#define SWITCH_EVENT_QUEUE_LEN 256
@ -43,22 +43,22 @@ struct switch_core_session {
char name[80];
int thread_running;
switch_memory_pool_t *pool;
switch_channel *channel;
switch_channel_t *channel;
switch_thread_t *thread;
const switch_endpoint_interface *endpoint_interface;
struct switch_io_event_hooks event_hooks;
switch_codec *read_codec;
switch_codec *write_codec;
switch_codec_t *read_codec;
switch_codec_t *write_codec;
switch_buffer *raw_write_buffer;
switch_frame raw_write_frame;
switch_frame enc_write_frame;
switch_buffer_t *raw_write_buffer;
switch_frame_t raw_write_frame;
switch_frame_t enc_write_frame;
uint8_t raw_write_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
uint8_t enc_write_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
switch_buffer *raw_read_buffer;
switch_frame raw_read_frame;
switch_frame enc_read_frame;
switch_buffer_t *raw_read_buffer;
switch_frame_t raw_read_frame;
switch_frame_t enc_read_frame;
uint8_t raw_read_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
uint8_t enc_read_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
@ -89,7 +89,7 @@ struct switch_core_runtime {
switch_hash_t *stack_table;
switch_core_db *db;
switch_core_db *event_db;
const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS];
const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
int state_handler_index;
FILE *console;
switch_queue_t *sql_queue;
@ -97,13 +97,13 @@ struct switch_core_runtime {
/* Prototypes */
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_hangup(switch_core_session *session);
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_loopback(switch_core_session *session);
static void switch_core_standard_on_transmit(switch_core_session *session);
static void switch_core_standard_on_hold(switch_core_session *session);
static void switch_core_standard_on_init(switch_core_session_t *session);
static void switch_core_standard_on_hangup(switch_core_session_t *session);
static void switch_core_standard_on_ring(switch_core_session_t *session);
static void switch_core_standard_on_execute(switch_core_session_t *session);
static void switch_core_standard_on_loopback(switch_core_session_t *session);
static void switch_core_standard_on_transmit(switch_core_session_t *session);
static void switch_core_standard_on_hold(switch_core_session_t *session);
/* The main runtime obj we keep this hidden for ourselves */
@ -204,7 +204,7 @@ SWITCH_DECLARE(FILE *) switch_core_data_channel(switch_text_channel channel)
return handle;
}
SWITCH_DECLARE(int) switch_core_add_state_handler(const switch_state_handler_table *state_handler)
SWITCH_DECLARE(int) switch_core_add_state_handler(const switch_state_handler_table_t *state_handler)
{
int index = runtime.state_handler_index++;
@ -216,7 +216,7 @@ SWITCH_DECLARE(int) switch_core_add_state_handler(const switch_state_handler_tab
return index;
}
SWITCH_DECLARE(const switch_state_handler_table *) switch_core_get_state_handler(int index)
SWITCH_DECLARE(const switch_state_handler_table_t *) switch_core_get_state_handler(int index)
{
if (index > SWITCH_MAX_STATE_HANDLERS || index > runtime.state_handler_index) {
@ -226,24 +226,24 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_core_get_state_handler
return runtime.state_handlers[index];
}
SWITCH_DECLARE(switch_status) switch_core_session_read_lock(switch_core_session *session)
SWITCH_DECLARE(switch_status) switch_core_session_read_lock(switch_core_session_t *session)
{
return (switch_status) switch_thread_rwlock_tryrdlock(session->rwlock);
}
SWITCH_DECLARE(void) switch_core_session_write_lock(switch_core_session *session)
SWITCH_DECLARE(void) switch_core_session_write_lock(switch_core_session_t *session)
{
switch_thread_rwlock_wrlock(session->rwlock);
}
SWITCH_DECLARE(void) switch_core_session_rwunlock(switch_core_session *session)
SWITCH_DECLARE(void) switch_core_session_rwunlock(switch_core_session_t *session)
{
switch_thread_rwlock_unlock(session->rwlock);
}
SWITCH_DECLARE(switch_core_session *) switch_core_session_locate(char *uuid_str)
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(char *uuid_str)
{
switch_core_session *session;
switch_core_session_t *session;
if ((session = switch_core_hash_find(runtime.session_table, uuid_str))) {
/* Acquire a read lock on the session */
if (switch_thread_rwlock_tryrdlock(session->rwlock) != SWITCH_STATUS_SUCCESS) {
@ -256,9 +256,9 @@ SWITCH_DECLARE(switch_core_session *) switch_core_session_locate(char *uuid_str)
return session;
}
SWITCH_DECLARE(switch_status) switch_core_session_message_send(char *uuid_str, switch_core_session_message *message)
SWITCH_DECLARE(switch_status) switch_core_session_message_send(char *uuid_str, switch_core_session_message_t *message)
{
switch_core_session *session = NULL;
switch_core_session_t *session = NULL;
switch_status status = SWITCH_STATUS_FALSE;
if ((session = switch_core_hash_find(runtime.session_table, uuid_str)) != 0) {
@ -276,7 +276,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_message_send(char *uuid_str, s
SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event_t *event)
{
switch_core_session *session = NULL;
switch_core_session_t *session = NULL;
switch_status status = SWITCH_STATUS_FALSE;
if ((session = switch_core_hash_find(runtime.session_table, uuid_str)) != 0) {
@ -292,12 +292,12 @@ SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, swi
return status;
}
SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session *session)
SWITCH_DECLARE(char *) switch_core_session_get_uuid(switch_core_session_t *session)
{
return session->uuid_str;
}
SWITCH_DECLARE(switch_status) switch_core_session_set_read_codec(switch_core_session *session, switch_codec *codec)
SWITCH_DECLARE(switch_status) switch_core_session_set_read_codec(switch_core_session_t *session, switch_codec_t *codec)
{
assert(session != NULL);
@ -305,12 +305,12 @@ SWITCH_DECLARE(switch_status) switch_core_session_set_read_codec(switch_core_ses
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_codec *) switch_core_session_get_read_codec(switch_core_session *session)
SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_read_codec(switch_core_session_t *session)
{
return session->read_codec;
}
SWITCH_DECLARE(switch_status) switch_core_session_set_write_codec(switch_core_session *session, switch_codec *codec)
SWITCH_DECLARE(switch_status) switch_core_session_set_write_codec(switch_core_session_t *session, switch_codec_t *codec)
{
assert(session != NULL);
@ -318,18 +318,18 @@ SWITCH_DECLARE(switch_status) switch_core_session_set_write_codec(switch_core_se
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_codec *) switch_core_session_get_write_codec(switch_core_session *session)
SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_write_codec(switch_core_session_t *session)
{
return session->write_codec;
}
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_t *codec, char *codec_name, uint32_t rate, int ms,
int channels, uint32_t flags,
const switch_codec_settings *codec_settings,
const switch_codec_settings_t *codec_settings,
switch_memory_pool_t *pool)
{
const switch_codec_interface *codec_interface;
const switch_codec_implementation *iptr, *implementation = NULL;
const switch_codec_implementation_t *iptr, *implementation = NULL;
assert(codec != NULL);
assert(codec_name != NULL);
@ -376,8 +376,8 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *
}
SWITCH_DECLARE(switch_status) switch_core_codec_encode(switch_codec *codec,
switch_codec *other_codec,
SWITCH_DECLARE(switch_status) switch_core_codec_encode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
@ -407,8 +407,8 @@ SWITCH_DECLARE(switch_status) switch_core_codec_encode(switch_codec *codec,
}
SWITCH_DECLARE(switch_status) switch_core_codec_decode(switch_codec *codec,
switch_codec *other_codec,
SWITCH_DECLARE(switch_status) switch_core_codec_decode(switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
@ -443,7 +443,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_decode(switch_codec *codec,
}
SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec)
SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec_t *codec)
{
assert(codec != NULL);
@ -461,7 +461,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec)
return SWITCH_STATUS_SUCCESS;
}
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_t *fh, char *file_path, unsigned int flags,
switch_memory_pool_t *pool)
{
char *ext;
@ -491,27 +491,27 @@ SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char
return fh->file_interface->file_open(fh, file_path);
}
SWITCH_DECLARE(switch_status) switch_core_file_read(switch_file_handle *fh, void *data, switch_size_t *len)
SWITCH_DECLARE(switch_status) switch_core_file_read(switch_file_handle_t *fh, void *data, switch_size_t *len)
{
assert(fh != NULL);
return fh->file_interface->file_read(fh, data, len);
}
SWITCH_DECLARE(switch_status) switch_core_file_write(switch_file_handle *fh, void *data, switch_size_t *len)
SWITCH_DECLARE(switch_status) switch_core_file_write(switch_file_handle_t *fh, void *data, switch_size_t *len)
{
assert(fh != NULL);
return fh->file_interface->file_write(fh, data, len);
}
SWITCH_DECLARE(switch_status) switch_core_file_seek(switch_file_handle *fh, unsigned int *cur_pos, int64_t samples,
SWITCH_DECLARE(switch_status) switch_core_file_seek(switch_file_handle_t *fh, unsigned int *cur_pos, int64_t samples,
int whence)
{
return fh->file_interface->file_seek(fh, cur_pos, samples, whence);
}
SWITCH_DECLARE(switch_status) switch_core_file_close(switch_file_handle *fh)
SWITCH_DECLARE(switch_status) switch_core_file_close(switch_file_handle_t *fh)
{
return fh->file_interface->file_close(fh);
}
@ -627,7 +627,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_close(switch_speech_handle *sh,
return sh->speech_interface->speech_close(sh, flags);
}
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_t *timer, char *timer_name, int interval, int samples,
switch_memory_pool_t *pool)
{
switch_timer_interface *timer_interface;
@ -657,7 +657,7 @@ SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *
}
SWITCH_DECLARE(int) switch_core_timer_next(switch_timer *timer)
SWITCH_DECLARE(int) switch_core_timer_next(switch_timer_t *timer)
{
if (!timer->timer_interface) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer is not initilized!\n");
@ -673,7 +673,7 @@ SWITCH_DECLARE(int) switch_core_timer_next(switch_timer *timer)
}
SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer *timer)
SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer_t *timer)
{
if (!timer->timer_interface) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer is not initilized!\n");
@ -691,11 +691,11 @@ SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer *timer)
static void *switch_core_service_thread(switch_thread_t *thread, void *obj)
{
switch_core_thread_session *data = obj;
switch_core_session *session = data->objs[0];
switch_core_thread_session_t *data = obj;
switch_core_session_t *session = data->objs[0];
int *stream_id_p = data->objs[1];
switch_channel *channel;
switch_frame *read_frame;
switch_channel_t *channel;
switch_frame_t *read_frame;
int stream_id = *stream_id_p;
assert(thread != NULL);
@ -722,7 +722,7 @@ static void *switch_core_service_thread(switch_thread_t *thread, void *obj)
}
/* Either add a timeout here or make damn sure the thread cannot get hung somehow (my preference) */
SWITCH_DECLARE(void) switch_core_thread_session_end(switch_core_thread_session *thread_session)
SWITCH_DECLARE(void) switch_core_thread_session_end(switch_core_thread_session_t *thread_session)
{
if (thread_session->running > 0) {
thread_session->running = -1;
@ -733,8 +733,8 @@ SWITCH_DECLARE(void) switch_core_thread_session_end(switch_core_thread_session *
}
}
SWITCH_DECLARE(void) switch_core_service_session(switch_core_session *session,
switch_core_thread_session *thread_session, int stream_id)
SWITCH_DECLARE(void) switch_core_service_session(switch_core_session_t *session,
switch_core_thread_session_t *thread_session, int stream_id)
{
thread_session->running = 1;
thread_session->objs[0] = session;
@ -742,14 +742,14 @@ SWITCH_DECLARE(void) switch_core_service_session(switch_core_session *session,
switch_core_session_launch_thread(session, switch_core_service_thread, thread_session);
}
SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session *session)
SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session_t *session)
{
return session->pool;
}
/* **ONLY** alloc things with this function that **WILL NOT** outlive
the session itself or expect an earth shattering KABOOM!*/
SWITCH_DECLARE(void *) switch_core_session_alloc(switch_core_session *session, switch_size_t memory)
SWITCH_DECLARE(void *) switch_core_session_alloc(switch_core_session_t *session, switch_size_t memory)
{
void *ptr = NULL;
assert(session != NULL);
@ -807,7 +807,7 @@ SWITCH_DECLARE(char *) switch_core_permenant_strdup(char *todup)
}
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session *session, char *todup)
SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session_t *session, char *todup)
{
char *duped = NULL;
switch_size_t len;
@ -852,41 +852,41 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, char *todu
return duped;
}
SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *session)
SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session_t *session)
{
assert(session != NULL);
return session->private_info;
}
SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private_info)
SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session_t *session, void *private_info)
{
assert(session != NULL);
session->private_info = private_info;
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private_info)
SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session_t *session, void *private_info)
{
session->streams[session->stream_count++] = private_info;
return session->stream_count - 1;
}
SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session *session, int index)
SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session_t *session, int index)
{
return session->streams[index];
}
SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session *session)
SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session_t *session)
{
return session->stream_count;
}
SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_session_t *session,
char *endpoint_name,
switch_caller_profile *caller_profile,
switch_core_session **new_session,
switch_caller_profile_t *caller_profile,
switch_core_session_t **new_session,
switch_memory_pool_t *pool)
{
struct switch_io_event_hook_outgoing_channel *ptr;
@ -915,8 +915,8 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s
}
if (*new_session) {
switch_caller_profile *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
switch_channel *channel = NULL, *peer_channel = NULL;
switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
switch_channel_t *channel = NULL, *peer_channel = NULL;
if (session && (channel = switch_core_session_get_channel(session)) != 0) {
profile = switch_channel_get_caller_profile(channel);
@ -942,7 +942,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s
return status;
}
SWITCH_DECLARE(switch_status) switch_core_session_answer_channel(switch_core_session *session)
SWITCH_DECLARE(switch_status) switch_core_session_answer_channel(switch_core_session_t *session)
{
struct switch_io_event_hook_answer_channel *ptr;
switch_status status = SWITCH_STATUS_FALSE;
@ -963,8 +963,8 @@ SWITCH_DECLARE(switch_status) switch_core_session_answer_channel(switch_core_ses
return status;
}
SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_session *session,
switch_core_session_message *message)
SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_session_t *session,
switch_core_session_message_t *message)
{
struct switch_io_event_hook_receive_message *ptr;
switch_status status = SWITCH_STATUS_FALSE;
@ -984,7 +984,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_se
return status;
}
SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event_t *event)
SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session_t *session, switch_event_t *event)
{
struct switch_io_event_hook_queue_event *ptr;
@ -1013,7 +1013,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_sessio
return status;
}
SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session *session, switch_frame **frame,
SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame,
int timeout, int stream_id)
{
struct switch_io_event_hook_read_frame *ptr;
@ -1067,7 +1067,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session
}
if (status == SWITCH_STATUS_SUCCESS && need_codec) {
switch_frame *enc_frame, *read_frame = *frame;
switch_frame_t *enc_frame, *read_frame = *frame;
if (read_frame->codec) {
unsigned int flag = 0;
@ -1183,7 +1183,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_read_frame(switch_core_session
return status;
}
static switch_status perform_write(switch_core_session *session, switch_frame *frame, int timeout, switch_io_flag flags, int stream_id)
static switch_status perform_write(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag flags, int stream_id)
{
struct switch_io_event_hook_write_frame *ptr;
switch_status status = SWITCH_STATUS_FALSE;
@ -1202,12 +1202,12 @@ static switch_status perform_write(switch_core_session *session, switch_frame *f
return status;
}
SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_session *session, switch_frame *frame,
SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_session_t *session, switch_frame_t *frame,
int timeout, int stream_id)
{
switch_status status = SWITCH_STATUS_FALSE;
switch_frame *enc_frame = NULL, *write_frame = frame;
switch_frame_t *enc_frame = NULL, *write_frame = frame;
unsigned int flag = 0, need_codec = 0, perfect = 0;
switch_io_flag io_flag = SWITCH_IO_FLAG_NOOP;
@ -1439,7 +1439,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_sessio
return status;
}
SWITCH_DECLARE(switch_status) switch_core_session_perform_kill_channel(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_perform_kill_channel(switch_core_session_t *session,
const char *file,
const char *func,
int line,
@ -1464,7 +1464,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_perform_kill_channel(switch_co
}
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_read(switch_core_session *session, int timeout, int stream_id)
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_read(switch_core_session_t *session, int timeout, int stream_id)
{
struct switch_io_event_hook_waitfor_read *ptr;
switch_status status = SWITCH_STATUS_FALSE;
@ -1485,7 +1485,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_waitfor_read(switch_core_sessi
}
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_write(switch_core_session *session, int timeout,
SWITCH_DECLARE(switch_status) switch_core_session_waitfor_write(switch_core_session_t *session, int timeout,
int stream_id)
{
struct switch_io_event_hook_waitfor_write *ptr;
@ -1507,7 +1507,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_waitfor_write(switch_core_sess
}
SWITCH_DECLARE(switch_status) switch_core_session_send_dtmf(switch_core_session *session, char *dtmf)
SWITCH_DECLARE(switch_status) switch_core_session_send_dtmf(switch_core_session_t *session, char *dtmf)
{
struct switch_io_event_hook_send_dtmf *ptr;
switch_status status = SWITCH_STATUS_FALSE;
@ -1525,7 +1525,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_send_dtmf(switch_core_session
return status;
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_outgoing(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_outgoing(switch_core_session_t *session,
switch_outgoing_channel_hook outgoing_channel)
{
switch_io_event_hook_outgoing_channel *hook, *ptr;
@ -1547,7 +1547,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_outgoing(switch
return SWITCH_STATUS_MEMERR;
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_answer_channel(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_answer_channel(switch_core_session_t *session,
switch_answer_channel_hook
answer_channel)
{
@ -1571,7 +1571,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_answer_channel(
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_read_frame(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_read_frame(switch_core_session_t *session,
switch_read_frame_hook read_frame)
{
switch_io_event_hook_read_frame *hook, *ptr;
@ -1594,7 +1594,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_read_frame(swit
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_write_frame(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_write_frame(switch_core_session_t *session,
switch_write_frame_hook write_frame)
{
switch_io_event_hook_write_frame *hook, *ptr;
@ -1617,7 +1617,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_write_frame(swi
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_kill_channel(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_kill_channel(switch_core_session_t *session,
switch_kill_channel_hook kill_channel)
{
switch_io_event_hook_kill_channel *hook, *ptr;
@ -1640,7 +1640,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_kill_channel(sw
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_read(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_read(switch_core_session_t *session,
switch_waitfor_read_hook waitfor_read)
{
switch_io_event_hook_waitfor_read *hook, *ptr;
@ -1663,7 +1663,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_read(sw
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_write(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_write(switch_core_session_t *session,
switch_waitfor_write_hook waitfor_write)
{
switch_io_event_hook_waitfor_write *hook, *ptr;
@ -1687,7 +1687,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_waitfor_write(s
}
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switch_core_session_t *session,
switch_send_dtmf_hook send_dtmf)
{
switch_io_event_hook_send_dtmf *hook, *ptr;
@ -1729,28 +1729,28 @@ SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_channel *) switch_core_session_get_channel(switch_core_session *session)
SWITCH_DECLARE(switch_channel_t *) switch_core_session_get_channel(switch_core_session_t *session)
{
return session->channel;
}
static void switch_core_standard_on_init(switch_core_session *session)
static void switch_core_standard_on_init(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard INIT %s\n", switch_channel_get_name(session->channel));
}
static void switch_core_standard_on_hangup(switch_core_session *session)
static void switch_core_standard_on_hangup(switch_core_session_t *session)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HANGUP %s\n", switch_channel_get_name(session->channel));
}
static void switch_core_standard_on_ring(switch_core_session *session)
static void switch_core_standard_on_ring(switch_core_session_t *session)
{
switch_dialplan_interface *dialplan_interface = NULL;
switch_caller_profile *caller_profile;
switch_caller_extension *extension;
switch_caller_profile_t *caller_profile;
switch_caller_extension_t *extension;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard RING %s\n", switch_channel_get_name(session->channel));
@ -1776,9 +1776,9 @@ 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_t *session)
{
switch_caller_extension *extension;
switch_caller_extension_t *extension;
switch_event_t *event;
const switch_application_interface *application_interface;
@ -1825,9 +1825,9 @@ static void switch_core_standard_on_execute(switch_core_session *session)
}
}
static void switch_core_standard_on_loopback(switch_core_session *session)
static void switch_core_standard_on_loopback(switch_core_session_t *session)
{
switch_frame *frame;
switch_frame_t *frame;
int stream_id;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard LOOPBACK\n");
@ -1841,24 +1841,24 @@ static void switch_core_standard_on_loopback(switch_core_session *session)
}
}
static void switch_core_standard_on_transmit(switch_core_session *session)
static void switch_core_standard_on_transmit(switch_core_session_t *session)
{
assert(session != NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard TRANSMIT\n");
}
static void switch_core_standard_on_hold(switch_core_session *session)
static void switch_core_standard_on_hold(switch_core_session_t *session)
{
assert(session != NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard HOLD\n");
}
SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session *session)
SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session)
{
switch_thread_cond_signal(session->cond);
}
SWITCH_DECLARE(unsigned int) switch_core_session_runing(switch_core_session *session)
SWITCH_DECLARE(unsigned int) switch_core_session_runing(switch_core_session_t *session)
{
return session->thread_running;
}
@ -1913,12 +1913,12 @@ static int handle_fatality(int sig)
}
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
{
switch_channel_state state = CS_NEW, laststate = CS_HANGUP, midstate = CS_DONE;
const switch_endpoint_interface *endpoint_interface;
const switch_state_handler_table *driver_state_handler = NULL;
const switch_state_handler_table *application_state_handler = NULL;
const switch_state_handler_table_t *driver_state_handler = NULL;
const switch_state_handler_table_t *application_state_handler = NULL;
switch_thread_id_t thread_id = switch_thread_self();
jmp_buf env;
int sig;
@ -2256,7 +2256,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session)
session->thread_running = 0;
}
SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session)
SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session_t **session)
{
switch_memory_pool_t *pool;
switch_event_t *event;
@ -2333,7 +2333,7 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL;
switch_core_thread_session *ts;
switch_core_thread_session_t *ts;
int mypool;
mypool = pool ? 0 : 1;
@ -2361,7 +2361,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_t *thread, void *obj)
{
switch_core_session *session = obj;
switch_core_session_t *session = obj;
session->thread = thread;
session->id = runtime.session_id++;
@ -2381,7 +2381,7 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thre
}
SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *session)
SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session_t *session)
{
switch_thread_t *thread;
switch_threadattr_t *thd_attr;;
@ -2396,7 +2396,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_t *session, switch_thread_start_t func,
void *obj)
{
switch_thread_t *thread;
@ -2426,11 +2426,11 @@ SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size
return ptr;
}
SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface,
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface,
switch_memory_pool_t *pool)
{
switch_memory_pool_t *usepool;
switch_core_session *session;
switch_core_session_t *session;
switch_uuid_t uuid;
assert(endpoint_interface != NULL);
@ -2442,7 +2442,7 @@ SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_e
return NULL;
}
if ((session = switch_core_alloc(usepool, sizeof(switch_core_session))) == 0) {
if ((session = switch_core_alloc(usepool, sizeof(switch_core_session_t))) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate session\n");
apr_pool_destroy(usepool);
return NULL;
@ -2483,7 +2483,7 @@ SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_e
return session;
}
SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t *pool)
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t *pool)
{
const switch_endpoint_interface *endpoint_interface;
@ -2760,7 +2760,7 @@ SWITCH_DECLARE(switch_status) switch_core_init(char *console)
switch_log_init(runtime.memory_pool);
switch_core_sql_thread_launch();
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Allocated memory pool. Sessions are %u bytes\n", sizeof(struct switch_core_session));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Allocated memory pool. Sessions are %u bytes\n", sizeof(switch_core_session_t));
switch_event_init(runtime.memory_pool);
switch_rtp_init(runtime.memory_pool);

View File

@ -29,10 +29,10 @@
* switch_event.c -- Event System
*
*/
#include <switch_event.h>
#include <switch.h>
#include <switch_event.h>
static switch_event_node *EVENT_NODES[SWITCH_EVENT_ALL + 1] = { NULL };
static switch_event_node_t *EVENT_NODES[SWITCH_EVENT_ALL + 1] = { NULL };
static switch_mutex_t *BLOCK = NULL;
static switch_mutex_t *POOL_LOCK = NULL;
static switch_memory_pool_t *RUNTIME_POOL = NULL;
@ -114,7 +114,7 @@ static char *EVENT_NAMES[] = {
};
static int switch_events_match(switch_event_t *event, switch_event_node *node)
static int switch_events_match(switch_event_t *event, switch_event_node_t *node)
{
int match = 0;
@ -214,7 +214,7 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, voi
SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event)
{
switch_event_types_t e;
switch_event_node *node;
switch_event_node_t *node;
for (e = (*event)->event_id;; e = SWITCH_EVENT_ALL) {
for (node = EVENT_NODES[e]; node; node = node->next) {
@ -249,7 +249,7 @@ SWITCH_DECLARE(char *) switch_event_name(switch_event_types_t event)
SWITCH_DECLARE(switch_status) switch_event_reserve_subclass_detailed(char *owner, char *subclass_name)
{
switch_event_subclass *subclass;
switch_event_subclass_t *subclass;
assert(RUNTIME_POOL != NULL);
assert(CUSTOM_HASH != NULL);
@ -582,8 +582,8 @@ SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func,
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_node *event_node;
switch_event_subclass *subclass = NULL;
switch_event_node_t *event_node;
switch_event_subclass_t *subclass = NULL;
assert(BLOCK != NULL);
assert(RUNTIME_POOL != NULL);
@ -599,7 +599,7 @@ SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_types_t e
}
}
if (event <= SWITCH_EVENT_ALL && (event_node = switch_core_alloc(RUNTIME_POOL, sizeof(switch_event_node))) != 0) {
if (event <= SWITCH_EVENT_ALL && (event_node = switch_core_alloc(RUNTIME_POOL, sizeof(switch_event_node_t))) != 0) {
switch_mutex_lock(BLOCK);
/* <LOCKED> ----------------------------------------------- */
event_node->id = switch_core_strdup(RUNTIME_POOL, id);

View File

@ -32,15 +32,15 @@
#include <switch.h>
#include <switch_ivr.h>
static const switch_state_handler_table audio_bridge_peer_state_handlers;
static const switch_state_handler_table_t audio_bridge_peer_state_handlers;
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_callback(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_callback(switch_core_session_t *session,
switch_dtmf_callback_function dtmf_callback,
void *buf,
unsigned int buflen)
{
switch_channel *channel;
switch_channel_t *channel;
switch_status status = SWITCH_STATUS_SUCCESS;
channel = switch_core_session_get_channel(session);
@ -51,7 +51,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_callback(switch_core_ses
}
while(switch_channel_ready(channel)) {
switch_frame *read_frame;
switch_frame_t *read_frame;
char dtmf[128];
if (switch_channel_has_dtmf(channel)) {
@ -74,7 +74,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_callback(switch_core_ses
}
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_session_t *session,
char *buf,
unsigned int buflen,
unsigned int maxdigits,
@ -85,7 +85,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_sessio
)
{
unsigned int i = 0, x = (unsigned int) strlen(buf);
switch_channel *channel;
switch_channel_t *channel;
switch_status status = SWITCH_STATUS_SUCCESS;
switch_time_t started = 0;
unsigned int elapsed;
@ -109,7 +109,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_sessio
}
while(switch_channel_ready(channel)) {
switch_frame *read_frame;
switch_frame_t *read_frame;
if (timeout) {
elapsed = (unsigned int)((switch_time_now() - started) / 1000);
@ -152,18 +152,18 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_sessio
SWITCH_DECLARE(switch_status) switch_ivr_record_file(switch_core_session *session,
switch_file_handle *fh,
SWITCH_DECLARE(switch_status) switch_ivr_record_file(switch_core_session_t *session,
switch_file_handle_t *fh,
char *file,
switch_dtmf_callback_function dtmf_callback,
void *buf,
unsigned int buflen)
{
switch_channel *channel;
switch_channel_t *channel;
char dtmf[128];
switch_file_handle lfh;
switch_frame *read_frame;
switch_codec codec, *read_codec;
switch_file_handle_t lfh;
switch_frame_t *read_frame;
switch_codec_t codec, *read_codec;
char *codec_name;
switch_status status = SWITCH_STATUS_SUCCESS;
@ -250,30 +250,30 @@ SWITCH_DECLARE(switch_status) switch_ivr_record_file(switch_core_session *sessio
return status;
}
SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session,
switch_file_handle *fh,
SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session_t *session,
switch_file_handle_t *fh,
char *file,
char *timer_name,
switch_dtmf_callback_function dtmf_callback,
void *buf,
unsigned int buflen)
{
switch_channel *channel;
switch_channel_t *channel;
short abuf[960];
char dtmf[128];
uint32_t interval = 0, samples = 0;
uint32_t len = 0, ilen = 0;
switch_size_t olen = 0;
switch_frame write_frame = {0};
switch_timer timer;
switch_core_thread_session thread_session;
switch_codec codec;
switch_frame_t write_frame = {0};
switch_timer_t timer;
switch_core_thread_session_t thread_session;
switch_codec_t codec;
switch_memory_pool_t *pool = switch_core_session_get_pool(session);
char *codec_name;
int stream_id;
switch_status status = SWITCH_STATUS_SUCCESS;
switch_file_handle lfh;
switch_codec *read_codec = switch_core_session_get_read_codec(session);
switch_file_handle_t lfh;
switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
if (!fh) {
fh = &lfh;
@ -453,7 +453,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session,
break;
}
} else { /* time off the channel (if you must) */
switch_frame *read_frame;
switch_frame_t *read_frame;
switch_status status;
while (switch_channel_test_flag(channel, CF_HOLD)) {
switch_yield(10000);
@ -481,7 +481,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session,
SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session_t *session,
char *tts_name,
char *voice_name,
char *timer_name,
@ -491,17 +491,17 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session
void *buf,
unsigned int buflen)
{
switch_channel *channel;
switch_channel_t *channel;
short abuf[960];
char dtmf[128];
int interval = 0;
uint32_t samples = 0;
uint32_t len = 0;
switch_size_t ilen = 0;
switch_frame write_frame = {0};
switch_timer timer;
switch_core_thread_session thread_session;
switch_codec codec;
switch_frame_t write_frame = {0};
switch_timer_t timer;
switch_core_thread_session_t thread_session;
switch_codec_t codec;
switch_memory_pool_t *pool = switch_core_session_get_pool(session);
char *codec_name;
int x;
@ -664,7 +664,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session
break;
}
} else { /* time off the channel (if you must) */
switch_frame *read_frame;
switch_frame_t *read_frame;
switch_status status = switch_core_session_read_frame(session, &read_frame, -1, 0);
while (switch_channel_test_flag(channel, CF_HOLD)) {
@ -695,23 +695,23 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session
/* Bridge Related Stuff*/
/*********************************************************************************/
struct audio_bridge_data {
switch_core_session *session_a;
switch_core_session *session_b;
switch_core_session_t *session_a;
switch_core_session_t *session_b;
int running;
};
static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
{
struct switch_core_thread_session *his_thread, *data = obj;
switch_core_thread_session_t *his_thread, *data = obj;
int *stream_id_p;
int stream_id = 0, ans_a = 0, ans_b = 0;
switch_dtmf_callback_function dtmf_callback;
switch_core_session_message msg = {0};
switch_core_session_message_t msg = {0};
void *user_data;
switch_channel *chan_a, *chan_b;
switch_frame *read_frame;
switch_core_session *session_a, *session_b;
switch_channel_t *chan_a, *chan_b;
switch_frame_t *read_frame;
switch_core_session_t *session_a, *session_b;
assert(!thread || thread);
@ -825,9 +825,9 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
return NULL;
}
static switch_status audio_bridge_on_loopback(switch_core_session *session)
static switch_status audio_bridge_on_loopback(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
void *arg;
channel = switch_core_session_get_channel(session);
@ -845,9 +845,9 @@ static switch_status audio_bridge_on_loopback(switch_core_session *session)
}
static switch_status audio_bridge_on_ring(switch_core_session *session)
static switch_status audio_bridge_on_ring(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -859,9 +859,9 @@ static switch_status audio_bridge_on_ring(switch_core_session *session)
return SWITCH_STATUS_FALSE;
}
static switch_status audio_bridge_on_hold(switch_core_session *session)
static switch_status audio_bridge_on_hold(switch_core_session_t *session)
{
switch_channel *channel = NULL;
switch_channel_t *channel = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@ -872,7 +872,7 @@ static switch_status audio_bridge_on_hold(switch_core_session *session)
return SWITCH_STATUS_FALSE;
}
static const switch_state_handler_table audio_bridge_peer_state_handlers = {
static const switch_state_handler_table_t audio_bridge_peer_state_handlers = {
/*.on_init */ NULL,
/*.on_ring */ audio_bridge_on_ring,
/*.on_execute */ NULL,
@ -883,8 +883,8 @@ static const switch_state_handler_table audio_bridge_peer_state_handlers = {
};
SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_session *session,
switch_core_session *peer_session,
SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_session_t *session,
switch_core_session_t *peer_session,
unsigned int timelimit,
switch_dtmf_callback_function dtmf_callback,
void *session_data,
@ -893,11 +893,11 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
{
struct switch_core_thread_session *this_audio_thread, *other_audio_thread;
switch_channel *caller_channel, *peer_channel;
switch_core_thread_session_t *this_audio_thread, *other_audio_thread;
switch_channel_t *caller_channel, *peer_channel;
time_t start;
int stream_id = 0;
switch_frame *read_frame = NULL;
switch_frame_t *read_frame = NULL;
switch_status status = SWITCH_STATUS_SUCCESS;
@ -909,8 +909,8 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
peer_channel = switch_core_session_get_channel(peer_session);
assert(peer_channel != NULL);
other_audio_thread = switch_core_session_alloc(peer_session, sizeof(switch_core_thread_session));
this_audio_thread = switch_core_session_alloc(peer_session, sizeof(switch_core_thread_session));
other_audio_thread = switch_core_session_alloc(peer_session, sizeof(switch_core_thread_session_t));
this_audio_thread = switch_core_session_alloc(peer_session, sizeof(switch_core_thread_session_t));
other_audio_thread->objs[0] = session;
other_audio_thread->objs[1] = peer_session;
@ -989,7 +989,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)) {
switch_event_t *event;
switch_core_session_message msg = {0};
switch_core_session_message_t msg = {0};
switch_channel_set_state(peer_channel, CS_HOLD);
@ -1043,10 +1043,10 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
SWITCH_DECLARE(switch_status) switch_ivr_session_transfer(switch_core_session *session, char *extension, char *dialplan, char *context)
SWITCH_DECLARE(switch_status) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context)
{
switch_channel *channel;
switch_caller_profile *profile, *new_profile;
switch_channel_t *channel;
switch_caller_profile_t *profile, *new_profile;
assert(session != NULL);
assert(extension != NULL);

View File

@ -62,8 +62,8 @@ static void *switch_loadable_module_exec(switch_thread_t *thread, void *obj)
switch_status status = SWITCH_STATUS_SUCCESS;
switch_core_thread_session *ts = obj;
switch_loadable_module *module = ts->objs[0];
switch_core_thread_session_t *ts = obj;
switch_loadable_module_t *module = ts->objs[0];
int restarts;
assert(thread != NULL);
@ -87,7 +87,7 @@ static void *switch_loadable_module_exec(switch_thread_t *thread, void *obj)
static switch_status switch_loadable_module_process(char *key, switch_loadable_module *new_module)
static switch_status switch_loadable_module_process(char *key, switch_loadable_module_t *new_module)
{
@ -102,7 +102,7 @@ static switch_status switch_loadable_module_process(char *key, switch_loadable_m
}
if (new_module->interface->codec_interface) {
const switch_codec_implementation *impl;
const switch_codec_implementation_t *impl;
const switch_codec_interface *ptr;
for (ptr = new_module->interface->codec_interface; ptr; ptr = ptr->next) {
@ -190,9 +190,9 @@ static switch_status switch_loadable_module_process(char *key, switch_loadable_m
}
static switch_status switch_loadable_module_load_file(char *filename, switch_loadable_module **new_module)
static switch_status switch_loadable_module_load_file(char *filename, switch_loadable_module_t **new_module)
{
switch_loadable_module *module = NULL;
switch_loadable_module_t *module = NULL;
apr_dso_handle_t *dso = NULL;
apr_status_t status = SWITCH_STATUS_SUCCESS;
apr_dso_handle_sym_t function_handle = NULL;
@ -228,7 +228,7 @@ static switch_status switch_loadable_module_load_file(char *filename, switch_loa
break;
}
if ((module = switch_core_permenant_alloc(sizeof(switch_loadable_module))) == 0) {
if ((module = switch_core_permenant_alloc(sizeof(switch_loadable_module_t))) == 0) {
err = "Could not allocate memory\n";
break;
}
@ -271,7 +271,7 @@ SWITCH_DECLARE(switch_status) switch_loadable_module_load_module(char *dir, char
switch_size_t len = 0;
char *path;
char *file;
switch_loadable_module *new_module = NULL;
switch_loadable_module_t *new_module = NULL;
switch_status status;
#ifdef WIN32
@ -317,13 +317,13 @@ SWITCH_DECLARE(switch_status) switch_loadable_module_build_dynamic(char *filenam
switch_module_runtime_t switch_module_runtime,
switch_module_shutdown_t switch_module_shutdown)
{
switch_loadable_module *module = NULL;
switch_loadable_module_t *module = NULL;
switch_module_load_t load_func_ptr = NULL;
int loading = 1;
const char *err = NULL;
switch_loadable_module_interface *interface = NULL;
if ((module = switch_core_permenant_alloc(sizeof(switch_loadable_module))) == 0) {
if ((module = switch_core_permenant_alloc(sizeof(switch_loadable_module_t))) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Couldn't allocate memory\n");
return SWITCH_STATUS_GENERR;
}
@ -342,7 +342,7 @@ SWITCH_DECLARE(switch_status) switch_loadable_module_build_dynamic(char *filenam
break;
}
if ((module = switch_core_permenant_alloc(sizeof(switch_loadable_module))) == 0) {
if ((module = switch_core_permenant_alloc(sizeof(switch_loadable_module_t))) == 0) {
err = "Could not allocate memory\n";
break;
}
@ -398,7 +398,7 @@ SWITCH_DECLARE(switch_status) switch_loadable_module_init()
apr_int32_t finfo_flags = APR_FINFO_DIRENT | APR_FINFO_TYPE | APR_FINFO_NAME;
char *cf = "modules.conf";
char *var, *val;
switch_config cfg;
switch_config_t cfg;
unsigned char all = 0;
unsigned int count = 0;
@ -506,11 +506,11 @@ SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
{
switch_hash_index_t *hi;
void *val;
switch_loadable_module *module;
switch_loadable_module_t *module;
for (hi = switch_hash_first(loadable_modules.pool, loadable_modules.module_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
module = (switch_loadable_module *) val;
module = (switch_loadable_module_t *) val;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Checking %s\t", module->interface->module_name);
if (module->switch_module_shutdown) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "(yes)\n");

View File

@ -29,8 +29,8 @@
* switch_caller.c -- Caller Identification
*
*/
#include <switch_resample.h>
#include <switch.h>
#include <switch_resample.h>
#include <libresample.h>
#define NORMFACT (float)0x8000
#define MAXSAMPLE (float)0x7FFF

View File

@ -59,9 +59,9 @@ typedef struct {
struct switch_rtp_vad_data {
switch_core_session *session;
switch_codec vad_codec;
switch_codec *read_codec;
switch_core_session_t *session;
switch_codec_t vad_codec;
switch_codec_t *read_codec;
uint32_t bg_level;
uint32_t bg_count;
uint32_t bg_len;
@ -111,7 +111,7 @@ struct switch_rtp {
uint32_t ms_per_packet;
uint32_t remote_port;
uint8_t stuncount;
switch_buffer *packet_buffer;
switch_buffer_t *packet_buffer;
struct switch_rtp_vad_data vad_data;
};
@ -625,7 +625,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp_t *rtp_session, void *d
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame *frame)
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame_t *frame)
{
int bytes = rtp_common_read(rtp_session, &frame->payload, &frame->flags);
@ -779,7 +779,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_TALK)) {
switch_event_t *event;
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_t *channel = switch_core_session_get_channel(rtp_session->vad_data.session);
switch_channel_event_set_data(channel, event);
switch_event_fire(&event);
}
@ -796,7 +796,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data
if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_NOTALK)) {
switch_event_t *event;
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_t *channel = switch_core_session_get_channel(rtp_session->vad_data.session);
switch_channel_event_set_data(channel, event);
switch_event_fire(&event);
}
@ -852,7 +852,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp_t *rtp_session)
return SWITCH_STATUS_SUCCESS;
}
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)
SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session_t *session, switch_codec_t *codec, switch_vad_flag_t flags)
{
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD)) {
return SWITCH_STATUS_GENERR;
@ -907,7 +907,7 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint
}
SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame *frame, uint32_t ts)
SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame_t *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 packetize = (rtp_session->packet_size > frame->datalen && (frame->payload == rtp_session->payload)) ? 1 : 0;