diff -u -r1.26 channel.c
--- channel.c	16 Jul 2003 18:54:16 -0000	1.26
+++ channel.c	16 Jul 2003 20:26:17 -0000
@@ -1088,7 +1088,7 @@
 		if (!(f->subclass & chan->nativeformats)) {
 			/* This frame can't be from the current native formats -- drop it on the
 			   floor */
-			ast_log(LOG_NOTICE, "Dropping incompatible voice frame on %s of format %d since our native format has changed to %d\n", chan->name, f->subclass, chan->nativeformats);
+			ast_log(LOG_NOTICE, "Dropping incompatible voice frame on %s of format %s since our native format has changed to %s\n", chan->name, ast_getformatname(f->subclass), ast_getformatname(chan->nativeformats));
 			ast_frfree(f);
 			f = &null_frame;
 		} else {
@@ -1396,7 +1396,8 @@
 	
 	res = ast_translator_best_choice(&native, &fmt);
 	if (res < 0) {
-		ast_log(LOG_NOTICE, "Unable to find a path from %d to %d\n", fmts, chan->nativeformats);
+		ast_log(LOG_NOTICE, "Unable to find a path from %s to %s\n",
+			ast_getformatname(fmts), ast_getformatname(chan->nativeformats));
 		return -1;
 	}
 	
@@ -1410,7 +1411,7 @@
 	/* Build a translation path from the user write format to the raw writing format */
 	chan->pvt->writetrans = ast_translator_build_path(chan->pvt->rawwriteformat, chan->writeformat);
 	if (option_debug)
-		ast_log(LOG_DEBUG, "Set channel %s to write format %d\n", chan->name, chan->writeformat);
+		ast_log(LOG_DEBUG, "Set channel %s to write format %s\n", chan->name, ast_getformatname(chan->writeformat));
 	return 0;
 }
 
@@ -1425,7 +1426,8 @@
 	/* Find a translation path from the native read format to one of the user's read formats */
 	res = ast_translator_best_choice(&fmt, &native);
 	if (res < 0) {
-		ast_log(LOG_NOTICE, "Unable to find a path from %d to %d\n", chan->nativeformats, fmts);
+		ast_log(LOG_NOTICE, "Unable to find a path from %s to %s\n",
+			ast_getformatname(chan->nativeformats), ast_getformatname(fmts));
 		return -1;
 	}
 	
@@ -1439,7 +1441,8 @@
 	/* Build a translation path from the raw read format to the user reading format */
 	chan->pvt->readtrans = ast_translator_build_path(chan->readformat, chan->pvt->rawreadformat);
 	if (option_debug)
-		ast_log(LOG_DEBUG, "Set channel %s to read format %d\n", chan->name, chan->readformat);
+		ast_log(LOG_DEBUG, "Set channel %s to read format %s\n", 
+			chan->name, ast_getformatname(chan->readformat));
 	return 0;
 }
 
diff -u -r1.18 file.c
--- file.c	1 Jul 2003 23:17:10 -0000	1.18
+++ file.c	16 Jul 2003 20:26:18 -0000
@@ -215,7 +215,7 @@
 		if (!fs->trans) 
 			fs->trans = ast_translator_build_path(fs->fmt->format, f->subclass);
 		if (!fs->trans)
-			ast_log(LOG_WARNING, "Unable to translate to format %s, source format %d\n", fs->fmt->name, f->subclass);
+			ast_log(LOG_WARNING, "Unable to translate to format %s, source format %s\n", fs->fmt->name, ast_getformatname(f->subclass));
 		else {
 			fs->lastwriteformat = f->subclass;
 			res = 0;
@@ -714,7 +714,7 @@
 #endif
 		return 0;
 	}
-	ast_log(LOG_WARNING, "Unable to open %s (format %d): %s\n", filename, chan->nativeformats, strerror(errno));
+	ast_log(LOG_WARNING, "Unable to open %s (format %s): %s\n", filename, ast_getformatname(chan->nativeformats), strerror(errno));
 	return -1;
 }
 
diff -u -r1.3 frame.c
--- frame.c	28 Jun 2003 16:40:02 -0000	1.3
+++ frame.c	16 Jul 2003 20:26:18 -0000
@@ -343,6 +343,41 @@
 	return ast_fr_fdwrite(fd, &hangup);
 }
 
