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 )
void
sflphone_current( call_t * c )
{
c->state = CALL_STATE_CURRENT;
update_call_tree(current_calls,c);
update_menus();
if( c->state != CALL_STATE_HOLD )
(void) time(&c->_start);
c->state = CALL_STATE_CURRENT;
update_call_tree(current_calls,c);
update_menus();
}
void
......
......@@ -81,30 +81,33 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data)
static void
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);
printf("Call button pressed\n");
if(call_list_get_size(current_calls)>0)
sflphone_pick_up();
else if(call_list_get_size(active_calltree) > 0){
printf("Calling a called num\n");
selectedCall = call_get_selected(active_calltree);
if( selectedCall)
{
printf("Calling a called num\n");
newCall->to = g_strdup(call_get_number(selectedCall));
newCall->from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL);
newCall->state = CALL_STATE_DIALING;
newCall->callID = g_new0(gchar, 30);
g_sprintf(newCall->callID, "%d", rand());
newCall->_start = 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);
call_list_add(current_calls, newCall);
update_call_tree_add(current_calls, newCall);
sflphone_place_call(newCall);
newCall->to = g_strdup(call_get_number(selectedCall));
newCall->from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL);
newCall->state = CALL_STATE_DIALING;
newCall->callID = g_new0(gchar, 30);
g_sprintf(newCall->callID, "%d", rand());
newCall->_start = 0;
newCall->_stop = 0;
printf("call : from : %s to %s\n", newCall->from, newCall->to);
call_list_add(current_calls, newCall);
update_call_tree_add(current_calls, newCall);
sflphone_place_call(newCall);
if( active_calltree == history ) switch_tab();
}
}else
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