Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PISTON-1170: Sets prepend_on_forward media content_type correctly. #6674

Conversation

tetrachromium
Copy link

The kzm_message:forward_message/4 function branches, depending on whether the user has recorded an additional message to be prepended to the voicemail message being forwarded. Prepending the additional message requires the two media files to be merged into a temporary file. This is then written to the database as an attachment.

Prior to this fix, the code assumed that the merged media file has an mp3 format, which is not necessarily true. In addition, it did not pass any content-type option to the kz_datamgr:put_attachment/5 function which actually writes the attachment. As a result, the attachment metadata in the database always indicated a content-type of application/octet-stream.

Calls to kz_media_util:join_media_files/2 now ensure that the merged output format is specified explicitly, rather than relying on default behaviour. The same format is also mapped to the corresponding MIME type which is passed to kz_datamgr:put_attachment/5 to ensure the attachment metadata is correct.

jamesaimonetti pushed a commit that referenced this pull request Dec 16, 2020
The `kzm_message:forward_message/4` function branches, depending on
whether the user has recorded an additional message to be prepended to
the voicemail message being forwarded. Prepending the additional
message requires the two media files to be merged into a temporary
file. This is then written to the database as an attachment.

Prior to this fix, the code assumed that the merged media file has an
`mp3` format, which is not necessarily true. In addition, it did not
pass any content-type option to the `kz_datamgr:put_attachment/5`
function which actually writes the attachment. As a result, the
attachment metadata in the database always indicated a content-type of
`application/octet-stream`.

Calls to `kz_media_util:join_media_files/2` now ensure that the merged
output format is specified explicitly, rather than relying on default
behaviour. The same format is also mapped to the corresponding MIME
type which is passed to `kz_datamgr:put_attachment/5` to ensure the
attachment metadata is correct.
@jamesaimonetti
Copy link
Member

Merged

lordnull pushed a commit to voxter/kazoo that referenced this pull request Sep 21, 2021
The kzm_message:forward_message/4 function branches, depending on whether the user has recorded an additional message to be prepended to the voicemail message being forwarded. Prepending the additional message requires the two media files to be merged into a temporary file. This is then written to the database as an attachment.

Prior to this fix, the code assumed that the merged media file has an mp3 format, which is not necessarily true. In addition, it did not pass any content-type option to the kz_datamgr:put_attachment/5 function which actually writes the attachment. As a result, the attachment metadata in the database always indicated a content-type of application/octet-stream.

Calls to kz_media_util:join_media_files/2 now ensure that the merged output format is specified explicitly, rather than relying on default behaviour. The same format is also mapped to the corresponding MIME type which is passed to kz_datamgr:put_attachment/5 to ensure the attachment metadata is correct.

Upstream pull requests:
4.3: 2600hz#6674
5: https://github.com/2600hz/kazoo-core/pull/170
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.

2 participants