From c9d6b801ab0b34684eba1b704da8f0c3ef4616fc Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthm@freeswitch.org>
Date: Tue, 30 Oct 2012 09:05:41 -0500
Subject: [PATCH] add calls to execute_on_post_originate for a leg too

---
 src/switch_ivr_originate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c
index ed8534cfc7..ffdb890de3 100644
--- a/src/switch_ivr_originate.c
+++ b/src/switch_ivr_originate.c
@@ -3727,6 +3727,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
 	switch_safe_free(fail_on_single_reject_var);
 
 	if (caller_channel) {
+
+		switch_channel_execute_on(caller_channel, SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE);
+		switch_channel_api_on(caller_channel, SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE);
+
 		switch_channel_clear_flag(caller_channel, CF_ORIGINATOR);
 		switch_channel_clear_flag(caller_channel, CF_XFER_ZOMBIE);
 	}