]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix hangup time
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 3 Apr 2006 14:53:34 +0000 (14:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 3 Apr 2006 14:53:34 +0000 (14:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1011 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_channel.c

index c5fd717876739c86ea9d0f6e46691954443d12b9..74c4ebfebfd8a51ad4111e6ec90e1da3591e4a90 100644 (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);