Skip to content

Commit

Permalink
add resetEslCustomEvent to recover the endpoint after conference
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Aug 31, 2024
1 parent 99732fa commit 19edefd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ class Endpoint extends Emitter {
* @returns {Promise} a promise is returned if no callback is supplied
*/
export(param, value, callback) { return setOrExport('export', this, param, value, callback); }
/**
* When the endpoint is used for conference, the esl::event::CUSTOM::<uuid> will be overide to conference
* listener. This API allow top application reset the esl::event::CUSTOM event to recover the endpoint functionality
*/

resetEslCustomEvent() {
this.conn.removeAllListeners('esl::event::CUSTOM::*');
this.conn.on(`esl::event::CUSTOM::${this.uuid}`, this._onCustomEvent.bind(this));
}

/**
* subscribe for custom events
Expand Down

0 comments on commit 19edefd

Please sign in to comment.