diff -u -r1.1.1.2 translate.c
--- translate.c	16 Mar 2003 22:37:29 -0000	1.1.1.2
+++ translate.c	12 Jul 2003 21:17:36 -0000
@@ -252,26 +252,99 @@
 
 static int show_translation(int fd, int argc, char *argv[])
 {
-#define SHOW_TRANS 14
+#define SHOW_TRANS 11
 	int x,y;
 	char line[80];
 	if (argc != 2) 
 		return RESULT_SHOWUSAGE;
-	ast_cli(fd, "                        Translation times between formats (in milliseconds)\n");
-	ast_cli(fd, "                                 Destination Format\n");
+	ast_cli(fd, "         Translation times between formats (in milliseconds)\n");
+	ast_cli(fd, "          Source Format (Rows) Destination Format(Columns)\n\n");
 	ast_pthread_mutex_lock(&list_lock);
-	for (x=0;x<SHOW_TRANS; x++) {
-		if (x == 1) 
-			strcpy(line, "  Src  ");
-		else if (x == 2)
-			strcpy(line, "  Fmt  ");
-		else
-			strcpy(line, "       ");
-		for (y=0;y<SHOW_TRANS;y++) {
-			if (tr_matrix[x][y].step)
-				snprintf(line + strlen(line), sizeof(line) - strlen(line), " %4d", tr_matrix[x][y].cost);
+	for (x=-1;x<SHOW_TRANS; x++) {
+		strcpy(line, " ");
+		for (y=-1;y<SHOW_TRANS;y++) {
+			if (y != 4 && x >= 0 && y >= 0 && tr_matrix[x][y].step)
+				snprintf(line + strlen(line), sizeof(line) - strlen(line), " %6d", tr_matrix[x][y].cost);
 			else
-				snprintf(line + strlen(line), sizeof(line) - strlen(line), "  n/a");
+				/* Skip MP3 (1<<5) as Destination format, draw labels for others */
+				if ((y != 4) && ((x == -1 && y >= 0) || (y == -1 && x >= 0))) {
+					switch (1<<(x+y+1)) {
+						case AST_FORMAT_G723_1:	{
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									" G723.1");
+								break;
+							}
+						case AST_FORMAT_GSM: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"    GSM");
+								break;
+							}
+						case AST_FORMAT_ULAW: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"   ULAW");
+								break;
+							}
+						case AST_FORMAT_ALAW: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"   ALAW");
+								break;
+							}
+						case AST_FORMAT_MP3: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"    MP3");
+								break;
+							}
+						case AST_FORMAT_ADPCM: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"  ADPCM");
+								break;
+							}
+						case AST_FORMAT_SLINEAR: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"  SLINR");
+								break;
+							}
+						case AST_FORMAT_LPC10: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"  LPC10");
+								break;
+							}
+						case AST_FORMAT_G729A: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									" G729.A");
+								break;
+							}
+						case AST_FORMAT_SPEEX: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"  SPEEX");
+								break;
+							}
+						case AST_FORMAT_ILBC: {
+								snprintf(line + strlen(line), 
+									sizeof(line) - strlen(line), 
+									"   ILBC");
+								break;
+							}
+						default:
+							snprintf(line + strlen(line), 
+								sizeof(line) - strlen(line), 
+								" %6d", (1<<(x+y+1)));
+					}
+				} else if (x != -1 && y != -1 && y != 4) {
+					snprintf(line + strlen(line), sizeof(line) - strlen(line), "      -");
+				} else if (y != 4) {
+					snprintf(line + strlen(line), sizeof(line) - strlen(line), "       ");
+				}
 		}
 		snprintf(line + strlen(line), sizeof(line) - strlen(line), "\n");
 		ast_cli(fd, line);			
