mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
add support for target.overrideTo in dial verb
This commit is contained in:
@@ -292,7 +292,8 @@
|
|||||||
"sipUri": "string",
|
"sipUri": "string",
|
||||||
"auth": "#auth",
|
"auth": "#auth",
|
||||||
"vmail": "boolean",
|
"vmail": "boolean",
|
||||||
"tenant": "string"
|
"tenant": "string",
|
||||||
|
"overrideTo": "string"
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"type"
|
"type"
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class SingleDialer extends Emitter {
|
|||||||
|
|
||||||
async exec(srf, ms, opts) {
|
async exec(srf, ms, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
opts.headers = opts.headers || {};
|
||||||
let uri, to;
|
let uri, to;
|
||||||
try {
|
try {
|
||||||
switch (this.target.type) {
|
switch (this.target.type) {
|
||||||
@@ -69,7 +70,6 @@ class SingleDialer extends Emitter {
|
|||||||
to = this.target.number;
|
to = this.target.number;
|
||||||
if ('teams' === this.target.type) {
|
if ('teams' === this.target.type) {
|
||||||
assert(this.target.teamsInfo);
|
assert(this.target.teamsInfo);
|
||||||
opts.headers = opts.headers || {};
|
|
||||||
Object.assign(opts.headers, {
|
Object.assign(opts.headers, {
|
||||||
'X-MS-Teams-FQDN': this.target.teamsInfo.ms_teams_fqdn,
|
'X-MS-Teams-FQDN': this.target.teamsInfo.ms_teams_fqdn,
|
||||||
'X-MS-Teams-Tenant-FQDN': this.target.teamsInfo.tenant_fqdn
|
'X-MS-Teams-Tenant-FQDN': this.target.teamsInfo.tenant_fqdn
|
||||||
@@ -83,6 +83,12 @@ class SingleDialer extends Emitter {
|
|||||||
uri = `sip:${this.target.name}`;
|
uri = `sip:${this.target.name}`;
|
||||||
to = this.target.name;
|
to = this.target.name;
|
||||||
|
|
||||||
|
if (this.target.overrideTo) {
|
||||||
|
Object.assign(opts.headers, {
|
||||||
|
'X-Override-To': this.target.overrideTo
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// need to send to the SBC registered on
|
// need to send to the SBC registered on
|
||||||
const reg = await registrar.query(aor);
|
const reg = await registrar.query(aor);
|
||||||
if (reg) {
|
if (reg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user