Publish the channel state snapshot *before* calling device state so a device state producer can use

an up to date snapshot.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2013-06-05 14:50:46 +00:00
parent f574a76e3e
commit fb6344e249

View File

@@ -7308,13 +7308,13 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state state)
ast_channel_state_set(chan, state);
ast_publish_channel_state(chan);
/* 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, (ast_test_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE) ? AST_DEVSTATE_NOT_CACHABLE : AST_DEVSTATE_CACHABLE), name);
ast_publish_channel_state(chan);
return 0;
}