From 342678698c137f2df295efee88f4b0a0f91b734d Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 5 Jan 2011 10:17:31 -0500 Subject: [PATCH] set tracking data before enabling hooks --- src/mod/applications/mod_fifo/mod_fifo.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 3a6ef81353..e2cdfadeab 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -2101,17 +2101,18 @@ SWITCH_STANDARD_APP(fifo_track_call_function) return; } - switch_core_event_hook_add_receive_message(session, messagehook); - switch_core_event_hook_add_state_run(session, hanguphook); - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s tracking call on uuid %s!\n", switch_channel_get_name(channel), data); + switch_channel_set_variable(channel, "fifo_outbound_uuid", data); + switch_channel_set_variable(channel, "fifo_track_call", "true"); add_bridge_call(data); switch_channel_set_app_flag_key(FIFO_APP_KEY, channel, FIFO_APP_TRACKING); - switch_channel_set_variable(channel, "fifo_outbound_uuid", data); - switch_channel_set_variable(channel, "fifo_track_call", "true"); + switch_core_event_hook_add_receive_message(session, messagehook); + switch_core_event_hook_add_state_run(session, hanguphook); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s tracking call on uuid %s!\n", switch_channel_get_name(channel), data); + if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { col1 = "manual_calls_in_count";