diff --git a/cdr.c b/cdr.c
index 328a20b5144b05de7084bb65500487223843a848..ebb3af1bb3c3b14ca9f42ec356d1407a9ab1a27d 100755
--- a/cdr.c
+++ b/cdr.c
@@ -290,6 +290,7 @@ int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *c)
 			if (!ast_strlen_zero(cdr->channel)) 
 				ast_log(LOG_WARNING, "CDR already initialized on '%s'\n", chan); 
 			strncpy(cdr->channel, c->name, sizeof(cdr->channel) - 1);
+			cdr->chan = c;
 			/* Grab source from ANI or normal Caller*ID */
 			if (c->cid.cid_ani)
 				num = c->cid.cid_ani;
diff --git a/cli.c b/cli.c
index c6be4fefed87e00c0ae7a1ac3986b993e21d8210..23c39b6e663d94d07379502aa7bbb65e3dede7dd 100755
--- a/cli.c
+++ b/cli.c
@@ -17,6 +17,7 @@
 #include <asterisk/options.h>
 #include <asterisk/cli.h>
 #include <asterisk/module.h>
+#include <asterisk/pbx.h>
 #include <asterisk/channel.h>
 #include <asterisk/channel_pvt.h>
 #include <asterisk/manager.h>
@@ -597,6 +598,7 @@ static int handle_showchan(int fd, int argc, char *argv[])
 {
 	struct ast_channel *c=NULL;
 	struct timeval now;
+	char buf[1024];
 	long elapsed_seconds=0;
 	int hour=0, min=0, sec=0;
 	if (argc != 3)
@@ -649,6 +651,9 @@ static int handle_showchan(int fd, int argc, char *argv[])
 	c->context, c->exten, c->priority, c->callgroup, c->pickupgroup, ( c->appl ? c->appl : "(N/A)" ),
 	( c-> data ? (!ast_strlen_zero(c->data) ? c->data : "(Empty)") : "(None)"),
 	c->stack, (c->blocking ? c->blockproc : "(Not Blocking)"));
+			if(pbx_builtin_serialize_variables(c,buf,sizeof(buf)))
+				ast_cli(fd,"Variables:\n%s\n",buf);
+
 		ast_mutex_unlock(&c->lock);
 		break;
 		}
diff --git a/include/asterisk/cdr.h b/include/asterisk/cdr.h
index 807ad6419891f10470678b14ece46a02207bbe9a..6c0d12319f6af6eafb22d64e455cfd8f6ad6bd49 100755
--- a/include/asterisk/cdr.h
+++ b/include/asterisk/cdr.h
@@ -78,6 +78,7 @@ struct ast_cdr {
 	char uniqueid[32];
 	/* User field */
 	char userfield[AST_MAX_USER_FIELD];
+	struct ast_channel *chan;
 	struct ast_cdr *next;
 };
 
diff --git a/include/asterisk/pbx.h b/include/asterisk/pbx.h
index 1a8b7e50261e0b3b7064f6dc6d0a4ecc176c2408..96e3de71ce6bb4e0eaf718b8fcada2358b569ae5 100755
--- a/include/asterisk/pbx.h
+++ b/include/asterisk/pbx.h
@@ -542,6 +542,7 @@ struct ast_ignorepat *ast_walk_context_ignorepats(struct ast_context *con,
 	struct ast_ignorepat *ip);
 struct ast_sw *ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw);
 
+int pbx_builtin_serialize_variables(struct ast_channel *chan, char *buf, size_t size);
 extern char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name);
 extern void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value);
 extern void pbx_builtin_clear_globals(void);
diff --git a/pbx.c b/pbx.c
index b5696e028fce55172dc5da42de661aadbed3cbba..4426eec39efba465993e239ed124e240f60b3dfa 100755
--- a/pbx.c
+++ b/pbx.c
@@ -4903,6 +4903,28 @@ static int pbx_builtin_goto(struct ast_channel *chan, void *data)
 	return 0;
 }
 
+int pbx_builtin_serialize_variables(struct ast_channel *chan, char *buf, size_t size) 
+{
+	struct ast_var_t *variables;
+	struct varshead *headp;
+	int total = 0;
+
+	memset(buf,0,size);
+	if (chan) {
+		headp=&chan->varshead;
+		AST_LIST_TRAVERSE(headp,variables,entries) {
+			snprintf(buf + strlen(buf), size - strlen(buf), "%s=%s\n", ast_var_name(variables), ast_var_value(variables));
+			if(strlen(buf) >= size) {
+				ast_log(LOG_ERROR,"Data Buffer Size Exceeded!\n");
+				break;
+			}
+			total++;
+		}
+	}
+	
+	return total;
+}
+
 char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name) 
 {
 	struct ast_var_t *variables;