+char* ast_getformatname(int format)
+{
+	if (format == AST_FORMAT_G723_1) 
+		return "G723";
+	else if (format == AST_FORMAT_GSM)
+		return "GSM";
+	else if (format == AST_FORMAT_ULAW)
+		return "ULAW";
+	else if (format == AST_FORMAT_ALAW)
+		return "ALAW";
+	else if (format == AST_FORMAT_MP3)
+		return "MP3";
+	else if (format == AST_FORMAT_SLINEAR)
+		return "SLINR";
+	else if (format == AST_FORMAT_LPC10)
+		return "LPC10";
+	else if (format == AST_FORMAT_ADPCM)
+		return "ADPCM";
+	else if (format == AST_FORMAT_G729A)
+		return "G729";
+	else if (format == AST_FORMAT_SPEEX)
+		return "SPEEX";
+	else if (format == AST_FORMAT_ILBC)
+		return "ILBC";
+	else if (format == AST_FORMAT_JPEG)
+		return "JPEG";
+	else if (format == AST_FORMAT_PNG)
+		return "PNG";
+	else if (format == AST_FORMAT_H261)
+		return "H261";
+	else if (format == AST_FORMAT_H263)
+		return "H263";
+	return "UNKN";
+}
+
 int ast_getformatbyname(char *name)
 {
 	if (!strcasecmp(name, "g723.1")) 
@@ -468,7 +503,7 @@
 		break;
 	case AST_FRAME_IMAGE:
 		strcpy(ftype, "Image");
-		snprintf(subclass, sizeof(subclass), "Image format %d\n", f->subclass);
+		snprintf(subclass, sizeof(subclass), "Image format %s\n", ast_getformatname(f->subclass));
 		break;
 	case AST_FRAME_HTML:
 		strcpy(ftype, "HTML");
diff -u -r1.1.1.1 image.c
--- image.c	12 Feb 2003 13:59:13 -0000	1.1.1.1
+++ image.c	16 Jul 2003 20:26:18 -0000
@@ -175,14 +175,14 @@
 static int show_image_formats(int fd, int argc, char *argv[])
 {
 #define FORMAT "%10s %10s %50s %10s\n"
-#define FORMAT2 "%10s %10s %50s %10d\n"
+#define FORMAT2 "%10s %10s %50s %10s\n"
 	struct ast_imager *i;
 	if (argc != 3)
 		return RESULT_SHOWUSAGE;
 	ast_cli(fd, FORMAT, "Name", "Extensions", "Description", "Format");
 	i = list;
 	while(i) {
-		ast_cli(fd, FORMAT2, i->name, i->exts, i->desc, i->format);
+		ast_cli(fd, FORMAT2, i->name, i->exts, i->desc, ast_getformatname(i->format));
 		i = i->next;
 	};
 	return RESULT_SUCCESS;
diff -u -r1.20 rtp.c
--- rtp.c	11 Jul 2003 21:51:06 -0000	1.20
+++ rtp.c	16 Jul 2003 20:26:18 -0000
@@ -455,7 +455,7 @@
 			// assumes that the RTP packet contained one Speex frame
 			break;
 		default:
-			ast_log(LOG_NOTICE, "Unable to calculate samples for format %d\n", rtp->f.subclass);
+			ast_log(LOG_NOTICE, "Unable to calculate samples for format %s\n", ast_getformatname(rtp->f.subclass));
 			break;
 		}
 	} else {
@@ -905,7 +905,7 @@
 			// assumes that the RTP packet contains one Speex frame
 			break;
 		default:
-			ast_log(LOG_WARNING, "Not sure about timestamp format for codec format %d\n", f->subclass);
+			ast_log(LOG_WARNING, "Not sure about timestamp format for codec format %s\n", ast_getformatname(f->subclass));
 		}
 
 		/* Re-calculate last TS */
