Skip to content

fix(calls): read a recording sent as octet-stream by its file name's extension - #149

Merged
leemour merged 1 commit into
mainfrom
fix/recording-octet-stream
Nov 17, 2026
Merged

leemour merged 1 commit into
mainfrom
fix/recording-octet-stream

Conversation

@leemour

@leemour leemour commented Nov 17, 2026

Copy link
Copy Markdown
Member

Task

After #148, the live check on a portal with a Beeline cloud PBX downloaded the recording, then failed with recording.not-audio. The provider's server answers application/octet-stream;charset=utf-8 and names the file ….mp3 in Content-Disposition. The bytes start with an MPEG Layer III frame sync (FF E3): it is an MP3. Only the signature and headers were read, not the audio.

What

  • BitrixTransport.download also returns Content-Disposition.
  • recordingsAt().fetch: when the type names no format (empty, application/octet-stream, binary/octet-stream), the format is the extension of the file name in Content-Disposition, and only one b24 already keeps (mp3, wav, ogg, m4a). Any other type keeps failing as before. The decoder reads the format from the bytes again, so a wrong name still fails there.
  • Fragment changes/fix-recording-octet-stream.md.

cli-core's formatOf reads the format from the bytes, but @wirecat/cli-core/speech does not export it; the file name is enough here without a cli-core release.

Testing

  • New test in src/calls/calls.test.ts: an octet-stream recording with filename="call-1.mp3" is transcribed, one without a file name is refused as recording.not-audio. It fails without the fix.
  • Live, before the push: this branch's build on the portal's throwaway store transcribed one call, 89 s of audio, no failures (totals only).
  • pnpm test 581/581, typecheck, lint, docs:check, contracts:check, generate:check, the test matrix, the fragment check.

🤖 Generated with Claude Code

…extension

A Beeline cloud PBX serves a call recording as application/octet-stream and names the file (.mp3) in
Content-Disposition. b24 took the format from the type alone and refused it as recording.not-audio, so after #148
the download worked but no call of that portal was transcribed.

When the type names no format (empty or octet-stream), the format comes from the Content-Disposition file name's
extension, only one b24 already keeps (mp3, wav, ogg, m4a). Checked on the live portal before the push: one call,
89 s of audio, transcribed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leemour
leemour merged commit 12c73b3 into main Nov 17, 2026
16 checks passed
@leemour
leemour deleted the fix/recording-octet-stream branch November 17, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant