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
No related branches found
No related tags found
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 )
{ {
c->state = CALL_STATE_CURRENT; if( c->state != CALL_STATE_HOLD )
update_call_tree(current_calls,c);
update_menus();
(void) time(&c->_start); (void) time(&c->_start);
c->state = CALL_STATE_CURRENT;
update_call_tree(current_calls,c);
update_menus();
} }
void void
......
...@@ -81,30 +81,33 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data) ...@@ -81,30 +81,33 @@ 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){
printf("Calling a called num\n"); if( selectedCall)
selectedCall = call_get_selected(active_calltree); {
printf("Calling a called num\n");
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);
newCall->state = CALL_STATE_DIALING; newCall->state = CALL_STATE_DIALING;
newCall->callID = g_new0(gchar, 30); newCall->callID = g_new0(gchar, 30);
g_sprintf(newCall->callID, "%d", rand()); g_sprintf(newCall->callID, "%d", rand());
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.
Finish editing this message first!
Please register or to comment