@@ -973,13 +973,13 @@
 
 	codec = ast_rtp_lookup_code(rtp, 1, subclass);
 	if (codec < 0) {
-		ast_log(LOG_WARNING, "Don't know how to send format %d packets with RTP\n", _f->subclass);
+		ast_log(LOG_WARNING, "Don't know how to send format %s packets with RTP\n", ast_getformatname(_f->subclass));
 		return -1;
 	}
 
 	if (rtp->lasttxformat != subclass) {
 		/* New format, reset the smoother */
-		ast_log(LOG_DEBUG, "Ooh, format changed from %d to %d\n", rtp->lasttxformat, subclass);
+		ast_log(LOG_DEBUG, "Ooh, format changed from %s to %s\n", ast_getformatname(rtp->lasttxformat), ast_getformatname(subclass));
 		rtp->lasttxformat = subclass;
 		if (rtp->smoother)
 			ast_smoother_free(rtp->smoother);
@@ -1040,10 +1040,10 @@
 			ast_rtp_raw_write(rtp, f, codec);
 		break;
 	default:	
-		ast_log(LOG_WARNING, "Not sure about sending format %d packets\n", subclass);
+		ast_log(LOG_WARNING, "Not sure about sending format %s packets\n", ast_getformatname(subclass));
 		// fall through to...
 	case AST_FORMAT_H261:
 	case AST_FORMAT_H263:
diff -u -r1.1.1.2 translate.c
--- translate.c	16 Mar 2003 22:37:29 -0000	1.1.1.2
+++ translate.c	16 Jul 2003 20:26:19 -0000
@@ -125,7 +125,8 @@
 			}
 		} else {
 			/* We shouldn't have allocated any memory */
-			ast_log(LOG_WARNING, "No translator path from %d to %d\n", source, dest);
+			ast_log(LOG_WARNING, "No translator path from %s to %s\n", 
+				ast_getformatname(source), ast_getformatname(dest));
 			return NULL;
 		}
 	}
@@ -199,7 +200,7 @@
 									tr_matrix[x][z].cost = tr_matrix[x][y].cost + 
 														   tr_matrix[y][z].cost;
 									if (option_debug)
-										ast_log(LOG_DEBUG, "Discovered %d cost path from %d to %d, via %d\n", tr_matrix[x][z].cost, x, z, y);
+										ast_log(LOG_DEBUG, "Discovered %d cost path from %s to %s, via %d\n", tr_matrix[x][z].cost, ast_getformatname(x), ast_getformatname(z), y);
 									changed++;
 								 }
 		
