EvoluxBR / greenswitch

Battle proven FreeSWITCH Event Socket Protocol client implementation with Gevent
Other
126 stars 50 forks source link

OutboundSessionHasGoneAway is only raised when talking to freeswitch #59

Closed italorossi closed 4 years ago

italorossi commented 4 years ago

This exception is only raised when a command is sent to FreeSWITCH and in some cases, we need to know earlier in order to stop doing other tasks not related to call handling. Example:

class MyApplication:
    def run(self):
        self.session.playback('my music', block=False)
        do_http_request()
        do_more_http_request()
        another_slow_function()
        self.session.play_and_get_digits(...) # Ths is where the exception is raised

In the above example, there's no way to stop doing the next two HTTP requests when the session goes away during the first one.