fix potential naughty bug you will need 'make sure'
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4432 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
bf086ff6f9
commit
0ddffd3ef6
|
@ -428,7 +428,7 @@ SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_
|
||||||
\param pool the pool to use for the allocation (a new one will be used if NULL)
|
\param pool the pool to use for the allocation (a new one will be used if NULL)
|
||||||
\return the newly created session
|
\return the newly created session
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t *endpoint_interface, switch_memory_pool_t *pool);
|
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t *endpoint_interface, switch_memory_pool_t **pool);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Destroy a session and return the memory pool to the core
|
\brief Destroy a session and return the memory pool to the core
|
||||||
|
@ -449,7 +449,7 @@ SWITCH_DECLARE(uint32_t) switch_core_session_count(void);
|
||||||
\param pool the pool to use
|
\param pool the pool to use
|
||||||
\return the newly created session
|
\return the newly created session
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_core_session_t *) 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
|
\brief Launch the session thread (state machine) on a given session
|
||||||
|
@ -649,7 +649,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
||||||
char *endpoint_name,
|
char *endpoint_name,
|
||||||
switch_caller_profile_t *caller_profile,
|
switch_caller_profile_t *caller_profile,
|
||||||
switch_core_session_t **new_session,
|
switch_core_session_t **new_session,
|
||||||
switch_memory_pool_t *pool);
|
switch_memory_pool_t **pool);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Answer the channel of a given session
|
\brief Answer the channel of a given session
|
||||||
|
|
|
@ -172,7 +172,7 @@ struct switch_io_event_hooks {
|
||||||
/*! \brief A table of i/o routines that an endpoint interface can implement */
|
/*! \brief A table of i/o routines that an endpoint interface can implement */
|
||||||
struct switch_io_routines {
|
struct switch_io_routines {
|
||||||
/*! creates an outgoing session from given session, caller profile */
|
/*! creates an outgoing session from given session, caller profile */
|
||||||
switch_call_cause_t (*outgoing_channel)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t *);
|
switch_call_cause_t (*outgoing_channel)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
|
||||||
/*! answers the given session's channel */
|
/*! answers the given session's channel */
|
||||||
switch_status_t (*answer_channel)(switch_core_session_t *);
|
switch_status_t (*answer_channel)(switch_core_session_t *);
|
||||||
/*! read a frame from a session */
|
/*! read a frame from a session */
|
||||||
|
|
|
@ -170,7 +170,7 @@ static switch_status_t woomera_on_ring(switch_core_session_t *session);
|
||||||
static switch_status_t woomera_on_loopback(switch_core_session_t *session);
|
static switch_status_t woomera_on_loopback(switch_core_session_t *session);
|
||||||
static switch_status_t woomera_on_transmit(switch_core_session_t *session);
|
static switch_status_t woomera_on_transmit(switch_core_session_t *session);
|
||||||
static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||||
switch_core_session_t **new_session, switch_memory_pool_t *pool);
|
switch_core_session_t **new_session, switch_memory_pool_t **pool);
|
||||||
static switch_status_t woomera_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
static switch_status_t woomera_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||||
switch_io_flag_t flags, int stream_id);
|
switch_io_flag_t flags, int stream_id);
|
||||||
static switch_status_t woomera_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
static switch_status_t woomera_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||||
|
@ -482,7 +482,7 @@ static const switch_loadable_module_interface_t woomera_module_interface = {
|
||||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||||
*/
|
*/
|
||||||
static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
static switch_call_cause_t woomera_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||||
switch_core_session_t **new_session, switch_memory_pool_t *pool)
|
switch_core_session_t **new_session, switch_memory_pool_t **pool)
|
||||||
{
|
{
|
||||||
if ((*new_session = switch_core_session_request(&woomera_endpoint_interface, pool)) != 0) {
|
if ((*new_session = switch_core_session_request(&woomera_endpoint_interface, pool)) != 0) {
|
||||||
struct private_object *tech_pvt;
|
struct private_object *tech_pvt;
|
||||||
|
|
|
@ -1596,7 +1596,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
||||||
char *endpoint_name,
|
char *endpoint_name,
|
||||||
switch_caller_profile_t *caller_profile,
|
switch_caller_profile_t *caller_profile,
|
||||||
switch_core_session_t **new_session,
|
switch_core_session_t **new_session,
|
||||||
switch_memory_pool_t *pool)
|
switch_memory_pool_t **pool)
|
||||||
{
|
{
|
||||||
switch_io_event_hook_outgoing_channel_t *ptr;
|
switch_io_event_hook_outgoing_channel_t *ptr;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
@ -3693,8 +3693,8 @@ SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t *endpoint_interface,
|
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t *endpoint_interface, switch_memory_pool_t **pool)
|
||||||
switch_memory_pool_t *pool)
|
|
||||||
{
|
{
|
||||||
switch_memory_pool_t *usepool;
|
switch_memory_pool_t *usepool;
|
||||||
switch_core_session_t *session;
|
switch_core_session_t *session;
|
||||||
|
@ -3717,8 +3717,9 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pool) {
|
if (*pool) {
|
||||||
usepool = pool;
|
usepool = *pool;
|
||||||
|
*pool = NULL;
|
||||||
} else if (switch_core_new_memory_pool(&usepool) != SWITCH_STATUS_SUCCESS) {
|
} else if (switch_core_new_memory_pool(&usepool) != SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory pool\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not allocate memory pool\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -3778,7 +3779,7 @@ SWITCH_DECLARE(uint32_t) switch_core_session_count(void)
|
||||||
return runtime.session_count;
|
return runtime.session_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_core_session_t *) 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_t *endpoint_interface;
|
const switch_endpoint_interface_t *endpoint_interface;
|
||||||
|
|
||||||
|
|
|
@ -2750,7 +2750,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((reason = switch_core_session_outgoing_channel(session, chan_type, caller_profiles[i], &peer_sessions[i], pool)) != SWITCH_CAUSE_SUCCESS) {
|
if ((reason = switch_core_session_outgoing_channel(session, chan_type, caller_profiles[i], &peer_sessions[i], &pool)) != SWITCH_CAUSE_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel! cause: %s\n", switch_channel_cause2str(reason));
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel! cause: %s\n", switch_channel_cause2str(reason));
|
||||||
if (pool) {
|
if (pool) {
|
||||||
switch_core_destroy_memory_pool(&pool);
|
switch_core_destroy_memory_pool(&pool);
|
||||||
|
|
Loading…
Reference in New Issue