@@ -252,26 +253,29 @@
 
 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++) {
+			/* Skip MP3 (y = 4) as Destination format */
+			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");
+				if ((y != 4) && ((x == -1 && y >= 0) || (y == -1 && x >= 0))) {
+					snprintf(line + strlen(line), sizeof(line) - strlen(line), 
+						" %6s", ast_getformatname(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);			
@@ -296,12 +300,12 @@
 	t->srcfmt = powerof(t->srcfmt);
 	t->dstfmt = powerof(t->dstfmt);
 	if ((t->srcfmt >= MAX_FORMAT) || (t->dstfmt >= MAX_FORMAT)) {
-		ast_log(LOG_WARNING, "Format %d is larger than MAX_FORMAT\n", t->srcfmt);
+		ast_log(LOG_WARNING, "Format %s is larger than MAX_FORMAT\n", ast_getformatname(t->srcfmt));
 		return -1;
 	}
 	calc_cost(t);
 	if (option_verbose > 1)
-		ast_verbose(VERBOSE_PREFIX_2 "Registered translator '%s' from format %d to %d, cost %d\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), t->srcfmt, t->dstfmt, t->cost);
+		ast_verbose(VERBOSE_PREFIX_2 "Registered translator '%s' from format %s to %s, cost %d\n", term_color(tmp, t->name, COLOR_MAGENTA, COLOR_BLACK, sizeof(tmp)), ast_getformatname(t->srcfmt), ast_getformatname(t->dstfmt), t->cost);
 	ast_pthread_mutex_lock(&list_lock);
 	if (!added_cli) {
 		ast_cli_register(&show_trans);
diff -u -r1.8 app_agi.c
--- apps/app_agi.c	14 Jul 2003 16:17:16 -0000	1.8
+++ apps/app_agi.c	16 Jul 2003 20:26:19 -0000
@@ -1435,7 +1435,7 @@
 	res = agi_exec_full(chan, data, 1);
 	if (!res) {
 		if (ast_set_read_format(chan, readformat)) {
-			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %d\n", chan->name, readformat);
+			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(readformat));
 		}
 	}
 	return res;
diff -u -r1.32 app_voicemail2.c
--- apps/app_voicemail2.c	16 Jul 2003 16:47:44 -0000	1.32
+++ apps/app_voicemail2.c	16 Jul 2003 20:26:20 -0000
@@ -917,7 +917,7 @@
 	}
 	if (rfmt) {
 		if (ast_set_read_format(chan, rfmt)) {
-			ast_log(LOG_WARNING, "Unable to restore format %d to channel '%s'\n", rfmt, chan->name);
+			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
 		}
 	}
 	if (outmsg) {
diff -u -r1.14 chan_agent.c
--- channels/chan_agent.c	16 Jul 2003 18:54:16 -0000	1.14
+++ channels/chan_agent.c	16 Jul 2003 20:26:21 -0000
@@ -338,7 +338,7 @@
 		res = ast_set_read_format(p->chan, ast_best_codec(p->chan->nativeformats));
 		ast_log( LOG_DEBUG, "Set read format, result '%d'\n", res);
 		if (res)
-			ast_log(LOG_WARNING, "Unable to set read format to %d\n", ast_best_codec(p->chan->nativeformats));
+			ast_log(LOG_WARNING, "Unable to set read format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
 	} else {
 		// Agent hung-up
 		p->chan = NULL;
@@ -348,7 +348,7 @@
 		ast_set_write_format(p->chan, ast_best_codec(p->chan->nativeformats));
 		ast_log( LOG_DEBUG, "Set write format, result '%d'\n", res);
 		if (res)
-			ast_log(LOG_WARNING, "Unable to set write format to %d\n", ast_best_codec(p->chan->nativeformats));
+			ast_log(LOG_WARNING, "Unable to set write format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
 	}
 	if( !res )
 	{
@@ -900,8 +900,8 @@
 								"Channel: %s\r\n",
 								p->agent, chan->name);
 							if (option_verbose > 2)
-								ast_verbose(VERBOSE_PREFIX_3 "Agent '%s' logged in (format %d/%d)\n", p->agent,
-												chan->readformat, chan->writeformat);
+								ast_verbose(VERBOSE_PREFIX_3 "Agent '%s' logged in (format %s/%s)\n", p->agent,
+												ast_getformatname(chan->readformat), ast_getformatname(chan->writeformat));
 							/* Login this channel and wait for it to
 							   go away */
 							p->chan = chan;
diff -u -r1.9 chan_iax.c
--- channels/chan_iax.c	19 May 2003 00:48:48 -0000	1.9
+++ channels/chan_iax.c	16 Jul 2003 20:26:23 -0000
@@ -2256,7 +2256,7 @@
 static int iax_show_channels(int fd, int argc, char *argv[])
 {
 #define FORMAT2 "%-15.15s  %-10.10s  %-11.11s  %-11.11s  %-7.7s  %-6.6s  %s\n"
-#define FORMAT  "%-15.15s  %-10.10s  %5.5d/%5.5d  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %d\n"
+#define FORMAT  "%-15.15s  %-10.10s  %5.5d/%5.5d  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %-6.6s\n"
 	int x;
 	int numchans = 0;
 	if (argc != 3)
@@ -2271,7 +2271,7 @@
 						iaxs[x]->oseqno, iaxs[x]->iseqno, 
 						iaxs[x]->lag,
 						iaxs[x]->jitter,
-						iaxs[x]->voiceformat);
+						ast_getformatname(iaxs[x]->voiceformat) );
 			numchans++;
 		}
 		ast_pthread_mutex_unlock(&iaxsl[x]);
@@ -3727,7 +3727,7 @@
 						iaxs[fr.callno]->peerformat = iax_capability;
 				}
 				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %d)\n", inet_ntoa(iaxs[fr.callno]->addr.sin_addr), iaxs[fr.callno]->peerformat);
+					ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %s)\n", inet_ntoa(iaxs[fr.callno]->addr.sin_addr), ast_getformatname(iaxs[fr.callno]->peerformat));
 				if (!(iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability)) {
 					send_command_final(iaxs[fr.callno], AST_FRAME_IAX, AST_IAX_COMMAND_REJECT, 0, "Unable to negotiate codec", strlen("Unable to negotiate codec"), -1);
 					ast_log(LOG_NOTICE, "Rejected call to %s, format 0x%x incompatible with our capability 0x%x.\n", inet_ntoa(sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->capability);
@@ -3861,7 +3861,7 @@
 					/* Select an appropriate format */
 					format = iaxs[fr.callno]->peerformat & iax_capability;
 					if (!format) {
-						ast_log(LOG_DEBUG, "We don't do requested format %d, falling back to peer capability %d\n", iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability);
+						ast_log(LOG_DEBUG, "We don't do requested format %s, falling back to peer capability %d\n", ast_getformatname(iaxs[fr.callno]->peerformat), iaxs[fr.callno]->peercapability);
 						format = iaxs[fr.callno]->peercapability & iax_capability;
 						if (!format) {
 							ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible  with our capability 0x%x.\n", inet_ntoa(sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iax_capability);
diff -u -r1.33 chan_iax2.c
--- channels/chan_iax2.c	16 Jul 2003 18:45:12 -0000	1.33
+++ channels/chan_iax2.c	16 Jul 2003 20:26:26 -0000
@@ -2425,7 +2425,7 @@
 static int iax2_show_channels(int fd, int argc, char *argv[])
 {
 #define FORMAT2 "%-15.15s  %-10.10s  %-11.11s  %-11.11s  %-7.7s  %-6.6s  %s\n"
-#define FORMAT  "%-15.15s  %-10.10s  %5.5d/%5.5d  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %d\n"
+#define FORMAT  "%-15.15s  %-10.10s  %5.5d/%5.5d  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %-6.6s\n"
 	int x;
 	int numchans = 0;
 	if (argc != 3)
@@ -2440,7 +2440,7 @@
 						iaxs[x]->oseqno, iaxs[x]->iseqno, 
 						iaxs[x]->lag,
 						iaxs[x]->jitter,
-						iaxs[x]->voiceformat);
+						ast_getformatname(iaxs[x]->voiceformat) );
 			numchans++;
 		}
 		ast_pthread_mutex_unlock(&iaxsl[x]);
@@ -4097,7 +4097,7 @@
 						iaxs[fr.callno]->peerformat = iax2_capability;
 				}
 				if (option_verbose > 2)
-					ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %d)\n", inet_ntoa(iaxs[fr.callno]->addr.sin_addr), iaxs[fr.callno]->peerformat);
+					ast_verbose(VERBOSE_PREFIX_3 "Call accepted by %s (format %s)\n", inet_ntoa(iaxs[fr.callno]->addr.sin_addr), ast_getformatname(iaxs[fr.callno]->peerformat));
 				if (!(iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability)) {
 					memset(&ied0, 0, sizeof(ied0));
 					iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
@@ -4235,7 +4235,7 @@
 					/* Select an appropriate format */
 					format = iaxs[fr.callno]->peerformat & iax2_capability;
 					if (!format) {
-						ast_log(LOG_DEBUG, "We don't do requested format %d, falling back to peer capability %d\n", iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability);
+						ast_log(LOG_DEBUG, "We don't do requested format %s, falling back to peer capability %d\n", ast_getformatname(iaxs[fr.callno]->peerformat), iaxs[fr.callno]->peercapability);
 						format = iaxs[fr.callno]->peercapability & iax2_capability;
 						if (!format) {
 							ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible  with our capability 0x%x.\n", inet_ntoa(sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iax2_capability);
diff -u -r1.3 chan_modem.c
--- channels/chan_modem.c	27 Apr 2003 21:34:27 -0000	1.3
+++ channels/chan_modem.c	16 Jul 2003 20:26:26 -0000
@@ -790,7 +790,7 @@
 					} else
 						ast_log(LOG_WARNING, "Device '%s' is busy\n", p->dev);
 				} else 
-					ast_log(LOG_WARNING, "Asked for a format %d line on %s\n", format, p->dev);
+					ast_log(LOG_WARNING, "Asked for a format %s line on %s\n", ast_getformatname(format), p->dev);
 				break;
 			}
 		}
