Hi Rafael
Im also still new to SEMS, but Id suggest looking at using one of the user
timers and then disconnecting the audio from the session and closing the wav
file in the onTimer function.
Let me know if you come right!
Cheers
Jason
On 6/27/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> i am new in ser and sems.
> i have running sersasi with sems 1.0.0
> i have a ivr python scrip that record my voice for e.g. 5 seconds and save
> it as a wave file on my harddisc.
> my problem is that the wave file is finaly saved only if i hang up (send
> bye) but the wave file should be saved directly after the 5 seconds without
> hang up the phone.
> Can someone help me?
> here my script:
>
> from log import *
> from ivr import *
>
> hallo = "/usr/audio/hallo_1oder2.wav"
> record = "/usr/audio/record.wav"
>
> class IvrDialog(IvrDialogBase) :
>
> def onSessionStart(self,hdrs):
>
> self.audio_play = IvrAudioFile()
> self.audio_play.open(hallo, AUDIO_READ)
> self.enqueue(self.audio_play,None)
>
> def onDtmf(self,event,duration):
>
> if event ==1:
> self.audio_rec = None
>
> self.audio_rec = IvrAudioFile()
>
> self.audio_rec.open("/usr/audio/record.wav",
> AUDIO_WRITE,)
> self.audio_rec.setRecordTime(5*1000)
> self.enqueue(None,self.audio_rec)
>
> if event ==2:
> self.audio_play = None
>
> self.audio_play = IvrAudioFile()
> self.audio_play.open(record,
> AUDIO_READ)
> self.enqueue(self.audio_play,None)
> def onBye(self):
> self.bye()
> self.stopSession()
>
> regards
> rafael
> ------------------------------
> *AOL eMail auf Ihrem Handy!*Ab sofort können Sie auch unterwegs Ihre AOL
> email abrufen. Registrieren <http://www.aol.de/Webmail/> Sie sich jetzt
> kostenlos.
>
>
> _______________________________________________
> Sems mailing list
> [email protected]
> http://lists.iptel.org/mailman/listinfo/sems
>
>
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems