]> 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)
committerNaveen Albert <asterisk@phreaknet.org>
Thu, 16 Jan 2025 16:31:30 +0000 (16:31 +0000)
commit1b0cd8b10dc0f84199c0752b2441ebbbb6fce058
treed753cb4e31fa0993bbb2deb1bbe465a82e6a4a62
parent7e58e8d4f6cf550d58c0ce6cdbafc8e54ff6bf5b
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