equis software
2008-Apr-09 12:41 UTC
[asterisk-users] Catch end of Eagi script when caller hung up...HELP ME PLEASE!!
Hi, I need to catch then end of an eagi script (python) when caller hungup
because I want to generate my own CDR.
I try this
def run()
signal.signal(signal.SIGHUP, self.logsignal)
def logsignal(self,signum, frame):
self.putCDR()
....but didn't work. Then try with several signals like:
signal.signal(signal.SIGTERM, self.logsignal)
signal.signal(signal.SIGTSTP, self.logsignal)
signal.signal(signal.SIGPIPE, self.logsignal)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20080409/b2af75cc/attachment.htm
Tilghman Lesher
2008-Apr-09 13:37 UTC
[asterisk-users] Catch end of Eagi script when caller hung up...HELP ME PLEASE!!
On Wednesday 09 April 2008 07:41:17 equis software wrote:> Hi, I need to catch then end of an eagi script (python) when caller hungup > because I want to generate my own CDR. > I try this > > def run() > signal.signal(signal.SIGHUP, self.logsignal) > > def logsignal(self,signum, frame): > self.putCDR() > > ....but didn't work. Then try with several signals like: > signal.signal(signal.SIGTERM, self.logsignal) > signal.signal(signal.SIGTSTP, self.logsignal) > signal.signal(signal.SIGPIPE, self.logsignal)If you read the Python documentation, you'll see that your signal handler must be a routine that takes 2 arguments, not the 3 that you're providing here. -- Tilghman