features: Fix crash when transferee hangs up during DTMF attended transfer.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 5 May 2015 23:17:54 +0000 (18:17 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 5 May 2015 23:23:38 +0000 (18:23 -0500)
commit6c4d1c3223f174e4f2c6c5334630b762030bf610
treeb90d916bef325ae306e0a294636672f029580a49
parentbebf0b9b27e06f45c87162abae9efd822a9630a5
features: Fix crash when transferee hangs up during DTMF attended transfer.

A crash happens with this sequence of steps:
1) Party A is connected to party B.
2) Party B starts a DTMF attended transfer.
3) Party A hangs up while party B is dialing party C.

When party A hangs up the bridge that party A and party B are in is
dissolved and party B is kicked out of the bridge.  When party B finishes
dialing party C he attempts to move to the new bridge with party C.  Since
party B is no longer in a bridge the attempted move dereferences a NULL
bridge_channel pointer and crashes.

* Made the hold(), unhold(), ringing(), and the bridge_move() functions
tolerant of the channel not being in a bridge.  The assertion that party B
is always in a bridge is not true if the bridged peer of party B hangs up
and dissolves the bridge.  Being tolerant of not being in a bridge allows
the peer hangup stimulus to be processed by the FSM.

* Made the bridge_move() function return void since where the return value
for a failed move was checked generated a FSM coding ERROR message for a
normal off-nominal condition.

* Eliminated most uses of RAII_VAR in bridge_basic.c.

ASTERISK-25003 #close
Reported by: Artem Volodin

Change-Id: Ie2c1b14e5e647d4ea6de300bf56d69805d7bcada
main/bridge_basic.c