Recordings - External Storage Engine - Google Drive

315 views
Skip to first unread message

Marcin Muzylo

unread,
Jun 13, 2017, 10:33:47 AM6/13/17
to 2600hz-users
Hi ,
i wonder if someone tried to configure External Storage Engine to keep Recordings for example. Only one info that i found https://github.com/2600hz/kazoo/blob/4.1/applications/crossbar/doc/storage.md more or less explain structure but there is no even simple howto.

I assume that we need for External Storage and Google Drive:

1. start cb_storage

2. create new doc in oauth

3. create configuration under selected account that we want to use external storage
- storage doc
- storage.attachment.google_drive doc

4. Setup somehow recording option under callflow - if needed


Maybe someone can confirm this steps with any notes?, especially point 3 and 4 are not clear for me .


Thanks
Marcin

James Aimonetti

unread,
Jun 13, 2017, 12:57:49 PM6/13/17
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

The instructions for S3 are here:

https://docs.2600hz.com/dev/doc/blog/storage/

I think Google Drive instructions are coming, though I'll follow up with
the team about them.
- --
James Aimonetti

Lead Systems Architect
"If Dialyzer don't care, I don't care"
2600HzPDX | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEvSh+xZ5hP1H8lVIU1Mpr4k9cJWAFAllAGYUACgkQ1Mpr4k9c
JWAAWQf9GIrJ49RYHHv2LWlzGqbQv0udp+cV+vfpiG+NWa+/z8l/Pw0rs84j1fv+
E1fhKiPXFpaC0RotaJcOn5sdnvtUBy//uUtgiNrgaLFcRn/sX4wzswWf1yBENLRH
bkj06bXTiFoQT0e9DZaf/LIAnT2lPKsS79gcZ7HCIVyAB+bDTLVqHan2dP9mMAAk
jdI7fcXVLADSwI8N7YXRMTirg7b2bNcBNI6IepLD9dchc3li5qGLHUvK09HNXOSB
khaEVb4KPlxFms1ZRNP14X2VgCeXhEr5eD9W0ZkgbjsR7bx6w5DrSszkMIA08U5a
KnC3eze07A2DVa4FvDd7tkZuYGWErw==
=+TIK
-----END PGP SIGNATURE-----

Marcin Muzylo

unread,
Jun 14, 2017, 6:24:52 AM6/14/17
to 2600hz-users
thank you James, it works for S3, let me know how i can do same for Google Drive ?

short instruction for External Storage and S3 (kazoo 4.0.51):

1.
sup crossbar_maintenance start_module cb_storage

2.
curl -v -X PUT \ -H "X-Auth-Token: $AUTH_TOKEN" \ -d '{"data":{}}' "http://localhost:8000/v2/accounts/$ACCOUNT_ID/storage"

3.
curl https://www.uuidgenerator.net/api/version4/1 | sed 's/-//g' e3e26e06a4b1465599e6dc9e1516fd8b

4.
POST http://localhost:8000/v2/accounts/$ACCOUNT_ID/storage X-Auth-Token: xxx Content-Type: application/json {"data":{ "attachments": { "e3e26e06a4b1465599e6dc9e1516fd8b":{ "handler":"s3", "name":"Kazoo S3", "settings":{ "bucket":"my_kazoo_bucket_name", "key":"{AWS_ACCESS_KEY}", "secret":"{AWS_SECRET_KEY}" } } }, "plan":{ "modb":{ "types":{ "call_recording":{ "attachments":{ "handler":"e3e26e06a4b1465599e6dc9e1516fd8b" } } } } } }}

5.
in callflow  - call recording make settings without URL (empty)
also make sure mod_shout is enabled on FS

Marcin Muzylo

unread,
Jun 27, 2017, 10:31:16 AM6/27/17
to 2600hz-users
iam stuck  with google drive here (recording call) - kz 4.0.60:


