Asterisk AGISIGHUP

Home » Asterisk Users » Asterisk AGISIGHUP
Asterisk Users 5 Comments

I am setting AGISIGHUP = no before running a Perl script via AGI but it doesn’t seem to be doing anything as the script is still exiting on a hangup and not completing properly. I am using Asterisk 1.4.35 and have tried various combinations. Can anyone shed any light on this?

Regards
Lee

5 thoughts on - Asterisk AGISIGHUP

  • Can you post the CLI output showing the hangup/script failure?

    _____

    href=”mailto:asterisk-users-bounces@lists.digium.com”>asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Lee Archer
    Sent: Thursday, August 26, 2010 11:39 AM

    Hi, I am setting AGISIGHUP=no before running a Perl script via AGI but it
    doesn’t seem to be doing anything as the script is still exiting on a hangup
    and not completing properly. I am using 1.4.35 and have tried various
    combinations. Can anyone shed any light on this?

    Regards

    Lee

  • I’m just a 1.2 Luddite, so I’ve never seen AGISIGHUP and I think it’s a
    bad idea to protect lazy programmers 🙂

    Program defensively!

    Trap the HUP and do what is appropriate for your script — even if that is
    to ignore it.

    If the successful execution of your system depends on a setting, how long
    will it take the next guy to figure out when the setting disappears
    unexpectedly?

  • href=”mailto:asterisk-users-bounces@lists.digium.com”>asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Steve Edwards

    bad idea to protect lazy programmers 🙂

    to ignore it.

    will it take the next guy to figure out when the setting disappears
    unexpectedly?

    As usual, Steve is right. Here’s a one-liner that should “fix” the problem

    local $SIG{HUP} = ‘IGNORE’;

    Does that make me lazy?

    TIA.

  • Not at all. If that is the correct “response” for your program, it’s
    perfect:

    1) The program will execute correctly on your system, my system, any
    system regardless of the configuration.

    2) It tells the next guy explicitly what you intended to happen upon
    receiving the signal.

  • Thanks for the replies. I am already ignoring the signal but it doesn’t
    seem to be making much difference on this system with this script. It’s
    an old legacy script I should hopefully be dropping and writing properly
    within the dial plan.

    I will keep trying!

    Thanks

    Lee