Skip to content
Snippets Groups Projects
Commit 0c0ecfd1 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2474] Use calltree_display_call_info for Normal calls and Transfers

parent 854fd19b
No related branches found
No related tags found
No related merge requests found
......@@ -339,11 +339,19 @@ button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUS
gchar*
calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type)
calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gchar** display_info)
{
gchar * description;
gchar * tmp_info;
DEBUG("----------------- calltree_display_call_info -----------------\n");
switch(display_type) {
case DISPLAY_TYPE_CALL:
DEBUG("display a normal call");
if(c->_state_code == 0) {
if(g_strcmp0("", c->_peer_name) == 0) {
......@@ -375,9 +383,39 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type)
}
}
break;
return description;
case DISPLAY_TYPE_CALL_TRANSFER:
DEBUG("display a call transfer")
if(g_strcmp0("",c->_peer_name) == 0){
description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:%s</i> ",
c->_peer_number,
c->_peer_name,
c->_trsft_to);
}
else {
description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:%s</i> ",
c->_peer_name,
c->_peer_number,
c->_trsft_to);
}
DEBUG("Transfer string: %s", description);
break;
default :
DEBUG("Not an allowable type of display");
break;
}
// return description;
tmp_info = g_strdup(description);
*display_info = tmp_info;
}
......@@ -629,6 +667,10 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
if(c->_state == CALL_STATE_TRANSFERT)
{
calltree_display_call_info(c, DISPLAY_TYPE_CALL_TRANSFER, &description);
DEBUG("second try: %s", description);
/*
if(g_strcmp0("",c->_peer_name) == 0){
description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:%s</i> ",
c->_peer_number,
......@@ -641,6 +683,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
c->_peer_number,
c->_trsft_to);
}
*/
}
else
{
......@@ -800,6 +843,7 @@ void calltree_add_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
gchar * date="";
gchar *duration="";
/*
if(c->_state_code == 0) {
if(g_strcmp0("", c->_peer_name) == 0) {
......@@ -830,6 +874,9 @@ void calltree_add_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent)
c->_state_code);
}
}
*/
calltree_display_call_info(c, DISPLAY_TYPE_CALL, &description);
gtk_tree_store_prepend (tab->store, &iter, parent);
......
......@@ -44,8 +44,8 @@ enum {
* Tags used to identify display type in calltree
*/
typedef enum {
DISPLAY_TYPE_CALL_TRANSFER,
DISPLAY_TYPE_CALL,
DISPLAY_TYPE_CALL_TRANSFER,
DISPLAY_TYPE_SAS,
DISPLAY_TYPE_STATE_CODE
} CallDisplayType;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment