* \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
/*! 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;
};
/*!
\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
);
\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);
\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,
\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
\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
\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,
\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
\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
\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
\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);
\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);
/*!
\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
\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
\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
\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);
-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);
\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
\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
\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
\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,
\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
\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
\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
\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
/*!
\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
/*! 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;
\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
\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);
///\}
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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);
/*!
\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
\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
\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
\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
\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
\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,
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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);
/*!
\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,
\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,
\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
\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
\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
\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
\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
\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
\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
/*! 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 */
/*! 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 */
/*! \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 */
\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);
\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,
\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,
\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,
\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,
\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,
\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);
/** @} */
\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
/*! \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
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;
/*! 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;
};
/*! 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;
/*! 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;
};
/*! 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*/
/*! 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,
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,
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;
};
/*! 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;
};
\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
\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
\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
} 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
SWITCH_MESSAGE_INDICATE_PROGRESS,
SWITCH_MESSAGE_INDICATE_BRIDGE,
SWITCH_MESSAGE_INDICATE_UNBRIDGE
-} switch_core_session_message_t;
+} switch_core_session_message_types_t;
/*!
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;
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);
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);
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);
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;
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;
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);
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);
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);
}
-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);
}
-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);
}
-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);
}
-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];
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] = "";
}
-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);
}
-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,
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);
}
-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;
}
-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);
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;
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;
}
-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,
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,
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;
}
-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,
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,
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;
}
#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,
};
-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,
};
#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,
/*.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,
};
-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,
};
-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;
}
-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;
-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,
-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,
/* 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,
/*.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,
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;
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);
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)
{
}
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)
{
/* 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,
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;
}
-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,
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,
/* 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,
/*.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,
};
-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,
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;
}
}
-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,
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,
}
-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,
/*.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,
/*.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,
/*.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,
};
-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,
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,
};
struct speex_context {
- switch_codec *codec;
+ switch_codec_t *codec;
unsigned int flags;
/* Encoder */
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;
}
}
-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,
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,
}
-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;
}
/* 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,
/*.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,
/*.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,
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];
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)) {
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;
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;
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];
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);
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;
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)) {
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)) {
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;
}
-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;
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);
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);
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);
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);
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))) {
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;
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;
}
-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;
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;
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;
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);
}
-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);
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,
/* 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;
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;
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);
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;
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);
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;
}
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;
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;
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);
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);
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;
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;
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);
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);
}
-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;
}
-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;
-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);
}
-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);
}
-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);
}
-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;
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);
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);
/*.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,
/*.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 =
if (outbound_profile) {
char name[128];
- switch_caller_profile *caller_profile = NULL;
+ switch_caller_profile_t *caller_profile = NULL;
if (*outbound_profile->destination_number == '!') {
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;
if (num_codecs > 0) {
int i;
- static const switch_codec_implementation *imp;
+ static const switch_codec_implementation_t *imp;
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) {
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) {
static int config_exosip(int reload)
{
- switch_config cfg;
+ switch_config_t cfg;
char *var, *val;
char *cf = "exosip.conf";
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;
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;
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)
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);
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);
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);
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);
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);
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;
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;
}
-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;
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;
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);
}
-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);
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,
/* 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;
static switch_status load_config(void)
{
- switch_config cfg;
+ switch_config_t cfg;
char *var, *val;
char *cf = "iax.conf";
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",
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 =
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);
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;
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) {
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;
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);
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);
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);
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);
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);
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);
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;
}
-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;
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;
}
-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;
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;
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);
}
-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);
/*.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,
/* 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 =
static switch_status load_config(void)
{
- switch_config cfg;
+ switch_config_t cfg;
char *var, *val;
char *cf = "portaudio.conf";
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);
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) {
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) {
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")) {
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) {
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);
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);
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;
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;
};
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);
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;
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);
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);
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);
}
-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);
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;
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;
// 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);
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);
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,
/* 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 =
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);
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;
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");
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);
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";
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";
{
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++;
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";
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";
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;
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;
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;
}
-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;
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;
}
-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];
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")) {
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)) {
};
struct js_session {
- switch_core_session *session;
+ switch_core_session_t *session;
JSContext *cx;
JSObject *obj;
unsigned int flags;
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;
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;
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;
}
-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;
}
-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;
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);
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;
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);
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};
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);
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);
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;
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);
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);
};
-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))) {
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;
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);
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;
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)) {
}
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;
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];
static switch_status config_logger(void)
{
- switch_config cfg;
+ switch_config_t cfg;
char *var, *val;
char *cf = "console.conf";
#endif
};
-static switch_status soft_timer_init(switch_timer *timer)
+static switch_status soft_timer_init(switch_timer_t *timer)
{
struct timer_private *private;
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;
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;
* switch_buffer.c -- Data Buffering Code
*
*/
-#include <switch_buffer.h>
#include <switch.h>
+#include <switch_buffer.h>
static uint32_t buffer_id = 0;
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++;
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);
}
-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;
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;
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;
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);
* 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,
{
- 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";
}
}
-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);
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];
}
-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;
}
-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) {
* switch_channel.c -- Media Channel Interface
*
*/
-#include <switch_channel.h>
#include <switch.h>
+#include <switch_channel.h>
struct switch_cause_table {
const char *name;
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;
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;
}
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)
{
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) {
}
-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;
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;
}
-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;
}
-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);
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;
}
-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);
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;
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,
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;
}
-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;
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);
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);
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);
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);
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);
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;
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);
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);
}
-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);
}
-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,
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;
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)
* 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;
}
-SWITCH_DECLARE(void) switch_config_close_file(switch_config *cfg)
+SWITCH_DECLARE(void) switch_config_close_file(switch_config_t *cfg)
{
if (cfg->file) {
-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;
* 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)
*
*/
-#include <stdio.h>
#include <switch.h>
+#include <stdio.h>
//#define DEBUG_ALLOC
#define SWITCH_EVENT_QUEUE_LEN 256
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];
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;
/* 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 */
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++;
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) {
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) {
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) {
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) {
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);
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);
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);
}
-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,
}
-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,
}
-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);
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;
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);
}
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;
}
-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");
}
-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");
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);
}
/* 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;
}
}
-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;
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);
}
-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;
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;
}
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);
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;
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;
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;
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;
}
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;
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;
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;
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,
}
-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;
}
-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;
}
-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;
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;
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)
{
}
-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;
}
-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;
}
-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;
}
-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;
}
-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;
}
-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;
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));
}
}
-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;
}
}
-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");
}
}
-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;
}
}
-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;
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;
{
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;
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++;
}
-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;;
}
}
-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;
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);
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;
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;
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);
* 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;
};
-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;
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) {
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);
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);
}
}
- 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);
#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);
}
while(switch_channel_ready(channel)) {
- switch_frame *read_frame;
+ switch_frame_t *read_frame;
char dtmf[128];
if (switch_channel_has_dtmf(channel)) {
}
-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,
)
{
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;
}
while(switch_channel_ready(channel)) {
- switch_frame *read_frame;
+ switch_frame_t *read_frame;
if (timeout) {
elapsed = (unsigned int)((switch_time_now() - started) / 1000);
-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;
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;
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);
-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,
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;
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)) {
/* 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);
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);
}
-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);
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);
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,
};
-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,
{
- 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;
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;
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);
-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);
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);
-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)
{
}
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) {
}
-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;
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;
}
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
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;
}
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;
}
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;
{
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");
* 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
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;
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;
};
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);
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);
}
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);
}
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;
}
-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;