11:57:49.129 [error] |0000000000|Undefined:Undefined (emulator) Error in process <0.739.1> on node 'kazoo...@dev.mykazoo.com' with exit value:
{[{reason,function_clause},{mfa,{kz_media_store_proxy,handle,2}},{stacktrace,[{kz_att_google_drive,put_attachment,[#{oauth_doc_id => <<"15005950503-s9pfu9j156324233easv7ps9qm7shk5.apps.googleusercontent.com">>},<<"account%2Fda%2F37%2F13632665d06f8a0868f271c1ff98-201706">>,<<"201706-ebe56753a3535c3795bcc2e32c11c076">>,<<"c5b7a8809acd3ae163659b04b6916b2c.mp3">>,<<73,68,51,3,0,0,0,0,1,89,84,83,83,69,0,0,0,48,0,0,0,76,65,77,69,32,54,,0,0,0,0,0,0,,0,0,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,243,13,31,214,1,48,48,249,64,124,31,124,70,31,78,15,159,203,131,229,240,124,31,124,184,62,7,193,240,125,242,224,251,249,112,252,184,62,15,190,15,131,231,240,124,31,224,248,63,131,224,249,252,31,15,241,59,249,255,78,15,131,239,172,31,15,229,193,247,226,112,254,176,125,249,112,255,7,223,151,15,241,59,245,135,213,22,144,16,24,97,132,2,129,64,160,80,48,3,148,238,226,217,99,216,139,168,247,136,167,190,34,81,239,196,66,193,95,226,33,96,169,102,255,194,165,154,21,44,223,255,10,150,104,85,77,21,255,254,2,13,3,32,32,208,50,48,52,33,24,11,18,10,133,194,193,88,228,96,49,26,0,0,26,253,128,158,7,191,206,2,78,73,1,181,248,192,255,243,136,4,91,7,252,11,75,31,196,137,129,41,34,94,94,95,143,192,1,20,130,68,30,127,253,77,214,29,131,147,188,185,41,153,255,254,201,32,55,237,167,161,66,229,96,74,147,255,255,227,143,197,102,176,211,20,101,180,197,165,196,63,255,255,205,173,54,157,73,154,82,101,9,122,220,87,226,196,234,117,194,63,255,255,253,32,18,173,53,223,200,5,93,200,103,224,232,83,246,240,194,40,63,255,255,255,254,254,108,173,243,119,13,239,55,188,33,233,32,231,69,34,140,234,61,26,107,15,211,239,255,255,255,255,255,254,233,180,244,212,165,159,119,237,255,63,253,244,126,89,91,150,191,162,242,225,74,63,130,143,61,51,166,9,81,48,250,1,73,48,40,0,190,48,109,65,128,48,43,64,40,48,4,64,37,48,27,0,85,48,6,0,3,6,128,8,96,10,128,16,243,227,255,255,255,255,250,63,255,255,255,255,253,31,255,221,202,138,255,220,46,39,20,128,69,194,104,238,88,37,20,8,197,70,123,212,156,27,52,161,61,237,171,206,129,36,123,176,73,15,224,213,27,210,38,229,172,4,64,248,6,67,209,16,184,248,33,41,70,73,20,143,232,26,46,250,214,206,199,38,199,140,156,166,140,86,255,243,136,4,129,7,12,26,166,0,239,128,0,30,122,14,129,151,204,88,2,131,98,46,225,66,71,51,27,99,217,23,205,92,79,29,123,107,226,20,190,71,215,27,91,244,204,213,163,180,12,23,36,138,136,255,253,172,250,152,131,254,198,125,51,222,197,32,103,197,170,76,65,77,69,51,46,57,57,46,53,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,...>>,...],...},...]},...],...}

11:57:49.130 [error] |0000000000|Undefined:Undefined (<0.739.1>) Ranch listener kz_media_proxy terminated in kz_media_store_proxy:handle/2 with reason: no function clause matching kz_att_google_drive:put_attachment(#{oauth_doc_id => <<"15005950503-s9pfu9j156324233easv7ps9qm7shk5.apps.googleusercontent.com">>}, <<"account%2Fda%2F37%2F13632665d06f8a0868f271c1ff98-201706">>, <<"201706-ebe56753a3535c3795bcc2e32c11c076">>, <<"c5b7a8809acd3ae163659b04b6916b2c.mp3">>, <<73,68,51,3,0,0,0,0,1,89,84,83,83,69,0,0,0,48,0,0,0,76,65,77,69,32,54,52,98,105,116,115,32,118,...>>, [{rev,<<"1-450e189982c167ea4de58afa54e5076b">>},{content_type,"audio/mpeg"},{doc_type,<<"call_reco...">>}]) line 51
11:57:49.322 [critical] |sakrucl...@mykazoo.pl|kapps_call_command:3094 (<0.726.1>) error storing file /tmp/c5b7a8809acd3ae163659b04b6916b2c.mp3 from media server frees...@dev.mykazoo.com : Received HTTP error 500 trying to save /tmp/c5b7a8809acd3ae163659b04b6916b2c.mp3 to http://430770c123f214e0:89da65b7...@dev.mykazoo.com:24517/store/g2gEbQAAADdhY2NvdW30JTJGZ4ElMkYzNyUyRjEzNjMyNjY1ZDA2ZjhhMDg2OGYyNzFjMWZmOTgtMjAxNzA2bQAAACcyMDE3MDYtZWJlNTY3NTNhMzUzNWMzNzk1YmNjMmUzMmMxMWMwNzZtAAAAJGM1YjdhODgwOWFjZDNhZTE2MzY1OWIwNGI2OTE2YjJjLm1wM2wAAAABaAJkAAhkb2NfdHlwZW0AAAAOY2FsbF9yZWNvcmRpbmdq/c5b7a8809acd3ae163659b04b6916b2c.mp3


so far created oauth :

[root@dev ~]# sup kazoo_oauth_maintenance register_oauth_app da3713632665d0600000001c1ff98 15005950503-s9pfu9j156324233easv7ps9qm7shk5.apps.googleusercontent.com mar...@myemail.pl N2#%GSFS3cIgejVOpB4zQfR google           
{ok,{[{<<"_id">>,<<"115005950503-s9pfu9j156324233easv7ps9qm7shk5.apps.googleusercontent.com">>},{<<"pvt_account_id">>,<<"da3713632665d06f8a0868f271c1ff98">>},{<<"pvt_secret">>,<<"N2#%GSFS3cIgejVOpB4zQfR">>},{<<"pvt_email">>,<<"mar...@myemail.pl">>},{<<"pvt_user_prefix">>,<<"7fb2abc8d1780868891797665768f010">>},{<<"pvt_oauth_provider">>,<<"google">>},{<<"pvt_type">>,<<"app">>},{<<"_rev">>,<<"1-fea82baf90d13f81a6fce5e4b0a05fa1">>}]}}

my storage:

{
    "data": {
        "attachments": {
            "1642e6256684492298939ded99548ab8": {
                "handler": "google_drive",
                "name": "googleDrive",
                "settings": {
                    "oauth_doc_id": "15005950503-s9pfu9j156324233easv7ps9qm7shk5.apps.googleusercontent.com"
                }
            }
        },
        "plan": {
            "modb": {
                "types": {
                    "mailbox_message": {
                        "attachments": {
                            "handler": "1642e6256684492298939ded99548ab8"
                        }
                    },
                    "call_recording": {
                        "attachments": {
                            "handler": "1642e6256684492298939ded99548ab8"
                        }
                    }
                }
            }
        },
        "id": "da3713632665d06f8a0868f271c1ff98"
    },
    "revision": "2-9d7a91e15ff3b3fd824657f01397a5e7",
    "request_id": "68797049d0bc81422b4f7b1c38f68329",
    "status": "success",


do i need anything else ?
Reply all
Reply to author
Forward
0 new messages