]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5498 fix state change
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 11 Jun 2013 16:23:45 +0000 (11:23 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 11 Jun 2013 16:24:04 +0000 (11:24 -0500)
src/switch_channel.c

index 99a26697b015571371f03922ac07725cc4578649..d1e5b0c7015d0c4350c10cec1967dc3c8902f2bf 100644 (file)
@@ -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: