diff --git a/apps/app_dial.c b/apps/app_dial.c
index f59aeb4ecc9b7096d569fd24ea93e23493ca41af..1da4c8b5f3a167a25975d8be912c86be87a00893 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1991,6 +1991,10 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
 			theapp = pbx_findapp("Macro");
 
 			if (theapp && !res) { /* XXX why check res here ? */
+				/* Set peer->exten and peer->context so that MACRO_EXTEN and MACRO_CONTEXT get set */
+				ast_copy_string(peer->context, chan->context, sizeof(peer->context));
+				ast_copy_string(peer->exten, chan->exten, sizeof(peer->exten));
+
 				replace_macro_delimiter(opt_args[OPT_ARG_CALLEE_MACRO]);
 				res = pbx_exec(peer, theapp, opt_args[OPT_ARG_CALLEE_MACRO]);
 				ast_debug(1, "Macro exited with status %d\n", res);