diff -u -r1.5 chan_phone.c
--- channels/chan_phone.c	27 Apr 2003 18:13:11 -0000	1.5
+++ channels/chan_phone.c	16 Jul 2003 20:26:26 -0000
@@ -270,7 +270,7 @@
 			}
 		}
 	} else {
-		ast_log(LOG_WARNING, "Can't do format %d\n", ast->pvt->rawreadformat);
+		ast_log(LOG_WARNING, "Can't do format %s\n", ast_getformatname(ast->pvt->rawreadformat));
 		return -1;
 	}
 	if (ioctl(p->fd, PHONE_REC_START)) {
diff -u -r1.131 chan_sip.c
--- channels/chan_sip.c	15 Jul 2003 05:05:19 -0000	1.131
+++ channels/chan_sip.c	16 Jul 2003 20:26:28 -0000
@@ -1649,7 +1649,7 @@
 					return -1;
 				}
 				if (sipdebug)
-					ast_verbose("Found audio format %d\n", codec);
+					ast_verbose("Found audio format %s\n", ast_getformatname(codec));
 				ast_rtp_set_m_type(p->rtp, codec);
 				codecs += len;
 				/* Skip over any whitespace */
@@ -1667,7 +1667,7 @@
 					return -1;
 				}
 				if (sipdebug)
