Jump to content

Kazoo cant get Voice messages from Amazon S3


abuzooz

Recommended Posts

Hi All

I recently implemented Amazon S3 storage to save voice message using below settings, saving is going great, however when I try to listen to my voice messages using my softphone or Yealink device, the call drops throwing below exception in Kazoo. what I noticed but not sure if this is relevant, when Kazoo tries to build the proxy URL, it is using account-monthyear ...etc while the settings in the storage plan build the URL as follows S3-URL/account_id/const/attachment

Where in the logs, if you see Kazoo is building the URL as follows --> building proxy URI: {<<"account%2Fba%2F47%2F74842e5840b29c5f6ab1784ad171-202010">>,<<"202010-381bd9efb3b8caafd80554e090a36c00">>,<<"15b051d51c4441cc77d0cf56e6d709ea.mp3">>,[{handler,{[{<<"kz_att_s3">>,{[{<<"S3">>, ..etc       which is different than the media url in S3. 

Not sure if this is the reason, and if so what am I doing wrong here?

Json used to build storage plan:

{"data":{

    "attachments": {
        "bb966f5b0af243bb835b6c07ca3120a7":{
            "handler":"s3",
            "name":"Kazoo S3",
            "settings":{
                "bucket":"test",
                 "key":"XXX",
                "secret":"X/XXXX",
                  "bucket_access_method":"auto",
                 
                 "field_list":[
                      {"arg":"account_id"},
                       {"const":"voicemail"},
                      {"arg":"attachment"}]                   
            }
        },
         "f8885bb42bdb4466a88847e2d6fbe1b2":{
            "handler":"s3",
            "name":"Kazoo S3",
            "settings":{
                "bucket":"talkchief",
                "key":"XXX",
                "secret":"XX/XX",
                "bucket_access_method":"auto",
               
                 "field_list":[
                      {"arg":"account_id"},
                       {"const":"recordings"},
                      {"arg":"attachment"}]
                      
            }
        }
    },
    
"plan":{
        "modb":{
            "types":{
             "call_recording":{
                  "attachments":{
                        "handler":"f8885bb42bdb4466a88847e2d6fbe1b2" 
                    }
},
            "mailbox_message":{
                  "attachments":{
                        "handler":"bb966f5b0af243bb835b6c07ca3120a7" 
                    }
}
            }
        }
    }
}}

 

 

Kazoo Error logs when trying to listen to voice messages

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_amqp_channel:221(<0.19072.238>) published(c13f0645b60df8c3dccb48c8ed9a0b94 334B) to callctl(amqp://guest:guest@10.1.0.100:5672) exchange (routing key ecallmgr@ecallmgr.deskwaves.com-ecallmgr_call_control-<0.28696.46>-cfd9382e) via <0.4367.238>

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:211(<0.19072.238>) answered the call and composing the voicemail

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:1963(<0.19072.238>) opening df2ddb35ff8caeca1284ac14b556cb6f

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:1775(<0.19072.238>) loaded voicemail box df2ddb35ff8caeca1284ac14b556cb6f

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:1790(<0.19072.238>) mailbox limited to 100 voicemail messages (has 1 currently)

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kapps_config:475(<0.19072.238>) missing category keys(default) [<<"voicemail">>]: undefined

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:421(<0.19072.238>) caller is the owner of this mailbox

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:422(<0.19072.238>) overriding action as check (instead of compose)

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:280(<0.19072.238>) caller is the owner of this mailbox, and requires no pin

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:753(<0.19072.238>) playing mailbox main menu

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_amqp_channel:221(<0.19072.238>) published(e3af2ca25537432b514dc1442e4c9fd1 352B) to callctl(amqp://guest:guest@10.1.0.100:5672) exchange (routing key ecallmgr@ecallmgr.deskwaves.com-ecallmgr_call_control-<0.28696.46>-cfd9382e) via <0.4367.238>

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:760(<0.19072.238>) mailbox has 1 new and 0 saved messages

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_util:502(<0.19072.238>) using account override for vm-you_have in account ba4774842e5840b29c5f6ab1784ad171

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_util:522(<0.19072.238>) building default prompt path. Error looking up for prompt vm-you_have: {error,not_found}

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_util:502(<0.19072.238>) using account override for vm-new_message in account ba4774842e5840b29c5f6ab1784ad171

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_util:522(<0.19072.238>) building default prompt path. Error looking up for prompt vm-new_message: {error,not_found}

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_util:502(<0.19072.238>) using account override for vm-main_menu in account ba4774842e5840b29c5f6ab1784ad171

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_util:522(<0.19072.238>) building default prompt path. Error looking up for prompt vm-main_menu: {error,not_found}

Oct 27 22:58:50 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_amqp_channel:221(<0.19072.238>) published(85338a6b8576533184352f487462e87e 1K) to callctl(amqp://guest:guest@10.1.0.100:5672) exchange (routing key ecallmgr@ecallmgr.deskwaves.com-ecallmgr_call_control-<0.28696.46>-cfd9382e) via <0.4367.238>

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_amqp_channel:221(<0.19072.238>) published(9bb24f978cb30dcd326f36bcceb784f5 352B) to callctl(amqp://guest:guest@10.1.0.100:5672) exchange (routing key ecallmgr@ecallmgr.deskwaves.com-ecallmgr_call_control-<0.28696.46>-cfd9382e) via <0.4367.238>

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kapps_call_command:2495(<0.19072.238>) collected maximum digits ('1') from caller

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:779(<0.19072.238>) playing all messages in folder: new

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_url:54(<0.19072.238>) building media url from doc

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_file:68(<0.19072.238>) fetching attachment url for '<<"account%2Fba%2F47%2F74842e5840b29c5f6ab1784ad171-202010">>' , '<<"202010-381bd9efb3b8caafd80554e090a36c00">>', '<<"15b051d51c4441cc77d0cf56e6d709ea.mp3">>'

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_file:75(<0.19072.238>) building proxy URI: {<<"account%2Fba%2F47%2F74842e5840b29c5f6ab1784ad171-202010">>,<<"202010-381bd9efb3b8caafd80554e090a36c00">>,<<"15b051d51c4441cc77d0cf56e6d709ea.mp3">>,[{handler,{[{<<"kz_att_s3">>,{[{<<"S3">>,<<"g2gCdAAAAAVkAAZidWNrZXRtAAAACXRhbGtjaGllZmQAFGJ1Y2tldF9hY2Nlc3NfbWV0aG9kbQAAAARhdXRvZAAKZmllbGRfbGlzdGwAAAADdAAAAAFtAAAAA2FyZ20AAAAKYWNjb3VudF9pZHQAAAABbQAAAAVjb25zdG0AAAAJdm9pY2VtYWlsdAAAAAFtAAAAA2FyZ20AAAAKYXR0YWNobWVudGpkAANrZXltAAAAFEFLSUE0VDVUSktFQUlXNVZVVUlNZAAGc2VjcmV0bQAAAChOMml3WUhmVHZFOEFISXVXcTQvM3haWUpZRmVBcVdXS3Jpc1JKOEtKbQAAAE9iYTQ3NzQ4NDJlNTg0MGIyOWM1ZjZhYjE3ODRhZDE3MS92b2ljZW1haWwvMTViMDUxZDUxYzQ0NDFjYzc3ZDBjZjU2ZTZkNzA5ZWEubXAz">>},{<<"metadata">>,{[{<<"etag">>,<<"4a17005921e3f3d9f6a5c3b90d86949f">>},{<<"x-amz-request-id">>,<<"CCA38C9F65270D4B">>},{<<"x-amz-id-2">>,<<"wa/XMQ8akRC+Zwb3HPziYZa79AM+90hxSyLQAuHuvKgumEhmSJylDHBggKWXlk+5hN3W5KKtrg0=">>}]}}]}}]}},{rev,<<"2-d5af58792568c0e78d351a55c732c815">>},{stream_type,<<"single">>},{doc_type,<<"mailbox_message">>},{storage_id,<<"df2ddb35ff8caeca1284ac14b556cb6f">>}]}

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_media_file:55(<0.19072.238>) file server at <0.19154.238> for account%2Fba%2F47%2F74842e5840b29c5f6ab1784ad171-202010/202010-381bd9efb3b8caafd80554e090a36c00/15b051d51c4441cc77d0cf56e6d709ea.mp3

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_voicemail:912(<0.19072.238>) playing mailbox message 1 (http://kz-webhook.deskwaves.com:24517/single/g2gEbQAAADdhY2NvdW50JTJGYmElMkY0NyUyRjc0ODQyZTU4NDBiMjljNWY2YWIxNzg0YWQxNzEtMjAyMDEwbQAAACcyMDIwMTAtMzgxYmQ5ZWZiM2I4Y2FhZmQ4MDU1NGUwOTBhMzZjMDBtAAAAJDE1YjA1MWQ1MWM0NDQxY2M3N2QwY2Y1NmU2ZDcwOWVhLm1wM2wAAAACaAJkAAhkb2NfdHlwZW0AAAAPbWFpbGJveF9tZXNzYWdlaAJkAApzdG9yYWdlX2lkbQAAACBkZjJkZGIzNWZmOGNhZWNhMTI4NGFjMTRiNTU2Y2I2Zmo%3D/15b051d51c4441cc77d0cf56e6d709ea.mp3)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|cf_exe:800(<0.19072.238>) action cf_voicemail died unexpectedly (error): function_clause

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:97(<0.19072.238>) stacktrace:

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:106(<0.19072.238>) st: calendar:date_to_gregorian_days at 125

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:107(<0.19072.238>) args: error

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:104(<0.19072.238>) st: calendar:datetime_to_gregorian_seconds/1 at (138)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:104(<0.19072.238>) st: cf_voicemail:get_unix_epoch/2 at (2259)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:104(<0.19072.238>) st: cf_voicemail:message_prompt/4 at (876)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:104(<0.19072.238>) st: cf_voicemail:play_messages/5 at (913)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:104(<0.19072.238>) st: cf_voicemail:main_menu/3 at (781)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:104(<0.19072.238>) st: cf_voicemail:check_mailbox/2 at (242)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |db9ab9c9120442b6be66f0e1c81fce2a|kz_util:104(<0.19072.238>) st: cf_voicemail:handle/2 at (212)

Oct 27 22:58:57 kz-webhook 2600hz[862]: |0000000000|Undefined:Undefined(emulator) Error in process <0.19072.238> on node 'kazoo_apps@kz-webhook.deskwaves.com' with exit value:#012{{nocatch,function_clause},[{cf_exe,cf_module_task,4,[{file,"src/cf_exe.erl"},{line,802}]}]}

Link to comment
Share on other sites

It seems this is related to timezone according to the article below

@Darren Schreiber you were right in below article, when changing time zone from Asia/Jerusalem to America/NewYork it worked, but this would cause issues with the termporal rules if we dont set the correct timezone for the companies, I saw this issue was reported since 2017, any workaround here?

 

 

Link to comment
Share on other sites

  • 2600Hz Employees

So the proxy URL built is to stream S3 attachment to kazoo media_mgr node, then FreeSWITCH is given this proxy URL to fetch the media from (instead of FreeSWITCH going direct to S3).

As for the timezone issue, I'm not sure what's causing that crash when getting unix epoch for your timezone. I can manually run the code fine with 'Asia/Jerusalem' as the timezone.

Can you find that message's metadata in the MODB and see what the 'timestamp' key is set to?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...