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

Duplicate call_t struct when calling back from the mouse event

parent a3e038ee
Branches
Tags
No related merge requests found
...@@ -195,6 +195,7 @@ call_mailbox( GtkWidget* widget , gpointer data ) ...@@ -195,6 +195,7 @@ call_mailbox( GtkWidget* widget , gpointer data )
update_call_tree_add( current_calls , mailboxCall ); update_call_tree_add( current_calls , mailboxCall );
update_menus(); update_menus();
sflphone_place_call( mailboxCall ); sflphone_place_call( mailboxCall );
if( active_calltree == history ) switch_tab();
} }
void void
......
...@@ -239,18 +239,21 @@ remove_from_history( void * foo ) ...@@ -239,18 +239,21 @@ remove_from_history( void * foo )
static void static void
call_back( void * foo ) call_back( void * foo )
{ {
call_t* c = call_get_selected( history ); call_t* selectedCall = call_get_selected( history );
if( c ) call_t* newCall = g_new0 (call_t, 1);
if( selectedCall )
{ {
if(!c->to){ newCall->to = g_strdup(call_get_number(selectedCall));
c->to = call_get_number(c); newCall->from = g_strconcat("\"\" <", call_get_number(selectedCall), ">",NULL);
c->from = g_strconcat("\"\" <", c->to, ">",NULL); newCall->state = CALL_STATE_DIALING;
} newCall->callID = g_new0(gchar, 30);
g_sprintf(newCall->callID, "%d", rand());
newCall->_start = 0;
newCall->_stop = 0;
call_list_add(current_calls, newCall);
update_call_tree_add(current_calls, newCall);
sflphone_place_call(newCall);
switch_tab(); switch_tab();
printf("call : from : %s to %s\n", c->from, c->to);
call_list_add(current_calls, c);
update_call_tree_add(current_calls, c);
sflphone_place_call(c);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment