mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
fixed clean dualEp for rest dial dual_stream=true (#468)
* fixed clean dualEp for rest dial dual_stream=true * fix * fix * fix * fix * fix
This commit is contained in:
@@ -134,9 +134,6 @@ router.post('/', async(req, res) => {
|
||||
if (req.body.dual_streams) {
|
||||
dualEp = await ms.createEndpoint();
|
||||
localSdp = mergeSdpMedia(localSdp, dualEp.local.sdp);
|
||||
ep.on('destroy', () => {
|
||||
dualEp.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
const connectStream = async(remoteSdp) => {
|
||||
@@ -145,7 +142,8 @@ router.post('/', async(req, res) => {
|
||||
if (req.body.dual_streams) {
|
||||
const [sdpLegA, sdpLebB] = extractSdpMedia(remoteSdp);
|
||||
|
||||
await Promise.all([ep.modify(sdpLegA), dualEp.modify(sdpLebB)]);
|
||||
await ep.modify(sdpLegA);
|
||||
await dualEp.modify(sdpLebB);
|
||||
await ep.bridge(dualEp);
|
||||
} else {
|
||||
ep.modify(sdp);
|
||||
@@ -243,6 +241,7 @@ router.post('/', async(req, res) => {
|
||||
srf,
|
||||
req: inviteReq,
|
||||
ep,
|
||||
ep2: dualEp,
|
||||
tasks,
|
||||
callInfo,
|
||||
accountInfo,
|
||||
@@ -295,6 +294,9 @@ router.post('/', async(req, res) => {
|
||||
else console.error(err);
|
||||
}
|
||||
ep.destroy();
|
||||
if (dualEp) {
|
||||
dualEp.destroy();
|
||||
}
|
||||
setTimeout(restDial.kill.bind(restDial, cs), 5000);
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user