diff --git a/src/include/switch_core.h b/src/include/switch_core.h index e5249da357..bb7211eee7 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -353,7 +353,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s char *endpoint_name, switch_caller_profile *caller_profile, switch_core_session **new_session, - switch_memory_pool **pool); + switch_memory_pool *pool); /*! \brief Answer the channel of a given session diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index e16b1c77d6..4645e63496 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -935,7 +935,7 @@ static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval } caller_profile = switch_caller_profile_new(pool, dialplan, cid_name, cid_num, network_addr, ani, ani2, dest); - if (switch_core_session_outgoing_channel(session, channel_type, caller_profile, &peer_session, &pool) == SWITCH_STATUS_SUCCESS) { + if (switch_core_session_outgoing_channel(session, channel_type, caller_profile, &peer_session, pool) == SWITCH_STATUS_SUCCESS) { jss = switch_core_session_alloc(peer_session, sizeof(*jss)); jss->session = peer_session; jss->flags = 0; diff --git a/src/switch_core.c b/src/switch_core.c index 9ded65f2f1..d95e57e61a 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -780,7 +780,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s char *endpoint_name, switch_caller_profile *caller_profile, switch_core_session **new_session, - switch_memory_pool **pool) + switch_memory_pool *pool) { struct switch_io_event_hook_outgoing_channel *ptr; switch_status status = SWITCH_STATUS_FALSE; @@ -794,9 +794,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s if (endpoint_interface->io_routines->outgoing_channel) { if ((status = endpoint_interface->io_routines->outgoing_channel(session, caller_profile, - new_session, *pool)) == SWITCH_STATUS_SUCCESS) { - /* session has adopted this pool we cant touch it now */ - *pool = NULL; + new_session, pool)) == SWITCH_STATUS_SUCCESS) { if (session) { for (ptr = session->event_hooks.outgoing_channel; ptr; ptr = ptr->next) { if ((status = ptr->outgoing_channel(session, caller_profile, *new_session)) != SWITCH_STATUS_SUCCESS) {