add support for overrideTo and 302 redirect on rest outdial

This commit is contained in:
Dave Horton
2021-09-24 09:58:39 -04:00
parent aebcf2b006
commit 7cf342eeb8
2 changed files with 12 additions and 1 deletions

View File

@@ -57,6 +57,11 @@ router.post('/', async(req, res) => {
case 'user':
uri = `sip:${target.name}`;
to = target.name;
if (this.target.overrideTo) {
Object.assign(opts.headers, {
'X-Override-To': this.target.overrideTo
});
}
break;
case 'sip':
uri = target.sipUri;
@@ -105,7 +110,7 @@ router.post('/', async(req, res) => {
/* now launch the outdial */
try {
const dlg = await srf.createUAC(uri, opts, {
const dlg = await srf.createUAC(uri, {...opts, followRedirects: true, keepUriOnRedirect: true}, {
cbRequest: (err, inviteReq) => {
if (err) {
logger.error(err, 'createCall Error creating call');