plivo / plivoframework

Open Source Telephony Application Prototyping Framework
http://www.plivo.com/open-source/
Other
417 stars 180 forks source link

wait forever in outbound_async_server_test.py? #106

Open pubyun opened 10 years ago

pubyun commented 10 years ago

here is source code from outbound_async_server_test:

        # play file
        self.playback("/usr/local/freeswitch/sounds/en/us/callie/ivr/8000/ivr-hello.wav", terminators="*")
        # wait until playback is done
        self.log.info("Waiting end of playback ...")
        event = self._action_queue.get()
        # log playback execute response
        self.log.info("Playback done (%s)" % str(event.get_header('Application-Response')))
        # finally hangup
        self.hangup()

if we hangup the sip phone when playing ivr-hello.wav, ""Playback done" will not show in the log file. will outbound_async_server_test wait forever?

document of gevent:

http://www.gevent.org/gevent.queue.html

gevent.queue.Queue()

get(block=True, timeout=None)
Remove and return an item from the queue.

If optional args block is true and timeout is None (the default), block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout seconds and raises the Empty exception if no item was available within that time. Otherwise (block is false), return an item if one is immediately available, else raise the Empty exception (timeout is ignored in that case).