Publish the outbound channel's application/data when dialing
authorMatthew Jordan <mjordan@digium.com>
Fri, 17 May 2013 17:43:58 +0000 (17:43 +0000)
committerMatthew Jordan <mjordan@digium.com>
Fri, 17 May 2013 17:43:58 +0000 (17:43 +0000)
commitd04f1fd60a5f5a6e358fbe5a59ae8f42d21cbbdf
treefd3e01c6b7b34f35f5d020bbfa641898de104147
parentb90bba7a303bf57c3c874a1c8f506d39d4e78a9c
Publish the outbound channel's application/data when dialing

This patch does two things:
* It fixes a bug where the outbound channel's application/data set by the
  dialing API/app_dial is not communicated until the channel is hung up.
  If that happens, AMI would incorrectly send a NewExten event immediately
  after a Hangup. This isn't really AMI's fault, as the dialing APIs never
  communicated the 'helpful' app/data on the outbound channel until it was
  hungup.
* It makes public sending a stasis message about a change in channel state.
  This is useful enough that - for now at least - it should be public. If
  operations on a channel go to being more coarse-grained, this function
  could be made private again.

Review: https://reviewboard.asterisk.org/r/2548

Note that this problem was found and reported by Matt DiMeo.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_dial.c
include/asterisk/stasis_channels.h
main/channel.c
main/dial.c
main/stasis_channels.c