--- channel.c.141950 2009-01-26 21:16:48.000000000 +1300 +++ channel.c 2009-01-26 21:17:51.000000000 +1300 @@ -1357,7 +1357,7 @@ void ast_channel_free(struct ast_channel ast_free(chan); AST_RWLIST_UNLOCK(&channels); - ast_device_state_changed_literal(name); + ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, name); } struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid) @@ -4110,7 +4110,10 @@ int ast_setstate(struct ast_channel *cha chan->_state = state; - ast_device_state_changed_literal(name); + /* We have to pass AST_DEVICE_UNKNOWN here because it is entirely possible that the channel driver + * for this channel is using the callback method for device state. If we pass in an actual state here + * we override what they are saying the state is and things go amuck. */ + ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, name); /* setstate used to conditionally report Newchannel; this is no more */ manager_event(EVENT_FLAG_CALL,