additional teams changes

This commit is contained in:
Dave Horton
2020-06-06 08:28:26 -04:00
parent 218152b844
commit cd58d4a4f0
2 changed files with 6 additions and 4 deletions

View File

@@ -255,10 +255,11 @@ class TaskDial extends Task {
callingNumber: this.callerId || req.callingNumber
};
if (this.target.find((t) => t.type === 'teams')) {
const t = this.target.find((t) => t.type === 'teams');
if (t) {
const obj = await lookupTeamsByAccount(cs.accountSid);
if (!obj) throw new Error('dial to ms teams not allowed; account must first be configured with teams info');
Object.assign(teamsInfo, {tenant_fqdn: obj.tenant_fqdn, ms_teams_fqdn: obj.ms_teams_fqdn});
Object.assign(teamsInfo, {tenant_fqdn: t.tenant || obj.tenant_fqdn, ms_teams_fqdn: obj.ms_teams_fqdn});
}
const ms = await cs.getMS();

View File

@@ -204,7 +204,7 @@
"type": "string",
"enum": ["phone", "sip", "user", "teams"]
},
"url": "string",
"confirmHook": "object|string",
"method": {
"type": "string",
"enum": ["GET", "POST"]
@@ -213,7 +213,8 @@
"number": "string",
"sipUri": "string",
"auth": "#auth",
"vmail": "boolean"
"vmail": "boolean",
"tenant": "string"
},
"required": [
"type"