Asterisk
  1. Asterisk
  2. ASTERISK-5524

[patch] When "autoanswer=yes" channel doesn't auto hangup.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Severity: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Channels/chan_alsa
    • Labels:
      None
    • Mantis ID:
      5672
    • Regression:
      No

      Description

      chan_oss (old & new version) autohangup when "autoanswer=yes".
      It'll be great to have the same behavior at ALSA driver.

      The fix is trivial:
      alsa_hangup() should have the same code as you see in chan_oss_old.c oss_hangup().

      .....
      if (autoanswer)

      { /* Assume auto-hangup too */ hookstate = 0; }

      else

      { /* Make congestion noise */ res = 2; write(sndcmd[1], &res, sizeof(res)); }

      ....

      I've tested such fix. Works fine.

        Activity

        Hide
        Matt O'Gorman (Inactive) added a comment -

        you will need a disclaimer for any code contributed, even if it is an obvious one liner.

        Show
        Matt O'Gorman (Inactive) added a comment - you will need a disclaimer for any code contributed, even if it is an obvious one liner.
        Hide
        Matt O'Gorman (Inactive) added a comment -

        oops looking at your history it seems as if you already do have one on file, please say this next time.

        Show
        Matt O'Gorman (Inactive) added a comment - oops looking at your history it seems as if you already do have one on file, please say this next time.
        Hide
        Tilghman Lesher added a comment -

        It would appear that chan_alsa already has code to support setting a hangup, if the hookstate is set to non-zero (off-hook). If there's a problem with the hookstate not getting set, then we need to fix that, instead.

        Show
        Tilghman Lesher added a comment - It would appear that chan_alsa already has code to support setting a hangup, if the hookstate is set to non-zero (off-hook). If there's a problem with the hookstate not getting set, then we need to fix that, instead.
        Hide
        Dmytro Mishchenko added a comment -

        mogorman: I'm not submitting the new code. I'm saying that the code which exists at chan_oss_old.c, already written by somebody and disclaimed can be applied to chan_alsa.c to make channels behavior consistent. Please correct me if it wrong.

        Right now for one channel:
        autoanswer means - autoanswer and auto hangup (which is good IMHO), and for another channel it means autoanswer only.

        Corydon76: check current alsa_hangup() code and you'll see that there is no code for reseting hookstate. Then compare it to oss_hangup() from chan_oss_old.c

        Show
        Dmytro Mishchenko added a comment - mogorman: I'm not submitting the new code. I'm saying that the code which exists at chan_oss_old.c, already written by somebody and disclaimed can be applied to chan_alsa.c to make channels behavior consistent. Please correct me if it wrong. Right now for one channel: autoanswer means - autoanswer and auto hangup (which is good IMHO), and for another channel it means autoanswer only. Corydon76: check current alsa_hangup() code and you'll see that there is no code for reseting hookstate. Then compare it to oss_hangup() from chan_oss_old.c
        Hide
        Tilghman Lesher added a comment -

        Patch uploaded.

        Show
        Tilghman Lesher added a comment - Patch uploaded.
        Hide
        Kevin P. Fleming (Inactive) added a comment -

        Committed to CVS HEAD, thanks!

        Show
        Kevin P. Fleming (Inactive) added a comment - Committed to CVS HEAD, thanks!
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 7106

        U trunk/ChangeLog
        U trunk/channels/chan_alsa.c
        U trunk/channels/chan_oss_old.c

        ------------------------------------------------------------------------
        r7106 | kpfleming | 2008-01-15 15:56:11 -0600 (Tue, 15 Jan 2008) | 2 lines

        issue ASTERISK-5524

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

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

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 7106 U trunk/ChangeLog U trunk/channels/chan_alsa.c U trunk/channels/chan_oss_old.c ------------------------------------------------------------------------ r7106 | kpfleming | 2008-01-15 15:56:11 -0600 (Tue, 15 Jan 2008) | 2 lines issue ASTERISK-5524 ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=7106

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development