This patch fixes some pretty significant problems with how app_chanspy handles
pointers to channels that are being spied upon. It was very likely that a
crash would occur if the channel being spied upon hung up. This was because
the current ast_channel handling _requires_ that the object is locked or else
it could disappear at any time (except in the owning channel thread). So, this
patch uses some channel datastore magic on the spied upon channel to be able to
detect if and when the channel goes away.
(closes issue #11877)
(patch written by me, but thanks to kpfleming for the idea, and to file for review)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104106 614ede4d-c843-0410-af14-a771ab80d22e