]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Document a limitation in the AVAILSTATUS variable from ChanIsAvail and provide
authorJoshua Colp <jcolp@digium.com>
Fri, 13 Nov 2009 17:19:59 +0000 (17:19 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 13 Nov 2009 17:19:59 +0000 (17:19 +0000)
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.4@229965 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

index c6931d8dba7473e711fc82a4c4571fe5a92cfd58..f089392ead0d4b01e4b808bc734c67fcab7116d8 100644 (file)
@@ -55,7 +55,12 @@ static char *synopsis = "Check channel availability";
 static char *descrip = 
 "  ChanIsAvail(Technology/resource[&Technology2/resource2...][|options]): \n"
 "This application will check to see if any of the specified channels are\n"
-"available. The following variables will be set by this application:\n"
+"available. 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"
+"The following variables will be set by this application:\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"
 "  ${AVAILSTATUS}   - the status code for the available channel\n"
index ece57e072b10f50091b61f85707800fafa9b813f..c9447cf6b1b94a8de80fcdaeab13c4e6f28d71d1 100644 (file)
@@ -449,7 +449,7 @@ exten => a,1,VoicemailMain(${ARG1})         ; If they press *, send the user into Voice
 ;   ${ARG1} - Device to page
 
 exten => s,1,ChanIsAvail(${ARG1}|js)                   ; j is for Jump and 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!!!!