Asterisk
  1. Asterisk
  2. ASTERISK-4733

[patch] allows asterisk to send SIGHUP to child AGI scripts on hangup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Resources/res_agi
    • Labels:
      None
    • Mantis ID:
      4854
    • Regression:
      No

      Description

      Currently Asterisk sends SIGHUP on hangup to child AGI scripts. The scripts do not recieve the signal because Asterisk has blocked the SIGHUP signal and the child inherits this signal mask. This patch unblocks signals before exec'ing AGI scripts.

                • ADDITIONAL INFORMATION ******

      This patch should fix a bug may perl users have been seeing where their AGI scripts continue to run long after the user hangs up.

        Activity

        Hide
        Donny Kavanagh added a comment -

        "Right behavior" and "the way it was" are very different.

        With 1.0.9 i have agi scrips which detect hangup, and do database cleanup etc before the scripts terminate. With CVS-STABLE that will no longer be possible. I will instead have to keep my state of the agi within a asterisk var, and then when i get sighup'ed call deadagi, passing in that state to peoperly clean up.

        People who had working agi scripts are going to have them broken by this change.
        Also DeadAGI used to work when the call was active, and when there was a hangup you still kept total control. Now if DeadAGI is active and a call is terminated the script within DeadAGI will terminate, you will have to call DeadAGI again to finish what you were doing.

        So i think this change in behavior is going to cause alot of hassle who have already developed agi applications. Its a total change which removes the ability to do cleanup within a AGI() call, unless your perticular scripting language of choice allows you to ignore sighup. And of course you are aware that you need to do so, which most people wont be.

        Show
        Donny Kavanagh added a comment - "Right behavior" and "the way it was" are very different. With 1.0.9 i have agi scrips which detect hangup, and do database cleanup etc before the scripts terminate. With CVS-STABLE that will no longer be possible. I will instead have to keep my state of the agi within a asterisk var, and then when i get sighup'ed call deadagi, passing in that state to peoperly clean up. People who had working agi scripts are going to have them broken by this change. Also DeadAGI used to work when the call was active, and when there was a hangup you still kept total control. Now if DeadAGI is active and a call is terminated the script within DeadAGI will terminate, you will have to call DeadAGI again to finish what you were doing. So i think this change in behavior is going to cause alot of hassle who have already developed agi applications. Its a total change which removes the ability to do cleanup within a AGI() call, unless your perticular scripting language of choice allows you to ignore sighup. And of course you are aware that you need to do so, which most people wont be.
        Hide
        Russell Bryant added a comment -

        I have reverted this to restore original behvior for 1.0.

        Can someone please write something up about this for UPGRADE.txt to warn people when they upgrade to 1.2?

        Show
        Russell Bryant added a comment - I have reverted this to restore original behvior for 1.0. Can someone please write something up about this for UPGRADE.txt to warn people when they upgrade to 1.2?
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 6264

        U trunk/res/res_agi.c

        ------------------------------------------------------------------------
        r6264 | markster | 2008-01-15 15:43:27 -0600 (Tue, 15 Jan 2008) | 2 lines

        Fix sighup with AGI (bug ASTERISK-4733)

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=6264

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 6264 U trunk/res/res_agi.c ------------------------------------------------------------------------ r6264 | markster | 2008-01-15 15:43:27 -0600 (Tue, 15 Jan 2008) | 2 lines Fix sighup with AGI (bug ASTERISK-4733 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=6264
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 6283

        U branches/v1-0/CHANGES
        U branches/v1-0/res/res_agi.c

        ------------------------------------------------------------------------
        r6283 | russell | 2008-01-15 15:43:44 -0600 (Tue, 15 Jan 2008) | 2 lines

        unmask SIGHUP before exec'ing AGI scripts (bug ASTERISK-4733)

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=6283

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 6283 U branches/v1-0/CHANGES U branches/v1-0/res/res_agi.c ------------------------------------------------------------------------ r6283 | russell | 2008-01-15 15:43:44 -0600 (Tue, 15 Jan 2008) | 2 lines unmask SIGHUP before exec'ing AGI scripts (bug ASTERISK-4733 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=6283
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 6347

        U branches/v1-0/res/res_agi.c

        ------------------------------------------------------------------------
        r6347 | russell | 2008-01-15 15:44:37 -0600 (Tue, 15 Jan 2008) | 2 lines

        revert SIGHUP patch to restore original behavior for 1.0 (bug ASTERISK-4733)

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=6347

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 6347 U branches/v1-0/res/res_agi.c ------------------------------------------------------------------------ r6347 | russell | 2008-01-15 15:44:37 -0600 (Tue, 15 Jan 2008) | 2 lines revert SIGHUP patch to restore original behavior for 1.0 (bug ASTERISK-4733 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=6347

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development