]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_websocket: Fix codec validation and add passthrough option.
authorGeorge Joseph <gjoseph@sangoma.com>
Wed, 17 Sep 2025 13:21:48 +0000 (07:21 -0600)
committerGeorge Joseph <gjoseph@sangoma.com>
Thu, 25 Sep 2025 13:09:20 +0000 (07:09 -0600)
commit8e938fda9173414638206e6aaf827338ffee80a0
tree3e8fb8be1394bf3abd78a7c5aef5d778dac464c9
parent99dbcbb1d0bbf15c3dcfe0e467eed09fa90ca703
chan_websocket: Fix codec validation and add passthrough option.

* Fixed an issue in webchan_write() where we weren't detecting equivalent
  codecs properly.
* Added the "p" dialstring option that puts the channel driver in
  "passthrough" mode where it will not attempt to re-frame or re-time
  media coming in over the websocket from the remote app.  This can be used
  for any codec but MUST be used for codecs that use packet headers or whose
  data stream can't be broken up on arbitrary byte boundaries. In this case,
  the remote app is fully responsible for correctly framing and timing media
  sent to Asterisk and the MEDIA text commands that could be sent over the
  websocket are disabled.  Currently, passthrough mode is automatically set
  for the opus, speex and g729 codecs.
* Now calling ast_set_read_format() after ast_channel_set_rawreadformat() to
  ensure proper translation paths are set up when switching between native
  frames and slin silence frames.  This fixes an issue with codec errors
  when transcode_via_sln=yes.

Resolves: #1462
channels/chan_websocket.c