Index: gastman.c =================================================================== RCS file: /usr/cvsroot/gastman/gastman.c,v retrieving revision 1.16 diff -u -r1.16 gastman.c --- gastman.c 3 Aug 2004 17:43:53 -0000 1.16 +++ gastman.c 18 Jan 2005 16:02:02 -0000 @@ -49,7 +49,7 @@ #define QUEUE_MAGIC 0x053b #define QUEUENAME_MAGIC 0x67a4 -#define MAX_HIST 1000 +#define MAX_HIST 8000 static char *history[MAX_HIST]; static int maxhist; @@ -98,6 +98,7 @@ char context[20]; char priority[20]; char callerid[40]; + char calleridname[40]; char icon[80]; char state[10]; char ident[80]; @@ -568,6 +569,10 @@ snprintf(tmp2, sizeof(tmp2), "Caller: %s\n", chan->callerid); strcat(tmp, tmp2); } + if (strlen(chan->calleridname)) { + snprintf(tmp2, sizeof(tmp2), "CallerName: %s\n", chan->calleridname); + strcat(tmp, tmp2); + } if (strlen(chan->exten)) { snprintf(tmp2, sizeof(tmp2), "At: %s@%s:%s\n", chan->exten, chan->context, chan->priority); strcat(tmp, tmp2); @@ -585,7 +590,7 @@ if (strlen(chan->link)) lchan = find_chan(chan->link); ext = exten_match(chan->exten, chan->context); - gui_object_set_callinfo(chan->obj, strlen(chan->callerid) ? chan->callerid : "", + gui_object_set_callinfo(chan->obj, strlen(chan->callerid) ? chan->callerid : "", strlen(chan->calleridname) ? chan->calleridname : "", chan->link, tmp, lchan ? lchan->obj : NULL, ext ? ext->obj : NULL); if (ext) obj = ext->obj; @@ -653,6 +658,9 @@ callerid = get_header(m, "Callerid"); if (strlen(callerid)) strncpy(chan->callerid, callerid, sizeof(chan->callerid) - 1); + callerid = get_header(m, "CalleridName"); + if (strlen(callerid)) + strncpy(chan->calleridname, callerid, sizeof(chan->callerid) - 1); strncpy(chan->state, get_header(m, "State"), sizeof(chan->state) - 1); update_channel(chan); return 0; @@ -676,6 +684,7 @@ chan = find_chan(get_header(m, "Channel")); strncpy(chan->state, get_header(m, "State"), sizeof(chan->state) - 1); strncpy(chan->callerid, get_header(m, "Callerid"), sizeof(chan->callerid) - 1); + strncpy(chan->calleridname, get_header(m, "CalleridName"), sizeof(chan->calleridname) - 1); update_channel(chan); if (strlen(chan->callerid)) snprintf(tmp, sizeof(tmp), "New channel %s from %s", chan->name, chan->callerid); @@ -691,6 +700,7 @@ chan = find_chan(get_header(m, "Channel")); strncpy(chan->state, get_header(m, "State"), sizeof(chan->state) - 1); strncpy(chan->callerid, get_header(m, "Callerid"), sizeof(chan->callerid) - 1); + strncpy(chan->calleridname, get_header(m, "CalleridName"), sizeof(chan->calleridname) - 1); strncpy(chan->exten, get_header(m, "Extension"), sizeof(chan->exten) - 1); strncpy(chan->context, get_header(m, "Context"), sizeof(chan->context) - 1); strncpy(chan->priority, get_header(m, "Priority"), sizeof(chan->priority) - 1); @@ -707,6 +717,7 @@ struct ast_chan *chan; chan = find_chan(get_header(m, "Channel")); strncpy(chan->callerid, get_header(m, "Callerid"), sizeof(chan->callerid) - 1); + strncpy(chan->calleridname, get_header(m, "CalleridName"), sizeof(chan->calleridname) - 1); update_channel(chan); return 0; } @@ -1004,6 +1015,7 @@ char *queue = get_header(m, "Queue"); char *channel = get_header(m, "Channel"); char *callerid = get_header(m, "CallerID"); + char *calleridname = get_header(m, "CalleridName"); int position = atoi(get_header(m, "Position")); int waittime = atoi(get_header(m, "Wait")); q = find_queue(channel, queue); @@ -1023,6 +1035,7 @@ char *queue = get_header(m, "Queue"); char *channel = get_header(m, "Channel"); char *callerid = get_header(m, "CallerID"); + char *calleridname = get_header(m, "CalleridName"); int position = atoi(get_header(m, "Position")); q = find_queue(channel, queue); printf("Channel %s on queue %s has position %d.\n", @@ -1314,7 +1327,7 @@ static char *__gastman_run_command(const char *cmd) { - static char buf[8192], buf2[8192]; + static char buf[140960], buf2[8192]; int yah = 0; int x; struct message *m; Index: gastman.h =================================================================== RCS file: /usr/cvsroot/gastman/gastman.h,v retrieving revision 1.6 diff -u -r1.6 gastman.h --- gastman.h 19 Mar 2004 20:03:34 -0000 1.6 +++ gastman.h 18 Jan 2005 16:02:02 -0000 @@ -44,7 +44,7 @@ void gui_del_queue(struct gui_queue *obj); void gui_object_set_text(struct gui_object *obj, char *text); void gui_object_set_tooltip(struct gui_object *obj, char *tip); -void gui_object_set_callinfo(struct gui_object *obj, char *callerid, char *link, char *location, struct gui_object *cobj, struct gui_object *eobj); +void gui_object_set_callinfo(struct gui_object *obj, char *callerid, char *calleridname, char *link, char *location, struct gui_object *cobj, struct gui_object *eobj); void gui_queue_set_callinfo(struct gui_queue *obj, char *callerid, int position, int wait); void gui_queue_set_queueinfo(struct gui_queue *obj, int num, int max); void gui_object_set_led(struct gui_object *obj, int on); Index: gui.c =================================================================== RCS file: /usr/cvsroot/gastman/gui.c,v retrieving revision 1.13 diff -u -r1.13 gui.c --- gui.c 17 Jul 2004 04:26:51 -0000 1.13 +++ gui.c 18 Jan 2005 16:02:03 -0000 @@ -1865,17 +1865,18 @@ } } -void gui_object_set_callinfo(struct gui_object *obj, char *callerid, char *linked, char *location, struct gui_object *cobj, struct gui_object *eobj) +void gui_object_set_callinfo(struct gui_object *obj, char *callerid, char *calleridname, char *linked, char *location, struct gui_object *cobj, struct gui_object *eobj) { int row, row2; GdkPixmap *cpm = NULL, *epm = NULL; GdkBitmap *cbm = NULL, *ebm = NULL; #if 0 - printf("Being called... ('%s', '%s', '%s')\n", linked, location, callerid); + printf("Being called... ('%s', '%s', '%s', '%s')\n", linked, location, callerid, calleridname); #endif row = gtk_clist_find_row_from_data(GTK_CLIST(calllist), obj); if (row > -1) { - gtk_clist_set_text(GTK_CLIST(calllist), row, 1, callerid); + gtk_clist_set_text(GTK_CLIST(calllist), row, 1, calleridname); + gtk_clist_set_text(GTK_CLIST(calllist), row, 2, callerid); if (cobj && (row2 = gtk_clist_find_row_from_data(GTK_CLIST(calllist), cobj)) > -1) { gtk_clist_get_pixtext(GTK_CLIST(calllist), row2, 0, NULL, NULL, &cpm, &cbm); @@ -1886,13 +1887,10 @@ } if (cpm && cbm) - gtk_clist_set_pixtext(GTK_CLIST(calllist), row, 2, linked, 5, cpm, cbm); + gtk_clist_set_pixtext(GTK_CLIST(calllist), row, 3, linked, 5, cpm, cbm); else - gtk_clist_set_text(GTK_CLIST(calllist), row, 2, linked); - if (epm && ebm) - gtk_clist_set_pixtext(GTK_CLIST(calllist), row, 3, location, 5, epm, ebm); - else - gtk_clist_set_text(GTK_CLIST(calllist), row, 3, location); + gtk_clist_set_text(GTK_CLIST(calllist), row, 3, linked); + gtk_clist_set_text(GTK_CLIST(calllist), row, 4, location); } #if 0 printf("Done called... ('%s', '%s')\n", linked, location); @@ -2009,6 +2007,7 @@ static char *ctitles[] = { "Channel", + "Caller*IDName", "Caller*ID", "Linked to", "Location", @@ -2166,11 +2165,12 @@ /* List of calls and extensions */ pane = gtk_vpaned_new(); - calllist = gtk_clist_new_with_titles(4, ctitles); + calllist = gtk_clist_new_with_titles(5, ctitles); gtk_clist_set_column_auto_resize(GTK_CLIST(calllist), 0, TRUE); gtk_clist_set_column_auto_resize(GTK_CLIST(calllist), 1, TRUE); gtk_clist_set_column_auto_resize(GTK_CLIST(calllist), 2, TRUE); gtk_clist_set_column_auto_resize(GTK_CLIST(calllist), 3, TRUE); + gtk_clist_set_column_auto_resize(GTK_CLIST(calllist), 4, TRUE); gtk_signal_connect(GTK_OBJECT(calllist), "select_row", GTK_SIGNAL_FUNC(list_select), NULL); gtk_clist_set_selection_mode(GTK_CLIST(calllist), GTK_SELECTION_BROWSE); gtk_clist_set_shadow_type(GTK_CLIST(calllist), GTK_SHADOW_IN);