Fixed a consistency problem with channel snapshot and endpoint state.

When channels are added to an endpoint, the code originally posted a channel
snapshot to the endoint's topic directly. Turns out, this is a bad idea.

This causes the endpoint to see an inconsistent view of the channel, since it
will later receive in-flight messages with old channel snapshots.

This patch instead just publishes channel state immediately after setting up
the forward to the endpoint's topic. This gives the endpoints a consistent
view of the channel's state.


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@390472 f38db490-d61c-443f-a65b-d21fe96a405b
Publish the channel state snapshot *before* calling device state so a device state producer can use
an up to date snapshot.


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@390473 f38db490-d61c-443f-a65b-d21fe96a405b