Hello,
o Peter Loeppky [10/31/08 14:15]:
> I am not sure if this got through. I didn't see it anywhere. So I am
> going to try again. Sorry if this is a re-post.
>
>
>
> I am developing a simple ivr app for sems. Right now it does nothing
> except accept a call. But what I had noticed when I hang up the call the
> thread does not get destroyed, and the destructor is not call. The only
> time I noticed the destructor getting called is when that audio codec
> failed to negotiate.
>
> Is there something that is needed in the custom app to make sure this gets
> destroyed correctly or is this a core issue?
maybe you don't call stopSession when the call is hangeg up? like
def onBye(self):
self.stopSession()
I don't know if the examples are complete. but this one below definitely
stops the session and it thread and deletes all the objects.
#
# just playing and recording to file for a random time (1..30)
#
from log import *
from ivr import *
from random import *
class IvrDialog(IvrDialogBase) :
def onSessionStart( self, hdrs ) :
self.audio_rec = IvrAudioFile()
self.audio_rec.open("/tmp/record_"+self.dialog.callid+".wav",
AUDIO_WRITE)
self.audio_pl = IvrAudioFile()
self.audio_pl.open("wav/default_en.wav", AUDIO_READ)
self.enqueue(self.audio_pl,self.audio_rec)
ctime = randint(1, 30)
self.setTimer(10, ctime)
info("setting call timer %d seconds " % ctime)
def onBye(self):
self.stopSession()
def onTimer(self, id):
info('stopping session')
self.bye()
self.stopSession()
hth
Stefan
>
> Peter
>
>
>
>
>
> _______________________________________________
> Sems mailing list
> [email protected]
> http://lists.iptel.org/mailman/listinfo/sems
--
Stefan Sayer
VoIP Services
[EMAIL PROTECTED]
www.iptego.com
IPTEGO GmbH
Am Borsigturm 40
13507 Berlin
Germany
Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems