allow target-level headers on outdials (#29)

This commit is contained in:
Dave Horton
2022-02-10 14:34:21 -05:00
parent 2e88ab1f55
commit 63e9cb985e
2 changed files with 8 additions and 1 deletions

View File

@@ -338,6 +338,7 @@
"type": "string",
"enum": ["GET", "POST"]
},
"headers": "object",
"name": "string",
"number": "string",
"sipUri": "string",

View File

@@ -60,10 +60,16 @@ class SingleDialer extends Emitter {
opts.headers = opts.headers || {};
opts.headers = {
...opts.headers,
...(this.target.headers || {}),
'X-Jambonz-Routing': this.target.type,
'X-Jambonz-FS-UUID': srf.locals.fsUUID,
'X-Call-Sid': this.callSid
};
if (srf.locals.fsUUID) {
opts.headers = {
...opts.headers,
'X-Jambonz-FS-UUID': srf.locals.fsUUID,
};
}
this.ms = ms;
let uri, to;
try {