From e534ad04e9de180765719c5f8da2f608b8fc0e7a Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Wed, 11 Feb 2009 12:21:01 -0500
Subject: [PATCH] Fix bug in history call duration when the call fails

---
 sflphone-gtk/src/actions.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c
index 4f5e911a52..8936139500 100644
--- a/sflphone-gtk/src/actions.c
+++ b/sflphone-gtk/src/actions.c
@@ -258,12 +258,16 @@ sflphone_hang_up()
 			case CALL_STATE_CURRENT:
 			case CALL_STATE_HOLD:
 			case CALL_STATE_BUSY:
-			case CALL_STATE_FAILURE:
-                        case CALL_STATE_RECORD:
+            case CALL_STATE_RECORD:
 				dbus_hang_up (selectedCall);
 				selectedCall->state = CALL_STATE_DIALING;
 				(void) time(&selectedCall->_stop);
 				break;
+			case CALL_STATE_FAILURE:
+				dbus_hang_up (selectedCall);
+				selectedCall->state = CALL_STATE_DIALING;
+				selectedCall->_stop = 0;
+				break;
 			case CALL_STATE_INCOMING:  
 				dbus_refuse (selectedCall);
 				selectedCall->state = CALL_STATE_DIALING;
@@ -616,6 +620,7 @@ sflphone_keypad( guint keyval, gchar * key)
 			case CALL_STATE_RINGING:
 			case CALL_STATE_BUSY:
 			case CALL_STATE_FAILURE:
+				c->_stop = 0;
 				switch (keyval)
 				{
 					case 65307: /* ESCAPE */
-- 
GitLab