diff --git a/apps/app_agi.c b/apps/app_agi.c
index 3e332afc5224692c80eb4489fdec4c0cb07c6a0f..ce4f4506473b6d7431217c79ab58566f200ee957 100755
--- a/apps/app_agi.c
+++ b/apps/app_agi.c
@@ -1435,7 +1435,7 @@ static int eagi_exec(struct ast_channel *chan, void *data)
 	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 --git a/apps/app_voicemail2.c b/apps/app_voicemail2.c
index 0104149b6ae6c9396f630069a60281c28ef8d787..8d984554d91ab6026f4223640d331a7c158c9649 100755
--- a/apps/app_voicemail2.c
+++ b/apps/app_voicemail2.c
@@ -933,7 +933,7 @@ static int play_and_record(struct ast_channel *chan, char *playfile, char *recor
 	}
 	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 --git a/channel.c b/channel.c
index a97f0e8450b27fa69e9ea467ca4814e8ddabef0e..85215f703afd3cf1ef76b06a6f714351ba91c8a0 100755
--- a/channel.c
+++ b/channel.c
@@ -1083,7 +1083,7 @@ struct ast_frame *ast_read(struct ast_channel *chan)
 		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 {
@@ -1403,7 +1403,8 @@ int ast_set_write_format(struct ast_channel *chan, int fmts)
 	
 	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;
 	}
 	
@@ -1417,7 +1418,7 @@ int ast_set_write_format(struct ast_channel *chan, int fmts)
 	/* 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;
 }
 
@@ -1432,7 +1433,8 @@ int ast_set_read_format(struct ast_channel *chan, int fmts)
 	/* 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;
 	}
 	
@@ -1446,7 +1448,8 @@ int ast_set_read_format(struct ast_channel *chan, int fmts)
 	/* 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 --git a/channels/chan_agent.c b/channels/chan_agent.c
index ccc5e56e0bf25cd0beaeccdc9be430d0ceeccfa8..aeb867784aae5d36c02835f2c8451fbbe60c98e1 100755
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -398,7 +398,7 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
 		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;
@@ -408,7 +408,7 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
 		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 )
 	{
@@ -1046,8 +1046,8 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
 								"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 --git a/channels/chan_iax.c b/channels/chan_iax.c
index 1d1c354bbfb14afe4e917711812dd972df2b74c7..93f7172e9e651b3f2386026d8a6ed1ec3db9a9f2 100755
--- a/channels/chan_iax.c
+++ b/channels/chan_iax.c
@@ -2256,7 +2256,7 @@ static int iax_show_registry(int fd, int argc, char *argv[])
 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 @@ static int iax_show_channels(int fd, int argc, char *argv[])
 						iaxs[x]->oseqno, iaxs[x]->iseqno, 
 						iaxs[x]->lag,
 						iaxs[x]->jitter,
-						iaxs[x]->voiceformat);
+						ast_getformatname(iaxs[x]->voiceformat) );
 			numchans++;
 		}
 		ast_mutex_unlock(&iaxsl[x]);
@@ -3550,7 +3550,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
 		if (f.frametype == AST_FRAME_VOICE) {
 			if (f.subclass != iaxs[fr.callno]->voiceformat) {
 					iaxs[fr.callno]->voiceformat = f.subclass;
-					ast_log(LOG_DEBUG, "Ooh, voice format changed to %d\n", f.subclass);
+					ast_log(LOG_DEBUG, "Ooh, voice format changed to %s\n", ast_getformatname(f.subclass));
 					if (iaxs[fr.callno]->owner) {
 						int orignative;
 						ast_mutex_lock(&iaxs[fr.callno]->owner->lock);
@@ -3727,7 +3727,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
 						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);
@@ -3737,7 +3737,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
 						/* Switch us to use a compatible format */
 						iaxs[fr.callno]->owner->nativeformats = iaxs[fr.callno]->peerformat;
 						if (option_verbose > 2)
-							ast_verbose(VERBOSE_PREFIX_3 "Format for call is %d\n", iaxs[fr.callno]->owner->nativeformats);
+							ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr.callno]->owner->nativeformats));
 						/* Setup read/write formats properly. */
 						if (iaxs[fr.callno]->owner->writeformat)
 							ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat);	
