From 8435535300a2d205fe13b54cf2e4bd60f91492d5 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Wed, 11 Feb 2009 14:44:47 +0000 Subject: [PATCH] Tell the device state core a change happened when a channel is freed but not a specific state. We need to do this because while we know that the freeing of the channel may cause something to become not in use we do not know this for sure. There may be another channel that is still up which would cause it to be in use. (closes issue #13238) Reported by: kowalma Patches: 20090121__bug13238.diff.txt uploaded by Corydon76 (license 14) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174844 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/channel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/channel.c b/main/channel.c index 4f613f4395..4510ce2523 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1410,7 +1410,10 @@ void ast_channel_free(struct ast_channel *chan) ast_free(chan); AST_RWLIST_UNLOCK(&channels); - ast_devstate_changed_literal(AST_DEVICE_NOT_INUSE, name); + /* Queue an unknown state, because, while we know that this particular + * instance is dead, we don't know the state of all other possible + * instances. */ + ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, name); } struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid)