Python AGI’s And Hangups

Home » Asterisk Users » Python AGI’s And Hangups
Asterisk Users 1 Comment

Hi,

I am trying to help a friend that is using Asterisk along with a Python AGI. In the code I see:
agi.execute(pystrix.agi.core.StreamFile(MY_PATH+’/’+msg))
try:
agi.execute(pystrix.agi.core.RecordFile(rec_file, format=’wav’, escape_digits=’#’, timeout=-1, sample_offset=0, beep=True, silence=None))

except:
pass
Verbose(“DOVID: 88″)
attachments.append(rec_file+”.wav”)

If a call is made and the calling person presses # on the call then later on in the code it emails a recording to him. OTH if the caller hangs up while Asterisk is doing RecordFile then no email is sent. This makes sense to me since if Asterisk sends a SIGHUP to the Python script it will die in its tracks and not continue onwards. He says that in the past even if a call was hung up on as RecordFile was being ran he would get an email. I
don’t see any h extensions in the context that would handle the call should it hang up. I vaguely remember in the past reading on the list that it was possible with Python for the Agi to keep running even if the call was hung up on. Is that possible here? Could some change had been made to Asterisk that would alter how the Python script dies when there is a hangup?

TIA.

Dovid P.S. I know this is not the dev list but if there is anyone that I can pay to help me look at this and possibly resolve it please let me know.

One thought on - Python AGI’s And Hangups

  • The setting of the ‘${AGISIGHUP}’ channel variable should be checked.

    The output of ‘agi set debug on’ may yield clues.

    Do AGIs in other languages exhibit similar behavior?

    I have no specific knowledge of Python/AGI. Sorry.


    Thanks in advance,
    ————————————————————————-
    Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST
    https://www.linkedin.com/in/steve-edwards-4244281