Bridge all the things! - Matt Jordan
Bridging is the act of taking two (or perhaps multiple) things and connecting them together so they can exchange information. I purposely explained this in a generic fashion because bridging is not a VoIP or Asterisk concept. It’s applicable elsewhere. Whether we realize this or not it’s happening every day in our lives.
Bridging within Asterisk has traditionally been very simplistic. Take channel ‘A’ and bidirectionally connect to channel ‘B’. Within the core information is then exchanged back and forth. If something comes in from ‘A’ it is given to ‘B’ and vice versa. Things become a little bit more complicated when you have the idea that things can be more efficiently connected (referred to as a native bridge). Instead of the connection happening within Asterisk it is sometimes pushed externally so ‘A’ and ‘B’ talk directly.
This simplistic view of bridging within Asterisk has served it well for quite sometime but it lacks control. No external entity can control the bridging operation. Some good examples are replacing a channel in a bridge or adding a third participant. With the old bridging architecture this is just not possible.
Asterisk 12 changes this.
The bridging architecture within Asterisk 12 has made bridges a first class object and made them more pluggable. This means that operations can be invoked on a bridge to perform various useful operations. The end result is a simplification of other common features you may use every day.
Fun fact: The bridging architecture has actually been used by the ConfBridge dialplan application since it was written.
Attended transfers are a prime example. Previously since there was no bridge control mechanism the act of completing an attended transfer involved ripping the internal guts of one channel and stuffing it into another. This is both costly and complicated. In Asterisk 12 when completing an attended transfer a channel is simply moved from one bridge to another.
The new bridging architecture also makes very cool things possible now! If you are performing a DTMF based attended transfer you have the option of turning it into a three way call. This uses the pluggable aspect of the bridging architecture. Different modules implement different approaches for bridging channels with different sets of functionality. The bridging core can move between them when conditions change. Originally your call may start out as a native bridge and then move to a multiple participant mixing bridge transparently! How awesome is that?
What do I need to do to take advantage of all of this?
The simple answer is… nothing. The old way for bridging things is gone from Asterisk 12. Any place that does bridging is now using the completely new bridging architecture and in some cases without you even realizing it. It should just work.
In a future post I’ll talk about why this bridging architecture is useful for things like ARI but for now you may want to take it for a spin!
Cheers,