PISTON-1170: Sets prepend_on_forward media content_type correctly. #6674
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.
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 thekz_datamgr:put_attachment/5
function which actually writes the attachment. As a result, the attachment metadata in the database always indicated a content-type ofapplication/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 tokz_datamgr:put_attachment/5
to ensure the attachment metadata is correct.