From de802f2124a29c625c9d8a59a3d991f57294c701 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Jun 2013 11:23:45 -0500 Subject: [PATCH] FS-5498 fix state change --- src/switch_channel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index 99a26697b0..d1e5b0c701 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -4611,7 +4611,7 @@ static void fetch_device_stats(switch_device_record_t *drec) drec->stats.early++; } else if (np->callstate == CCS_RINGING) { drec->stats.ringing++; - } else { + } else if (np->callstate != CCS_DOWN) { drec->stats.active++; } } @@ -4766,6 +4766,12 @@ static void switch_channel_check_device_state(switch_channel_t *channel, switch_ } } + if (drec->state == SDS_DOWN && drec->last_state == SDS_DOWN) { + switch_mutex_unlock(drec->mutex); + switch_mutex_unlock(globals.device_mutex); + return; + } + switch(drec->state) { case SDS_ACTIVE: case SDS_ACTIVE_MULTI: