[asterisk-dev] ChanIsAvail: No AVAILCHAN when channel is in state greater than 1

Prince Singh prince at drishti-soft.com
Wed May 27 02:10:02 CDT 2009


When the channel is in any state > 1 , i.e. up and connected, the value of
the relevant channel variables is as follows:-
AVAILCHAN=""
AVAILORIGCHAN=""
AVAILSTATUS=(the enumerated value corrosponding to the state)

enum ast_channel_state {
        AST_STATE_DOWN,                 /*!< Channel is down and available
*/
        AST_STATE_RESERVED,             /*!< Channel is down, but reserved
*/
        AST_STATE_OFFHOOK,              /*!< Channel is off hook */
        AST_STATE_DIALING,              /*!< Digits (or equivalent) have
been dialed */
        AST_STATE_RING,                 /*!< Line is ringing */
        AST_STATE_RINGING,              /*!< Remote end is ringing */
        AST_STATE_UP,                   /*!< Line is up */
        AST_STATE_BUSY,                 /*!< Line is busy */
        AST_STATE_DIALING_OFFHOOK,      /*!< Digits (or equivalent) have
been dialed while offhook */
        AST_STATE_PRERING,              /*!< Channel has detected an
incoming call and is waiting for ring */

        AST_STATE_MUTE = (1 << 16),     /*!< Do not transmit voice data */
};



Looking at the code, the application does not set the AVAILCHAN &
AVAILORIGCHAN channel variables (tmp_availchan and tmp_availorig) when the
state is > 1
Any clues why its been done so?

For reference:-
host123f4a*CLI> core show application ChanIsAvail
host123f4a*CLI>
  -= Info about application 'ChanIsAvail' =-

[Synopsis]
Check channel availability

[Description]
  ChanIsAvail(Technology/resource[&Technology2/resource2...][,options]):
This application will check to see if any of the specified channels are
available.
  Options:
    a - Check for all available channels, not only the first one.
    s - Consider the channel unavailable if the channel is in use at all.
    t - Simply checks if specified channels exist in the channel list
        (implies option s).
This application sets the following channel variable upon completion:
  AVAILCHAN     - the name of the available channel, if one exists
  AVAILORIGCHAN - the canonical channel name that was used to create the
channel
  AVAILSTATUS   - the status code for the available channel



-- 
Regards,
Prince Singh
Drishti-Soft Solutions Pvt Ltd
http://www.drishti-soft.com
http://blog.drishti-soft.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20090527/19688525/attachment-0001.htm 


More information about the asterisk-dev mailing list