Skip to content

Commit

Permalink
fix(fullaudio): properly terminate sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
prlanzarin committed Dec 9, 2021
1 parent a657e8c commit beaca8b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/audio/FullAudioManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,19 @@ module.exports = class AudioManager extends BaseManager {
return `${sessionId}:${connectionId}`;
}

_closeListener (sessionId, connectionId, metadata = {}) {
_closeSession (sessionId, connectionId, metadata = {}) {
const session = this._fetchSession(connectionId);

if (session) {
return session.stopListener(connectionId)
return this._stopSession(connectionId)
.then(() => {
this._deleteIceQueue(this._getReqIdentifier(sessionId, connectionId));
Logger.info(this._logPrefix, 'Listen only listener destroyed',
Logger.info(this._logPrefix, 'Full audio session destroyed',
metadata);
})
.catch((error) => {
this._deleteIceQueue(this._getReqIdentifier(sessionId, connectionId));
Logger.error(this._logPrefix, 'Listen only listener stop failed', {
Logger.error(this._logPrefix, 'CRITICAL: Full audio sessio destroy failed', {
errorMessage: error.message,
errorCode: error.code,
...metadata,
Expand All @@ -222,7 +222,7 @@ module.exports = class AudioManager extends BaseManager {
} = message;
const logMetadata = AudioManager.getMetadataFromMessage(message);

return this._closeListener(sessionId, connectionId, logMetadata);
return this._closeSession(sessionId, connectionId, logMetadata);
}

handleClose (message) {
Expand All @@ -234,7 +234,7 @@ module.exports = class AudioManager extends BaseManager {

Logger.info(this._logPrefix, 'Connection closed', logMetadata)

return this._closeListener(sessionId, connectionId, logMetadata);
return this._closeSession(sessionId, connectionId, logMetadata);
}

handleSubscriberAnswer (message) {
Expand Down

0 comments on commit beaca8b

Please sign in to comment.