Skip to content

Commit

Permalink
Releasing the async result greenlets added to _commands_sent variable…
Browse files Browse the repository at this point in the history
… on disconnect event (#48)
  • Loading branch information
evangilo authored and italorossi committed Jun 10, 2019
1 parent 0fee710 commit dc31b10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions greenswitch/esl.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ def on_disconnect(self, event):
self.expected_events[event_name]:
async_result.set_exception(OutboundSessionHasGoneAway())

for cmd in self._commands_sent:
cmd.set_exception(OutboundSessionHasGoneAway())

def on_hangup(self, event):
logging.info('Caller %s has gone away.' % self.caller_id_number)

Expand Down

0 comments on commit dc31b10

Please sign in to comment.