From: Anthony Minessale Date: Fri, 1 Sep 2017 16:19:34 +0000 (-0500) Subject: FS-10637: [core] FreeSWITCH crash in 'enterprise originate' API caused due to fix... X-Git-Tag: v1.8.0~283 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c524021cae47fb960368ca16b4698cc79457cce;p=thirdparty%2Ffreeswitch.git FS-10637: [core] FreeSWITCH crash in 'enterprise originate' API caused due to fix done for FS-10596 #resolve --- diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index e3944e7cb9..1b4b1f34b7 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1672,12 +1672,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess *bleg = hp->bleg; if (*bleg) { switch_channel_t *bchan = switch_core_session_get_channel(*bleg); - switch_caller_profile_t *cloned_profile, *peer_profile = switch_channel_get_caller_profile(switch_core_session_get_channel(*bleg)); - if (peer_profile && (cloned_profile = switch_caller_profile_clone(session, peer_profile))) { - switch_channel_set_originatee_caller_profile(channel, cloned_profile); - } - if (bchan && cp && (cloned_profile = switch_caller_profile_clone(*bleg, cp))) { + switch_caller_profile_t *cloned_profile; + + if (session) { + cloned_profile = switch_caller_profile_clone(*bleg, cp); switch_channel_set_originator_caller_profile(bchan, cloned_profile); + + cloned_profile = switch_caller_profile_clone(session, switch_channel_get_caller_profile(bchan)); + switch_channel_set_originatee_caller_profile(channel, cloned_profile); } } switch_mutex_unlock(hp->mutex);