Publish the channel state snapshot *before* calling device state so a device state...
authorJoshua Colp <jcolp@digium.com>
Wed, 5 Jun 2013 14:50:46 +0000 (14:50 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 5 Jun 2013 14:50:46 +0000 (14:50 +0000)
an up to date snapshot.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390473 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 1c2d6bf..62856d4 100644 (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;
 }