]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 229966 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Fri, 13 Nov 2009 17:20:53 +0000 (17:20 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 13 Nov 2009 17:20:53 +0000 (17:20 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r229966 | file | 2009-11-13 11:20:26 -0600 (Fri, 13 Nov 2009) | 13 lines

  Merged revisions 229965 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r229965 | file | 2009-11-13 11:19:59 -0600 (Fri, 13 Nov 2009) | 6 lines

    Document a limitation in the AVAILSTATUS variable from ChanIsAvail and provide
    a workaround for it that does not change existing behavior.

    (closes issue #14426)
    Reported by: macli
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@229967 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_chanisavail.c
configs/extensions.conf.sample

index 3425bc35ab2a45b91da585088d728b379eaad1b7..8dc95cd9ed55a472192f960a420c9798a730d654 100644 (file)
@@ -53,6 +53,11 @@ static char *descrip =
 "    s - Consider the channel unavailable if the channel is in use at all.\n"
 "    t - Simply checks if specified channels exist in the channel list\n"
 "        (implies option s).\n"
+"Note that the AVAILSTATUS variable is used for both device state\n"
+"and cause code. It is therefore possible for it to give a value that may\n"
+"indicate a device is available when it is not. It is suggested that the\n"
+"AVAILORIGCHAN variable is used instead to see whether a device is available\n"
+"or not.\n"
 "This application sets the following channel variable upon completion:\n"
 "  AVAILCHAN     - the name of the available channel, if one exists\n"
 "  AVAILORIGCHAN - the canonical channel name that was used to create the channel\n"
index cb8b47cdd981607448eaace79be679f9d4e784c7..27e0aad46f9bfae190457f818d1aecc441f1a007 100644 (file)
@@ -493,7 +493,7 @@ exten => a,n,Return
 ;   ${ARG1} - Device to page
 
 exten => s,1,ChanIsAvail(${ARG1},s)                    ; s is for ANY call
-exten => s,n,GoToIf([${AVAILSTATUS} = "1"]?autoanswer:fail)
+exten => s,n,GoToIf([${AVAILORIGCHAN} = ""]?fail:autoanswer)
 exten => s,n(autoanswer),Set(_ALERT_INFO="RA")                 ; This is for the PolyComs
 exten => s,n,SIPAddHeader(Call-Info: Answer-After=0)   ; This is for the Grandstream, Snoms, and Others
 exten => s,n,NoOp()                                    ; Add others here and Post on the Wiki!!!!