mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
refactor to avoid some potential issues with channels that are hungup instantly after being answered
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4926 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -590,7 +590,7 @@ static switch_status_t pause_function(char *cmd, switch_core_session_t *isession
|
||||
static switch_status_t originate_function(char *cmd, switch_core_session_t *isession, switch_stream_handle_t *stream)
|
||||
{
|
||||
switch_channel_t *caller_channel;
|
||||
switch_core_session_t *caller_session;
|
||||
switch_core_session_t *caller_session = NULL;
|
||||
char *argv[7] = { 0 };
|
||||
int i = 0, x, argc = 0;
|
||||
char *aleg, *exten, *dp, *context, *cid_name, *cid_num;
|
||||
@@ -684,6 +684,10 @@ static switch_status_t originate_function(char *cmd, switch_core_session_t *ises
|
||||
stream->write_function(stream, "Created Session: %s\n", switch_core_session_get_uuid(caller_session));
|
||||
}
|
||||
|
||||
if (caller_session) {
|
||||
switch_core_session_rwunlock(caller_session);
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user