mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
code analysis, clean up asserts related to switch_core_session_get_channel.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7402 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -97,28 +97,28 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(
|
||||
\param str the string to check
|
||||
\return the code
|
||||
*/
|
||||
SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str);
|
||||
SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(_In_ const char *str);
|
||||
|
||||
/*!
|
||||
\brief return the cause code for a given channel
|
||||
\param channel the channel
|
||||
\return the code
|
||||
*/
|
||||
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(_In_ switch_channel_t *channel);
|
||||
|
||||
/*!
|
||||
\brief return a cause string for a given cause
|
||||
\param cause the code to check
|
||||
\return the string
|
||||
*/
|
||||
SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause);
|
||||
SWITCH_DECLARE(const char *) switch_channel_cause2str(_In_ switch_call_cause_t cause);
|
||||
|
||||
/*!
|
||||
\brief View the timetable of a channel
|
||||
\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_t *channel);
|
||||
SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(_In_ switch_channel_t *channel);
|
||||
|
||||
/*!
|
||||
\brief Allocate a new channel
|
||||
@@ -126,7 +126,7 @@ SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch
|
||||
\param pool memory_pool to use for allocation
|
||||
\return SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_alloc(_In_ switch_channel_t **channel, _In_ switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
\brief Connect a newly allocated channel to a session object and setup it's initial state
|
||||
@@ -418,7 +418,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
|
||||
\param channel channel to test
|
||||
\return number of digits in the queue
|
||||
*/
|
||||
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(_In_ switch_channel_t *channel);
|
||||
|
||||
/*!
|
||||
\brief Queue DTMF on a given channel
|
||||
@@ -426,8 +426,8 @@ SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel)
|
||||
\param dtmf digit
|
||||
\return SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *channel, const switch_dtmf_t *dtmf);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_t *channel, const char *dtmf_string);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(_In_ switch_channel_t *channel, _In_ const switch_dtmf_t *dtmf);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(_In_ switch_channel_t *channel, _In_ const char *dtmf_string);
|
||||
|
||||
/*!
|
||||
\brief Retrieve DTMF digits from a given channel
|
||||
@@ -435,30 +435,30 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(switch_channel_
|
||||
\param dtmf digit
|
||||
\return number of bytes read into the buffer
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_dequeue_dtmf(switch_channel_t *channel, switch_dtmf_t *dtmf);
|
||||
SWITCH_DECLARE(void) switch_channel_flush_dtmf(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf_string(switch_channel_t *channel, char *dtmf_str, switch_size_t len);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_dequeue_dtmf(_In_ switch_channel_t *channel, _In_ switch_dtmf_t *dtmf);
|
||||
SWITCH_DECLARE(void) switch_channel_flush_dtmf(_In_ switch_channel_t *channel);
|
||||
SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf_string(_In_ switch_channel_t *channel, _Out_opt_bytecapcount_(len) char *dtmf_str, _In_ switch_size_t len);
|
||||
|
||||
/*!
|
||||
\brief Render the name of the provided state enum
|
||||
\param state state to get name of
|
||||
\return the string representation of the state
|
||||
*/
|
||||
SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state_t state);
|
||||
SWITCH_DECLARE(const char *) switch_channel_state_name(_In_ switch_channel_state_t state);
|
||||
|
||||
/*!
|
||||
\brief Render the enum of the provided state name
|
||||
\param name the name of the state
|
||||
\return the enum value (numeric)
|
||||
*/
|
||||
SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(const char *name);
|
||||
SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(_In_ const char *name);
|
||||
|
||||
/*!
|
||||
\brief Add information about a given channel to an event object
|
||||
\param channel channel to add information about
|
||||
\param event event to add information to
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, switch_event_t *event);
|
||||
SWITCH_DECLARE(void) switch_channel_event_set_data(_In_ switch_channel_t *channel, _In_ switch_event_t *event);
|
||||
|
||||
/*!
|
||||
\brief Expand varaibles in a string based on the variables in a paticular channel
|
||||
@@ -467,9 +467,9 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel_t *channel, sw
|
||||
\return the original string if no expansion takes place otherwise a new string that must be freed
|
||||
\note it's necessary to test if the return val is the same as the input and free the string if it is not.
|
||||
*/
|
||||
SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel, const char *in);
|
||||
SWITCH_DECLARE(char *) switch_channel_build_param_string(switch_channel_t *channel, switch_caller_profile_t *caller_profile, const char *prefix);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *channel);
|
||||
SWITCH_DECLARE(char *) switch_channel_expand_variables(_In_ switch_channel_t *channel, _In_ const char *in);
|
||||
SWITCH_DECLARE(char *) switch_channel_build_param_string(_In_ switch_channel_t *channel, _In_opt_ switch_caller_profile_t *caller_profile, _In_opt_ const char *prefix);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(_In_ switch_channel_t *channel);
|
||||
|
||||
#define switch_channel_stop_broadcast(_channel) if (switch_channel_test_flag(_channel, CF_BROADCAST)) switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST)
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ SWITCH_DECLARE(void *) switch_core_alloc(_In_ switch_memory_pool_t *pool, _In_ s
|
||||
\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(_In_ switch_core_session_t *session, _In_ switch_size_t memory);
|
||||
_Ret_ SWITCH_DECLARE(void *) switch_core_session_alloc(_In_ switch_core_session_t *session, _In_ switch_size_t memory);
|
||||
|
||||
/*!
|
||||
\brief Copy a string using permanent memory allocation
|
||||
@@ -512,7 +512,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_thread_launch(_In_ switch_co
|
||||
\param session the session to retrieve from
|
||||
\return a pointer to the channel object
|
||||
*/
|
||||
SWITCH_DECLARE(switch_channel_t *) switch_core_session_get_channel(_In_ switch_core_session_t *session);
|
||||
_Ret_ SWITCH_DECLARE(switch_channel_t *) switch_core_session_get_channel(_In_ switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Signal a session's state machine thread that a state change has occured
|
||||
|
||||
@@ -98,7 +98,7 @@ SWITCH_DECLARE(int) switch_ivr_set_xml_chan_vars(switch_xml_t xml, switch_channe
|
||||
\param event the event to parse
|
||||
\return SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *session, switch_event_t *event);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(_In_ switch_core_session_t *session, _In_ switch_event_t *event);
|
||||
|
||||
/*!
|
||||
\brief Parse all commands from an event
|
||||
@@ -388,8 +388,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||
\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_t) switch_ivr_multi_threaded_bridge(switch_core_session_t *session,
|
||||
switch_core_session_t *peer_session,
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(_In_ switch_core_session_t *session,
|
||||
_In_ switch_core_session_t *peer_session,
|
||||
switch_input_callback_function_t dtmf_callback, void *session_data,
|
||||
void *peer_session_data);
|
||||
|
||||
@@ -408,7 +408,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
|
||||
\param dialplan the new dialplan (OPTIONAL, may be NULL)
|
||||
\param context the new context (OPTIONAL, may be NULL)
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, const char *extension, const char *dialplan, const char *context);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(_In_ switch_core_session_t *session, const char *extension, const char *dialplan, const char *context);
|
||||
|
||||
/*!
|
||||
\brief Transfer an existing session to another location in the future
|
||||
|
||||
@@ -313,6 +313,8 @@ SWITCH_END_EXTERN_C
|
||||
#define _Inout_
|
||||
#define _Inout_opt_
|
||||
#define _In_bytecount_(x)
|
||||
#define _Out_opt_bytecapcount_(x)
|
||||
#define _Ret_
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user