diff --git a/src/switch_core_session.c b/src/switch_core_session.c index d400e1faa3..6919012660 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -463,7 +463,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_ } } - if (peer_profile) { + if (peer_profile && !(flags & SOF_FORKED_DIAL)) { if ((cloned_profile = switch_caller_profile_clone(session, peer_profile)) != 0) { switch_channel_set_originatee_caller_profile(channel, cloned_profile); } diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 7f3b8346dc..c6bca07a73 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -2118,6 +2118,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } if (*bleg) { + if (caller_channel && !switch_channel_get_originatee_caller_profile(caller_channel)) { + switch_caller_profile_t *cloned_profile, *peer_profile = switch_channel_get_caller_profile(switch_core_session_get_channel(*bleg)); + + if (peer_profile) { + if ((cloned_profile = switch_caller_profile_clone(*bleg, peer_profile)) != 0) { + switch_channel_set_originatee_caller_profile(caller_channel, cloned_profile); + } + } + } + switch_ivr_sleep(*bleg, 0, SWITCH_TRUE, NULL); }