Skip to content

Commit

Permalink
attach reason when endpoint is hanguped (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu authored Jan 14, 2025
1 parent a69d6b7 commit d659ed4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,8 @@ class Endpoint extends Emitter {
if ('HANGUP' === channelCallState && State.CONNECTED === this.state) {
debug(`Endpoint#_onChannelCallState ${this.uuid}: got BYE from Freeswitch end of call`);
this.state = State.DISCONNECTED;
this.emit('destroy');
const reason = evt.getHeader('Hangup-Cause') ;
this.emit('destroy', {reason});
}

this.emit('channelCallState', {state: channelCallState});
Expand Down

0 comments on commit d659ed4

Please sign in to comment.