From 2b62309fb0c4d304fa6a2bddbbf563fa0e3999b7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 20:11:59 -0600 Subject: [PATCH] FS-5994 --- src/switch_ivr_bridge.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index 958b16fd67..8859ee2295 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -962,18 +962,12 @@ static switch_status_t sb_on_dtmf(switch_core_session_t *session, const switch_d static switch_status_t hanguphook(switch_core_session_t *session) { - switch_core_session_message_t msg = { 0 }; + switch_core_session_message_t *msg = NULL; switch_channel_t *channel = NULL; switch_event_t *event; channel = switch_core_session_get_channel(session); - - msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; - msg.from = __FILE__; - msg.string_arg = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE); - - if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { switch_channel_clear_flag_recursive(channel, CF_BRIDGE_ORIGINATOR); if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { @@ -982,8 +976,14 @@ static switch_status_t hanguphook(switch_core_session_t *session) } } + + msg = switch_core_session_alloc(session, sizeof(*msg)); + MESSAGE_STAMP_FFL(msg); + msg->message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; + msg->from = __FILE__; + msg->string_arg = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE); + switch_core_session_queue_message(session, msg); - switch_core_session_receive_message(session, &msg); switch_core_event_hook_remove_state_change(session, hanguphook); return SWITCH_STATUS_SUCCESS;