From: Anthony Minessale Date: Wed, 24 Oct 2012 17:33:13 +0000 (-0500) Subject: only track calls once they have been answered X-Git-Tag: v1.3.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1e16ccbfa9bc0df6951f2ca9998b7d00221e29e;p=thirdparty%2Ffreeswitch.git only track calls once they have been answered --- diff --git a/src/switch_channel.c b/src/switch_channel.c index fd00c5f71e..5ccca55184 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -3395,6 +3395,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan switch_channel_audio_sync(channel); + switch_core_recovery_track(channel->session); + return SWITCH_STATUS_SUCCESS; } diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index e23d427a1b..80ab68c110 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -2722,6 +2722,10 @@ SWITCH_DECLARE(void) switch_core_recovery_untrack(switch_core_session_t *session char *sql = NULL; switch_channel_t *channel = switch_core_session_get_channel(session); + if (!switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_get_state(channel) < CS_SOFT_EXECUTE) { + return; + } + if (!switch_channel_test_flag(channel, CF_TRACKABLE)) { return; } @@ -2756,6 +2760,11 @@ SWITCH_DECLARE(void) switch_core_recovery_track(switch_core_session_t *session) const char *profile_name; const char *technology; + + if (!switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_get_state(channel) < CS_SOFT_EXECUTE) { + return; + } + if (switch_channel_test_flag(channel, CF_RECOVERING) || !switch_channel_test_flag(channel, CF_TRACKABLE)) { return; }