* Fixed the example by replacing variable wav with self.wav.

* Added onEmptyQueue method that end the call after file has been played.


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1622 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Juha Heinanen 16 years ago
parent 9b7cf2416a
commit 2647c61aa7

@ -4,15 +4,26 @@
from log import *
from ivr import *
import os
class IvrDialog(IvrDialogBase):
def onSessionStart(self, hdrs):
f = open("wav/default_en.wav")
info("starting tmpfile.py")
f = open("/tmp/default_en.wav")
audio = f.read()
debug("Found audio file of length " + str(len(audio)))
fp = os.tmpfile()
fp.write(audio)
fp.seek(0)
wav = IvrAudioFile()
wav.fpopen("tmp.wav", AUDIO_READ, fp)
self.enqueue(wav, None)
self.wav = IvrAudioFile()
self.wav.fpopen("tmp.wav", AUDIO_READ, fp)
self.enqueue(self.wav, None)
return
def onEmptyQueue(self):
if not self.queueIsEmpty():
return
self.bye()
self.stopSession()
return

Loading…
Cancel
Save