[asterisk-users] AMI and ExtensionState command returning bogus 'status' number
Jose P. Espinal
rakh at dangerclan.net
Mon Dec 22 14:25:19 CST 2008
Hello List,
I have been working on a PHP application in order to build a BLF style
script.
Until now everything is going Ok but something a little (in my oppinion)
strange is going on with the 'ExtensionState' command;
The problem is that it does not returns the 'Status' as it's suposed to,
mentioned in the A.T.F.O.T book - version 2.,
where it sais something like:
"Notes: The following are the possible extension states:
-2 Extension removed
-1 Extension hint not found
0 Idle
1 In use
2 Busy"
I have confirmed that it is returning the 'Status' as described in
'devicestate.h'
( http://www.asterisk.org/doxygen/1.4/devicestate_8h-source.html ) ,
part of Asterisk source files.
Something like this:
/**
* Device is valid but channel didn't know state
* AST_DEVICE_UNKNOWN 0
*
* Device is not used
* AST_DEVICE_NOT_INUSE 1
*
* Device is in use
* AST_DEVICE_INUSE 2
*
* Device is busy
* AST_DEVICE_BUSY 3
*
* Device is invalid
* AST_DEVICE_INVALID 4
*
* Device is unavailable
* AST_DEVICE_UNAVAILABLE 5
*
* Device is ringing
* AST_DEVICE_RINGING 6
*
* Device is ringing *and* in use
* AST_DEVICE_RINGINUSE 7
*
* Device is on hold
* AST_DEVICE_ONHOLD 8
*
*/
Am I missing something?
Is this a 'bug' or I just blew something?
May I safely base my application on the 'Status' numbers returned as
described in 'devicestate.h'?
Can someone point me to some documentation that can clarify this?
Thank you in advice,
Regars.
--
Jose P. Espinal
http://blog.slackware-es.com
More information about the asterisk-users
mailing list