@@ -3861,7 +3861,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
 					/* 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);
@@ -4224,7 +4224,7 @@ static struct ast_channel *iax_request(char *type, int format, void *data)
 			fmt = format;
 			res = ast_translator_best_choice(&fmt, &native);
 			if (res < 0) {
-				ast_log(LOG_WARNING, "Unable to create translator path for %d to %d on %s\n", c->nativeformats, fmt, c->name);
+				ast_log(LOG_WARNING, "Unable to create translator path for %s to %s on %s\n", ast_getformatname(c->nativeformats), ast_getformatname(fmt), c->name);
 				ast_hangup(c);
 				return NULL;
 			}
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 840b96490342228b56e14153c58bc76c873a9298..ff42b4ddf18c636bf2f86752cc960e1f6b8d9fe3 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -2433,7 +2433,7 @@ static int iax2_show_registry(int fd, int argc, char *argv[])
 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)
@@ -2448,7 +2448,7 @@ static int iax2_show_channels(int fd, int argc, char *argv[])
 						iaxs[x]->oseqno, iaxs[x]->iseqno, 
 						iaxs[x]->lag,
 						iaxs[x]->jitter,
-						iaxs[x]->voiceformat);
+						ast_getformatname(iaxs[x]->voiceformat) );
 			numchans++;
 		}
 		ast_mutex_unlock(&iaxsl[x]);
@@ -4105,7 +4105,7 @@ retryowner:
 						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");
@@ -4117,7 +4117,7 @@ retryowner:
 						/* Switch us to use a compatible format */
 						iaxs[fr.callno]->owner->nativeformats = iaxs[fr.callno]->peerformat;
 						if (option_verbose > 2)
-							ast_verbose(VERBOSE_PREFIX_3 "Format for call is %d\n", iaxs[fr.callno]->owner->nativeformats);
+							ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr.callno]->owner->nativeformats));
 						/* Setup read/write formats properly. */
 						if (iaxs[fr.callno]->owner->writeformat)
 							ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat);	
@@ -4243,7 +4243,7 @@ retryowner:
 					/* 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);
@@ -4652,7 +4652,7 @@ static struct ast_channel *iax2_request(char *type, int format, void *data)
 			fmt = format;
 			res = ast_translator_best_choice(&fmt, &native);
 			if (res < 0) {
-				ast_log(LOG_WARNING, "Unable to create translator path for %d to %d on %s\n", c->nativeformats, fmt, c->name);
+				ast_log(LOG_WARNING, "Unable to create translator path for %s to %s on %s\n", ast_getformatname(c->nativeformats), ast_getformatname(fmt), c->name);
 				ast_hangup(c);
 				return NULL;
 			}
diff --git a/channels/chan_modem.c b/channels/chan_modem.c
index b62002679a5f94031033c4a8c66c3a8137b0b2ea..de8237ff826bebf0dcc9ccb5d169ae22ea26941e 100755
--- a/channels/chan_modem.c
+++ b/channels/chan_modem.c
@@ -790,7 +790,7 @@ static struct ast_channel *modem_request(char *type, int format, void *data)
 					} 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 --git a/channels/chan_phone.c b/channels/chan_phone.c
index 5ae642a1f6ebd6dc5bd260115d17d3314f9ec7a8..2c99261193eafcacff2ec7fa08f4270ef5ea41fc 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -270,7 +270,7 @@ static int phone_setup(struct ast_channel *ast)
 			}
 		}
 	} 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 --git a/channels/chan_sip.c b/channels/chan_sip.c
index ba8cafa83da85aa5116876835bd5e3289346f2a0..343d9fd4356e8121eedad1d48c5e5b128fa1eb8e 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1724,7 +1724,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
 					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 */
@@ -1742,7 +1742,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
 					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 */
@@ -3883,7 +3883,7 @@ static int sip_show_registry(int fd, int argc, char *argv[])
 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)
@@ -3899,7 +3899,7 @@ static int sip_show_channels(int fd, int argc, char *argv[])
 						cur->ocseq, cur->icseq, 
 						0,
 						0,
