bridge: Add a deferred queue.
authorJoshua Colp <jcolp@digium.com>
Thu, 8 Jun 2017 19:38:51 +0000 (19:38 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 13 Jun 2017 22:06:15 +0000 (17:06 -0500)
commitd6386a8f0ca635ba770c1d102f69361beebef7d6
tree33a51988fc9400a2993dcce7a8287852004eddb0
parentabe1dd303909416a1b57747bdb162b82fb08f72b
bridge: Add a deferred queue.

This change adds a deferred queue to bridging. If a bridge
technology determines that a frame can not be written and
should be deferred it can indicate back to bridging to do so.
Bridging will then requeue any deferred frames upon a new
channel joining the bridge.

This change has been leveraged for T.38 request negotiate
control frames. Without the deferred queue there is a race
condition between the bridge receiving the T.38 request
negotiate and the second channel joining and being in the
bridge. If the channel is not yet in the bridge then the T.38
negotiation fails.

A unit test has also been added that confirms that a T.38
request negotiate control frame is deferred when no other
channel is in the bridge and that it is requeued when a new
channel joins the bridge.

ASTERISK-26923

Change-Id: Ie05b08523f399eae579130f4a5f562a344d2e415
bridges/bridge_native_rtp.c
bridges/bridge_simple.c
include/asterisk/bridge_channel.h
include/asterisk/bridge_channel_internal.h
include/asterisk/bridge_technology.h
main/bridge.c
main/bridge_channel.c
tests/test_bridging.c [new file with mode: 0644]