git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8683 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-05-27 02:30:37 +00:00
parent ebbf9b3eae
commit 54bda58a95
4 changed files with 51 additions and 38 deletions

View File

@ -3,8 +3,8 @@
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Project related configuration options # Project related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PROJECT_NAME = FreeSwitch PROJECT_NAME = FreeSWITCH
PROJECT_NUMBER = PROJECT_NUMBER = 1.0.0
OUTPUT_DIRECTORY = . OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
@ -30,7 +30,7 @@ STRIP_FROM_INC_PATH =
SHORT_NAMES = NO SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO JAVADOC_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO DETAILS_AT_TOP = YES
INHERIT_DOCS = YES INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8 TAB_SIZE = 8

View File

@ -395,59 +395,70 @@ SWITCH_DECLARE(void) switch_core_session_run(_In_ switch_core_session_t *session
*/ */
SWITCH_DECLARE(unsigned int) switch_core_session_running(_In_ switch_core_session_t *session); SWITCH_DECLARE(unsigned int) switch_core_session_running(_In_ switch_core_session_t *session);
SWITCH_DECLARE(void *) switch_core_perform_permanent_alloc(_In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line);
/*! /*!
\brief Allocate memory from the main pool with no intention of returning it \brief Allocate memory from the main pool with no intention of returning it
\param memory the number of bytes to allocate \param _memory the number of bytes to allocate
\return a void pointer to the allocated memory \return a void pointer to the allocated memory
\note this memory never goes out of scope until the core is destroyed \note this memory never goes out of scope until the core is destroyed
*/ */
SWITCH_DECLARE(void *) switch_core_perform_permanent_alloc(_In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line); #define switch_core_permanent_alloc(_memory) switch_core_perform_permanent_alloc(_memory, __FILE__, __SWITCH_FUNC__, __LINE__)
#define switch_core_permanent_alloc(m) switch_core_perform_permanent_alloc(m, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE(void *) switch_core_perform_alloc(_In_ switch_memory_pool_t *pool, _In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line);
/*! /*!
\brief Allocate memory directly from a memory pool \brief Allocate memory directly from a memory pool
\param pool the memory pool to allocate from \param _pool the memory pool to allocate from
\param memory the number of bytes to allocate \param _mem the number of bytes to allocate
\return a void pointer to the allocated memory \return a void pointer to the allocated memory
*/ */
SWITCH_DECLARE(void *) switch_core_perform_alloc(_In_ switch_memory_pool_t *pool, _In_ switch_size_t memory, _In_z_ const char *file, _In_z_ const char *func, _In_ int line); #define switch_core_alloc(_pool, _mem) switch_core_perform_alloc(_pool, _mem, __FILE__, __SWITCH_FUNC__, __LINE__)
#define switch_core_alloc(p, m) switch_core_perform_alloc(p, m, __FILE__, __SWITCH_FUNC__, __LINE__)
_Ret_ SWITCH_DECLARE(void *) switch_core_perform_session_alloc(_In_ switch_core_session_t *session, _In_ switch_size_t memory, const char *file, const char *func, int line);
/*! /*!
\brief Allocate memory from a session's pool \brief Allocate memory from a session's pool
\param session the session to request memory from \param _session the session to request memory from
\param memory the amount of memory to allocate \param _memory the amount of memory to allocate
\return a void pointer to the newly allocated memory \return a void pointer to the newly allocated memory
\note the memory will be in scope as long as the session exists \note the memory will be in scope as long as the session exists
*/ */
_Ret_ SWITCH_DECLARE(void *) switch_core_perform_session_alloc(_In_ switch_core_session_t *session, _In_ switch_size_t memory, const char *file, const char *func, int line); #define switch_core_session_alloc(_session, _memory) switch_core_perform_session_alloc(_session, _memory, __FILE__, __SWITCH_FUNC__, __LINE__)
#define switch_core_session_alloc(s, m) switch_core_perform_session_alloc(s, m, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE(char *) switch_core_perform_permanent_strdup(_In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line);
/*! /*!
\brief Copy a string using permanent memory allocation \brief Copy a string using permanent memory allocation
\param todup the string to duplicate \param _todup the string to duplicate
\return a pointer to the newly duplicated string \return a pointer to the newly duplicated string
*/ */
SWITCH_DECLARE(char *) switch_core_perform_permanent_strdup(_In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line); #define switch_core_permanent_strdup(_todup) switch_core_perform_permanent_strdup(_todup, __FILE__, __SWITCH_FUNC__, __LINE__)
#define switch_core_permanent_strdup(t) switch_core_perform_permanent_strdup(t, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE(char *) switch_core_perform_session_strdup(_In_ switch_core_session_t *session, _In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line);
/*! /*!
\brief Copy a string using memory allocation from a session's pool \brief Copy a string using memory allocation from a session's pool
\param session a session to use for allocation \param _session a session to use for allocation
\param todup the string to duplicate \param _todup the string to duplicate
\return a pointer to the newly duplicated string \return a pointer to the newly duplicated string
*/ */
SWITCH_DECLARE(char *) switch_core_perform_session_strdup(_In_ switch_core_session_t *session, _In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line); #define switch_core_session_strdup(_session, _todup) switch_core_perform_session_strdup(_session, _todup, __FILE__, __SWITCH_FUNC__, __LINE__)
#define switch_core_session_strdup(s, t) switch_core_perform_session_strdup(s, t, __FILE__, __SWITCH_FUNC__, __LINE__)
SWITCH_DECLARE(char *) switch_core_perform_strdup(_In_ switch_memory_pool_t *pool, _In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line);
/*! /*!
\brief Copy a string using memory allocation from a given pool \brief Copy a string using memory allocation from a given pool
\param pool the pool to use for allocation \param _pool the pool to use for allocation
\param todup the string to duplicate \param _todup the string to duplicate
\return a pointer to the newly duplicated string \return a pointer to the newly duplicated string
*/ */
SWITCH_DECLARE(char *) switch_core_perform_strdup(_In_ switch_memory_pool_t *pool, _In_z_ const char *todup, _In_z_ const char *file, _In_z_ const char *func, _In_ int line); #define switch_core_strdup(_pool, _todup) switch_core_perform_strdup(_pool, _todup, __FILE__, __SWITCH_FUNC__, __LINE__)
#define switch_core_strdup(p, t) switch_core_perform_strdup(p, t, __FILE__, __SWITCH_FUNC__, __LINE__)
/*! /*!
\brief printf-style style printing routine. The data is output to a string allocated from the session \brief printf-style style printing routine. The data is output to a string allocated from the session
@ -1198,17 +1209,7 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
///\defgroup Media File Functions ///\defgroup Media File Functions
///\ingroup core1 ///\ingroup core1
///\{ ///\{
/*!
\brief Open a media file using file format modules
\param fh a file handle to use
\param file_path the path to the file
\param channels the number of channels
\param rate the sample rate
\param flags read/write flags
\param pool the pool to use (NULL for new pool)
\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_t) switch_core_perform_file_open(const char *file, const char *func, int line, SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file, const char *func, int line,
_In_ switch_file_handle_t *fh, _In_ switch_file_handle_t *fh,
_In_z_ const char *file_path, _In_z_ const char *file_path,
@ -1216,6 +1217,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
_In_ uint32_t rate, _In_ uint32_t rate,
_In_ unsigned int flags, _In_ unsigned int flags,
_In_opt_ switch_memory_pool_t *pool); _In_opt_ switch_memory_pool_t *pool);
/*!
\brief Open a media file using file format modules
\param _fh a file handle to use
\param _file_path the path to the file
\param _channels the number of channels
\param _rate the sample rate
\param _flags read/write flags
\param _pool the pool to use (NULL for new pool)
\return SWITCH_STATUS_SUCCESS if the file is opened
\note the loadable module used is chosen based on the file extension
*/
#define switch_core_file_open(_fh, _file_path, _channels, _rate, _flags, _pool) \ #define switch_core_file_open(_fh, _file_path, _channels, _rate, _flags, _pool) \
switch_core_perform_file_open(__FILE__, __SWITCH_FUNC__, __LINE__, _fh, _file_path, _channels, _rate, _flags, _pool) switch_core_perform_file_open(__FILE__, __SWITCH_FUNC__, __LINE__, _fh, _file_path, _channels, _rate, _flags, _pool)

View File

@ -238,7 +238,7 @@ NEW_HOOK_DECL_REM_P(kill_channel);
NEW_HOOK_DECL_REM_P(send_dtmf); NEW_HOOK_DECL_REM_P(send_dtmf);
NEW_HOOK_DECL_REM_P(recv_dtmf); NEW_HOOK_DECL_REM_P(recv_dtmf);
NEW_HOOK_DECL_REM_P(resurrect_session); NEW_HOOK_DECL_REM_P(resurrect_session);
///\}
SWITCH_END_EXTERN_C SWITCH_END_EXTERN_C
#endif #endif

View File

@ -217,7 +217,7 @@ class CoreSession {
* \param a_leg_session - the session where the call is originating from * \param a_leg_session - the session where the call is originating from
* and also the session in which _this_ session was * and also the session in which _this_ session was
* created * created
* \param dest - a string representing destination, eg, sofia/mydomain.com/foo@bar.com * \param dest - a string representing destination, eg, sofia/mydomain.com/foo\@bar.com
* \param timeout - time to wait for call to be answered * \param timeout - time to wait for call to be answered
* \return an int status code indicating success or failure * \return an int status code indicating success or failure
* *