feat: Record all calls (#169)

* feat: schema change

* feat: record all calls

* add bucket test for S3

* wip: add S3 upload stream implementation

* wip

* wip: add ws server

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip: modify sub folder

* wip: add record endpoint

* wip: add record endpoint

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix: failing testcase

* bucket credentials with tags

* add tagging

* wip

* wip

* wip

* wip

* wip

* wip

* fixed phone number is not in order

* feat: schema change

* feat: record all calls

* add bucket test for S3

* wip: add S3 upload stream implementation

* wip

* wip: add ws server

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip: modify sub folder

* wip: add record endpoint

* wip: add record endpoint

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix: failing testcase

* bucket credentials with tags

* add tagging

* wip

* wip

* wip

* wip

* wip

* fixed phone number is not in order

* add schema changes to upgrade script

* use aws-sdk v3

* jambonz lamejs

* jambonz lamejs

* add back wav encoder

* wip: add record format to schema

* add record_format

* fix: record file ext

* fix: record file ext

* fix: record file ext

* fix: record file ext

* fix download audio

* bug fix: dtmf metadata is causing closure of websocket

* fix: add extra data to S3 metadata

* upgrade db script

* bugfix: region was being ignored in test s3 upload

---------

Co-authored-by: Dave Horton <daveh@beachdognet.com>
This commit is contained in:
Hoan Luu Huu
2023-06-10 01:57:06 +07:00
committed by GitHub
parent 46fb9b8875
commit e35a03c7ad
20 changed files with 3374 additions and 44 deletions

View File

@@ -168,11 +168,33 @@ test('account tests', async(t) => {
queue_event_hook: {
url: 'http://example.com/q',
method: 'post'
},
record_all_calls: true,
record_format: 'wav',
bucket_credential: {
vendor: 'aws_s3',
region: 'us-east-1',
name: 'recordings',
access_key_id: 'access_key_id',
secret_access_key: 'secret access key'
}
}
});
t.ok(result.statusCode === 204, 'successfully updated account using account level token');
/* verify that bucket credential is updated*/
result = await request.get(`/Accounts/${sid}`, {
auth: {bearer: accountLevelToken},
json: true,
});
t.ok(result.bucket_credential.vendor === 'aws_s3', 'bucket_vendor was updated');
t.ok(result.bucket_credential.name === 'recordings', 'bucket_name was updated');
t.ok(result.bucket_credential.access_key_id === 'access_key_id', 'bucket_access_key_id was updated');
t.ok(result.record_all_calls === 1, 'record_all_calls was updated');
t.ok(result.record_format === 'wav', 'record_format was updated');
/* verify that account level api key last_used was updated*/
result = await request.get(`/Accounts/${sid}/ApiKeys`, {
auth: {bearer: accountLevelToken},

View File

@@ -125,7 +125,8 @@ test('application tests', async(t) => {
"X-Reason" : "maximum call duration exceeded"\
}\
}\
]'
]',
record_all_calls: true
}
});
t.ok(result.statusCode === 204, 'successfully updated application');
@@ -138,6 +139,7 @@ test('application tests', async(t) => {
t.ok(result.messaging_hook.url === 'http://example2.com/mms' , 'successfully updated messaging_hook');
app_json = JSON.parse(result.app_json);
t.ok(app_json[0].verb === 'hangup', 'successfully updated app_json from application')
t.ok(result.record_all_calls === 1, 'successfully updated record_all_calls from application')
/* remove applications app_json*/
result = await request.put(`/Applications/${sid}`, {