-						cur->owner ? cur->owner->nativeformats : 0);
+						ast_getformatname(cur->owner ? cur->owner->nativeformats : 0) );
 		numchans++;
 		}
 		cur = cur->next;
@@ -5223,7 +5223,7 @@ static struct ast_channel *sip_request(char *type, int format, void *data)
 	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 --git a/channels/chan_zap.c b/channels/chan_zap.c
index 7c5680ea3b06623f438b7d6b550c927cdc604ce9..6b6a0482524e7332eda96ed482ae853e724da4f3 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -3180,7 +3180,7 @@ struct ast_frame  *zt_read(struct ast_channel *ast)
 				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));
 		ast_mutex_unlock(&p->lock);
 		return NULL;
 	}
diff --git a/channels/chan_zap_old.c b/channels/chan_zap_old.c
index c81b6e5c6ed48fdbe00012880ded754b19cd51ae..402b1b3c54fb249803c5334587ccf3d07422d6c4 100755
--- a/channels/chan_zap_old.c
+++ b/channels/chan_zap_old.c
@@ -2842,7 +2842,7 @@ struct ast_frame  *zt_read(struct ast_channel *ast)
 				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));
 		ast_mutex_unlock(&p->lock);
 		return NULL;
 	}
diff --git a/file.c b/file.c
index bad5f814e55e5a5fbd4c4e4af0ccca10ab84501a..dde3d2673e33a07784d1ad51ea480c45de1cac82 100755
--- a/file.c
+++ b/file.c
@@ -215,7 +215,7 @@ int ast_writestream(struct ast_filestream *fs, struct ast_frame *f)
 		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;
@@ -719,7 +719,7 @@ int ast_streamfile(struct ast_channel *chan, char *filename, char *preflang)
 #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 --git a/frame.c b/frame.c
index 6143671e7cf33723bb607aa8a84f15ec7d3b98b5..2e53f8d1e55c5671769e258d259c421792e8bbc6 100755
--- a/frame.c
+++ b/frame.c
@@ -343,6 +343,41 @@ int ast_fr_fdhangup(int fd)
 	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 "G729A";
+	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 @@ void ast_frame_dump(char *name, struct ast_frame *f, char *prefix)
 		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 --git a/image.c b/image.c
index 1b07b77b25a7b84ac0e9cc522e2c706a817f3fa2..c46396c79181428ed6a1f3e21375209ce6c99b11 100755
--- a/image.c
+++ b/image.c
@@ -175,14 +175,14 @@ int ast_send_image(struct ast_channel *chan, char *filename)
 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 --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index 37e681024a8ce9c593e90aada5d876cc85ea9ebf..bd1bb2a7287fea15924dc9787b749ce7b12f48c9 100755
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -308,6 +308,14 @@ int ast_fr_fdwrite(int fd, struct ast_frame *frame);
 int ast_fr_fdhangup(int fd);
 
 //! 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.
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 9ef8e55a39828eaa6d28ecad8af1bc96ff0f896f..487d6a2525521e7e1b09ccaff3af5d614709df55 100755
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -395,7 +395,7 @@ static void moh_release(struct ast_channel *chan, void *data)
 	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);
 	}
diff --git a/rtp.c b/rtp.c
index 484a4f69455464b0a3da0fc9c906b946c9c35bc3..03606b0245b752cba39bb0b8bf13dc762528c2af 100755
--- a/rtp.c
+++ b/rtp.c
@@ -477,7 +477,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
 			// 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 {
@@ -927,7 +927,7 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
 			// 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 */
@@ -995,13 +995,13 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
 
 	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);
@@ -1062,7 +1062,7 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
 			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 --git a/translate.c b/translate.c
index 01c52309be0199853b29708eaa5d56850ee8998c..0a31d8b7143cb7ce3618939f7d0559e683e37637 100755
--- a/translate.c
+++ b/translate.c
@@ -125,7 +125,8 @@ struct ast_trans_pvt *ast_translator_build_path(int dest, int source)
 			}
 		} 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 @@ static void rebuild_matrix(void)
 									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 void calc_cost(struct ast_translator *t)
 
 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_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 @@ int ast_register_translator(struct ast_translator *t)
 	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_mutex_lock(&list_lock);
 	if (!added_cli) {
 		ast_cli_register(&show_trans);