Originated calls: Fix several originate call problems.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 18 Apr 2014 16:44:48 +0000 (16:44 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 18 Apr 2014 16:44:48 +0000 (16:44 +0000)
commit51b6c49681c17d260aebc67e618f996b9a7f1176
treeec16e0af53fbf5ae405439c8ff08d8404f756a39
parentcbe7f656749f5cf7e4d8321ef74a99c9281a2284
Originated calls: Fix several originate call problems.

* Restore the reason value set by pbx_outgoing_attempt() to use
AST_CONTROL_xxx values as all the consumers were expecting rather than
cause codes.

* Fixed the dial routines to set cause codes for more than just
ast_request() so pbx_outgoing_attempt() reason codes will function.

* Fix inconsistent locked_channel return status in pbx_outgoing_attempt().
The chanel may not have been locked or the channel may have been a stale
pointer.

* Fixed the OutgoingSpoolFailed channel to run dialplan whenever the
dialing fails for an originate exten and 1 < synchronous.

* Fix incorrect ast_cond_wait() usage in pbx_outgoing_attempt().
Indroduced by issue ASTERISK-22212 patch.

* Made struct pbx_outgoing use the ao2 lock instead of its own lock for
the cond wait mutex.  No sense in having two locks associated with the
same struct when only one is needed.

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

Merged revisions 412581 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_originate.c
include/asterisk/pbx.h
main/dial.c
main/pbx.c