Skip to content
Snippets Groups Projects
Commit 4e7e439d authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Fix the hold case for call duration

parent ca2b57cf
Branches
Tags
No related merge requests found
...@@ -347,10 +347,11 @@ sflphone_busy( call_t * c ) ...@@ -347,10 +347,11 @@ sflphone_busy( call_t * c )
void void
sflphone_current( call_t * c ) sflphone_current( call_t * c )
{ {
if( c->state != CALL_STATE_HOLD )
(void) time(&c->_start);
c->state = CALL_STATE_CURRENT; c->state = CALL_STATE_CURRENT;
update_call_tree(current_calls,c); update_call_tree(current_calls,c);
update_menus(); update_menus();
(void) time(&c->_start);
} }
void void
......
...@@ -81,14 +81,15 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data) ...@@ -81,14 +81,15 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data)
static void static void
call_button( GtkWidget *widget, gpointer data ) call_button( GtkWidget *widget, gpointer data )
{ {
call_t * selectedCall; call_t * selectedCall = call_get_selected(active_calltree);
call_t* newCall = g_new0 (call_t, 1); call_t* newCall = g_new0 (call_t, 1);
printf("Call button pressed\n"); printf("Call button pressed\n");
if(call_list_get_size(current_calls)>0) if(call_list_get_size(current_calls)>0)
sflphone_pick_up(); sflphone_pick_up();
else if(call_list_get_size(active_calltree) > 0){ else if(call_list_get_size(active_calltree) > 0){
if( selectedCall)
{
printf("Calling a called num\n"); printf("Calling a called num\n");
selectedCall = call_get_selected(active_calltree);
newCall->to = g_strdup(call_get_number(selectedCall)); newCall->to = g_strdup(call_get_number(selectedCall));
newCall->from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL); newCall->from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL);
...@@ -98,13 +99,15 @@ call_button( GtkWidget *widget, gpointer data ) ...@@ -98,13 +99,15 @@ call_button( GtkWidget *widget, gpointer data )
newCall->_start = 0; newCall->_start = 0;
newCall->_stop = 0; newCall->_stop = 0;
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(historyButton), FALSE);
printf("call : from : %s to %s\n", newCall->from, newCall->to); printf("call : from : %s to %s\n", newCall->from, newCall->to);
call_list_add(current_calls, newCall); call_list_add(current_calls, newCall);
update_call_tree_add(current_calls, newCall); update_call_tree_add(current_calls, newCall);
sflphone_place_call(newCall); sflphone_place_call(newCall);
if( active_calltree == history ) switch_tab();
}
}else }else
sflphone_new_call(); sflphone_new_call();
if( active_calltree == history ) switch_tab();
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment