Review Board 1.7.16

chan_pjsip/res_pjsip/bridge_softmix/core: Improve translation path choices.

Review Request #4609 - Created April 9, 2015 and submitted

With this patch, chan_pjsip/res_pjsip now sets the native formats to the
codecs negotiated by a call.

* The changes in chan_pjsip.c and res_pjsip_sdp_rtp.c set the native
formats to include all the negotiated audio codecs instead of only the
initial preferred audio codec and later the currently received audio

* The audio frame handling in channel.c:ast_read() is more streamlined and
will automatically adjust to changes in received frame formats.  The new
policy is to remove translation and pass the new frame format to the
receiver except if the translation was to a signed linear format.  A more
long winded version is commented in ast_read() along with some caveats.

* The audio frame handling in channel.c:ast_write() is more streamlined
and will automatically adjust any needed translation to changes in the
frame formats sent.  Frame formats sent can change for many reasons such
as a recording is being played back or the bridged peer changed the format
it sends.  Since it is a normal expectation that sent formats can change,
the codec mismatch warning message is demoted to a debug message.

* Removed the short circuit check in
channel.c:ast_channel_make_compatible_helper().  Two party bridges need to
make channels compatible with each other.  However, transfers and moving
channels among bridges can result in otherwise compatible channels having
sub-optimal translation paths if the make compatible check is short
circuited.  A result of forcing the reevaluation of channel compatibility
is that the asterisk.conf:transcode_via_slin and codecs.conf:genericplc
options take effect consistently now.  It is unfortunate that these two
options are enabled by default and negate some of the benefits to the
changes in channel.c:ast_read() by forcing translation through signed
linear on a two party bridge.

* Improved the softmix bridge technology to better control the translation
of frames to the bridge.  All of the incoming translation is now normally
handled by ast_read() instead of splitting any translation steps between
ast_read() and the slin factory.  If any frame comes in with an unexpected
format then the translation path in ast_read() is updated for the next
frame and the slin factory handles the current frame translation.

This is the final patch in a series of patches aimed at improving
translation path choices.  The other patches are on the following reviews:
* The testsuite still passes as well as it ever has.

* Manual SIP and DTMF attended transfers still function.  With all patches
in the series applied, if a low speed party transfers a higher speed party
to another high speed party then when the transfer completes the resulting
call works at the higher speed.  Without the patch the resulting call may
go through a sub-optimal translation path with reduced audio quality.

* ConfBridge bridges are able to change mixing rates as different speed
participants enter and leave the bridge.  Sound files played back to
individual participants may go out with a different codec than the
participant sends to the conference.  If the conference bridge is mixing
at a lower rate than a participant then the conference media may go out
with a different codec than the participant sends to the conference.

* Used app_originate to setup a call through a non-optimizing local
channel.  The resulting call used the same codecs as before the patch even
between parties with different speeds.
Description From Last Updated Status
Review request changed
Updated (April 10, 2015, 7:23 p.m.)
  • changed from pending to submitted
Committed in revision 434687 runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to