Repository navigation
fix(calls): read a recording sent as octet-stream by its file name's extension - #149
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 answersapplication/octet-stream;charset=utf-8and names the file….mp3inContent-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.downloadalso returnsContent-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 inContent-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.changes/fix-recording-octet-stream.md.cli-core's
formatOfreads the format from the bytes, but@wirecat/cli-core/speechdoes not export it; the file name is enough here without a cli-core release.Testing
src/calls/calls.test.ts: an octet-stream recording withfilename="call-1.mp3"is transcribed, one without a file name is refused asrecording.not-audio. It fails without the fix.pnpm test581/581, typecheck, lint, docs:check, contracts:check, generate:check, the test matrix, the fragment check.🤖 Generated with Claude Code