[asterisk-bugs] [Asterisk 0015227]: ChanIsAvail() always returns 0 (Unknown)

Asterisk Bug Tracker noreply at bugs.digium.com
Fri May 29 15:10:32 CDT 2009


The following issue has been UPDATED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15227 
====================================================================== 
Reported By:                pmhaddad
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15227
Category:                   Applications/app_chanisavail
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0.9 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-05-29 15:07 CDT
Last Modified:              2009-05-29 15:10 CDT
====================================================================== 
Summary:                    ChanIsAvail() always returns 0 (Unknown)
Description: 
I am trying to determine whether or not a DAHDI channel is on or off the
hook. But no matter what I do it always returns unknown or zero for the
value. I'm running Asterisk 1.6.0.9. In the CLI I can see that the phone is
off or on the hook by doing a dahdi show channel 1.

Here is part of my extensions.conf

exten => s,1,ChanIsAvail(SIP/server&DAHDI/1)
exten => s,n,Read(${AVAILCHAN})
exten => s,n,Set(NEWVAR=${CUT(AVAILCHAN,/,1)})
exten => s,n,GoToIf($["${NewVar}"="DAHDI"]?dahdi
exten => s,n,GoToIf($["${NewVar}"=""]?down
exten => s,n(dahdi),NoOp(My phone state is currently
${DEVICE_STATE(DAHDI/1)})
exten => s,n,Noop(${AVAILSTATUS})
exten => s,n,Dial(DAHDI/1/${MACRO_EXTEN:1})
exten => s,n,Hangup()

Here is what the CLI shows.
Executing [s at macro-test:1] ChanIsAvail("SIP/2190-240bad10",
"SIP/server&DAHDI/1") in new stack
== Using SIP RTP CoS mark 5
-- Hungup 'DAHDI/1-1'
-- Executing [s at macro-test:2] Read("SIP/2190-240bad10", "DAHDI/1-1") in
new stack
-- User entered nothing.
-- Executing [s at macro-test:3] Set("SIP/2190-240bad10", "NEWVAR=DAHDI") in
new stack
-- Executing [s at macro-test:4] GotoIf("SIP/2190-240bad10", "1?dahdi") in
new stack
-- Goto (macro-test,s,6)
-- Executing [s at macro-test:6] NoOp("SIP/2190-240bad10", "My phone state is
currently UNKNOWN") in new stack
-- Executing [s at macro-test:7] NoOp("SIP/2190-240bad10", "0") in new stack

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-29 15:10 lmadsen        Severity                 major => minor      
======================================================================




More information about the asterisk-bugs mailing list