-					ast_verbose("Found video format %d\n", codec);
+					ast_verbose("Found video format %s\n", ast_getformatname(codec));
 				ast_rtp_set_m_type(p->vrtp, codec);
 				codecs += len;
 				/* Skip over any whitespace */
@@ -3770,7 +3770,7 @@
 static int sip_show_channels(int fd, int argc, char *argv[])
 {
 #define FORMAT2 "%-15.15s  %-10.10s  %-11.11s  %-11.11s  %-7.7s  %-6.6s  %s\n"
-#define FORMAT  "%-15.15s  %-10.10s  %-11.11s  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %d\n"
+#define FORMAT  "%-15.15s  %-10.10s  %-11.11s  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %-6.6s\n"
 	struct sip_pvt *cur;
 	int numchans = 0;
 	if (argc != 3)
@@ -3786,7 +3786,7 @@
 						cur->ocseq, cur->icseq, 
 						0,
 						0,
-						cur->owner ? cur->owner->nativeformats : 0);
+						ast_getformatname(cur->owner ? cur->owner->nativeformats : 0) );
 		numchans++;
 		}
 		cur = cur->next;
@@ -3871,7 +3876,7 @@
 	if (p->owner) {
 		if (strlen(buf)) {
 			if (sipdebug)
-				ast_verbose("DTMF received: '%c'\n", buf[0]);
+				ast_verbose("DTMF received: '%c' (phone said %s)\n", buf[0], c);
 			memset(&f, 0, sizeof(f));
 			f.frametype = AST_FRAME_DTMF;
 			f.subclass = buf[0];
@@ -5074,7 +5079,7 @@
 	oldformat = format;
 	format &= capability;
 	if (!format) {
-		ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %d while capability is %d\n", oldformat, capability);
+		ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %s while capability is %s\n", ast_getformatname(oldformat), ast_getformatname(capability));
 		return NULL;
 	}
 	p = sip_alloc(NULL, NULL, 0);
diff -u -r1.68 chan_zap.c
--- channels/chan_zap.c	2 Jul 2003 21:56:03 -0000	1.68
+++ channels/chan_zap.c	16 Jul 2003 20:26:31 -0000
@@ -3138,7 +3138,7 @@
 				ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to campanded mode.\n", p->channel, index);
 		}
 	} else {
-		ast_log(LOG_WARNING, "Don't know how to read frames in format %d\n", ast->pvt->rawreadformat);
+		ast_log(LOG_WARNING, "Don't know how to read frames in format %s\n", ast_getformatname(ast->pvt->rawreadformat));
 		pthread_mutex_unlock(&p->lock);
 		return NULL;
 	}
diff -u -r1.2 chan_zap_old.c
--- channels/chan_zap_old.c	27 Apr 2003 18:13:11 -0000	1.2
+++ channels/chan_zap_old.c	16 Jul 2003 20:26:33 -0000
@@ -2842,7 +2842,7 @@
 				ast_log(LOG_WARNING, "Unable to set channel %d (index %d) to campanded mode.\n", p->channel, index);
 		}
 	} else {
-		ast_log(LOG_WARNING, "Don't know how to read frames in format %d\n", ast->pvt->rawreadformat);
+		ast_log(LOG_WARNING, "Don't know how to read frames in format %s\n", ast_getformatname(ast->pvt->rawreadformat));
 		pthread_mutex_unlock(&p->lock);
 		return NULL;
 	}
diff -u -r1.8 frame.h
--- include/asterisk/frame.h	28 Jun 2003 16:40:02 -0000	1.8
+++ include/asterisk/frame.h	16 Jul 2003 20:26:33 -0000
@@ -309,6 +309,14 @@
 
 //! Get a format from a name
 /*!
+ * \param format id of format
+ * Gets the name of a format.
+ * This returns the name of the format in a sttring or UNKN if unknown.
+ */
+//! Get the name of a format
+extern char* ast_getformatname(int format);
+
+/*!
  * \param name string of format
  * Gets a format from a name.
  * This returns the form of the format in binary on success, 0 on error.
diff -u -r1.1.1.5 res_musiconhold.c
--- res/res_musiconhold.c	18 Mar 2003 06:00:18 -0000	1.1.1.5
+++ res/res_musiconhold.c	16 Jul 2003 20:26:34 -0000
@@ -351,7 +351,7 @@
 	free(moh);
 	if (chan) {
 		if (oldwfmt && ast_set_write_format(chan, oldwfmt)) 
-			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %d\n", chan->name, oldwfmt);
+			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(oldwfmt));
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name);
 	}
