fix hangup time

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1011 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-04-03 14:53:34 +00:00
parent f8ec13115a
commit e0fee29284
1 changed files with 5 additions and 1 deletions

View File

@ -560,8 +560,12 @@ SWITCH_DECLARE(switch_caller_extension *) switch_channel_get_caller_extension(sw
SWITCH_DECLARE(switch_channel_state) switch_channel_hangup(switch_channel *channel)
{
assert(channel != NULL);
if (channel->state < CS_HANGUP) {
if (!channel->times.hungup) {
channel->times.hungup = switch_time_now();
}
if (channel->state < CS_HANGUP) {
channel->state = CS_HANGUP;
switch_core_session_kill_channel(channel->session, SWITCH_SIG_KILL);
switch_core_session_signal_state_change(channel->session);