]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_iax2: Avoid unnecessarily backlogging non-voice frames.
authorNaveen Albert <asterisk@phreaknet.org>
Fri, 10 Jan 2025 01:49:14 +0000 (20:49 -0500)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Thu, 16 Jan 2025 16:31:33 +0000 (16:31 +0000)
commitf6e1c163bb136bf43b889c3b310ed97b2e40e112
tree1636dac162b718c8daadacffe60755defb4366af
parent217e6962887fe303b4d538942e59499e54e1e0cd
chan_iax2: Avoid unnecessarily backlogging non-voice frames.

Currently, when receiving an unauthenticated call, we keep track
of the negotiated format in the chosenformat, which allows us
to later create the channel using the right format. However,
this was not done for authenticated calls. This meant that in
certain circumstances, if we had not yet received a voice frame
from the peer, only certain other types of frames (e.g. text),
there were no variables containing the appropriate frame.
This led to problems in the jitterbuffer callback where we
unnecessarily bailed out of retrieving a frame from the jitterbuffer.
This was logic intentionally added in commit 73103bdcd5b342ce5dfa32039333ffadad551151
in response to an earlier regression, and while this prevents
crashes, it also backlogs legitimate frames unnecessarily.

The abort logic was initially added because at this point in the
code, we did not have the negotiated format available to us.
However, it should always be available to us as a last resort
in chosenformat, so we now pull it from there if needed. This
allows us to process frames the jitterbuffer even if voicefmt
and peerfmt aren't set and still avoid the crash. The failsafe
logic is retained, but now it shouldn't be triggered anymore.

Resolves: #1054
channels/chan_iax2.c