support for VoipCarriers that are customer PBXs

This commit is contained in:
Dave Horton
2020-02-08 10:39:17 -05:00
parent 1c9afcdf59
commit 9783afcff5
12 changed files with 271 additions and 799 deletions
+19
View File
@@ -48,6 +48,24 @@ async function createAccount(request, service_provider_sid, name = 'daveh') {
return result.sid;
}
async function createApplication(request, account_sid, name = 'daveh') {
const result = await request.post('/Applications', {
auth: authAdmin,
json: true,
body: {
name,
account_sid,
call_hook: {
url: 'http://example.com'
},
call_status_hook: {
url: 'http://example.com'
}
}
});
return result.sid;
}
async function deleteObjectBySid(request, path, sid) {
const result = await request.delete(`${path}/${sid}`, {
auth: authAdmin,
@@ -60,5 +78,6 @@ module.exports = {
createVoipCarrier,
createPhoneNumber,
createAccount,
createApplication,
deleteObjectBySid
};