Skip to content

Commit

Permalink
KZOO-190: Fix wave (wav) voicemail recordings transcription
Browse files Browse the repository at this point in the history
  • Loading branch information
harenson committed Jul 1, 2021
1 parent 70372ba commit 7a10eca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/kazoo/src/kz_mime.erl.src
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ normalize_content_type(<<"application/pdf">>) -> <<"application/pdf">>;
normalize_content_type(<<"application/x-pdf">>) -> <<"application/pdf">>;
normalize_content_type(<<"text/pdf">>) -> <<"application/pdf">>;
normalize_content_type(<<"text/x-pdf">>) -> <<"application/pdf">>;
normalize_content_type(<<"audio/x-wav">>) -> <<"audio/wav">>;
normalize_content_type(<<_/binary>> = Else) -> Else;
normalize_content_type(CT) ->
normalize_content_type(kz_term:to_binary(CT)).
Expand Down
5 changes: 4 additions & 1 deletion core/kazoo_data/src/kzs_attachments.erl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ put_attachment(#{att_handler := {Handler, Params}}=Map

case Handler:put_attachment(Params, DbName, DocId, AName, Contents, Options) of
{'ok', Props} ->
CT = props:get_value('content_type', Options, kz_mime:from_filename(AName)),
CT = props:get_value('content_type'
,Options
,kz_mime:normalize_content_type(kz_mime:from_filename(AName))
),
Size = size(Contents),
Att = attachment_from_handler(AName, attachment_handler_jobj(Handler, Props), Size, CT),
handle_put_attachment(Map, Att, DbName, DocId, AName, Contents, Options, Props);
Expand Down

0 comments on commit 7a10eca

Please sign in to comment.