Feature/incoming refer (#25)

* handle incoming REFER and send on to the FS

* clarity
This commit is contained in:
Dave Horton
2022-03-05 15:22:11 -05:00
committed by GitHub
parent 883c63723c
commit c08e35c261

View File

@@ -618,8 +618,20 @@ Duration=${payload.duration} `
}
}
else {
// TODO: forward on to feature server
res.send(501);
/* REFER coming in from a sip device, forward to feature server */
try {
const response = await dlg.other.request({
method: 'REFER',
headers: {
'Refer-To': req.get('Refer-To'),
'Referred-By': req.get('Referred-By'),
'User-Agent': req.get('User-Agent')
}
});
res.send(response.status, response.reason);
} catch (err) {
this.logger.error({err}, 'CallSession:_onRefer: error handling incoming REFER');
}
}
}