channelstate.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 1999 - 2010, Digium, Inc.
  5. *
  6. * See http://www.asterisk.org for more information about
  7. * the Asterisk project. Please do not directly contact
  8. * any of the maintainers of this project for assistance;
  9. * the project provides a web site, mailing lists and IRC
  10. * channels for your use.
  11. *
  12. * This program is free software, distributed under the terms of
  13. * the GNU General Public License Version 2. See the LICENSE file
  14. * at the top of the source tree.
  15. */
  16. /*! \file
  17. * \brief Channel states
  18. * \par See also:
  19. * \arg \ref Def_Channel
  20. * \arg \ref channel_drivers
  21. */
  22. #ifndef __AST_CHANNELSTATE_H__
  23. #define __AST_CHANNELSTATE_H__
  24. #include "asterisk.h"
  25. /*!
  26. * \brief ast_channel states
  27. *
  28. * \note Bits 0-15 of state are reserved for the state (up/down) of the line
  29. * Bits 16-32 of state are reserved for flags
  30. */
  31. enum ast_channel_state {
  32. AST_STATE_DOWN, /*!< Channel is down and available */
  33. AST_STATE_RESERVED, /*!< Channel is down, but reserved */
  34. AST_STATE_OFFHOOK, /*!< Channel is off hook */
  35. AST_STATE_DIALING, /*!< Digits (or equivalent) have been dialed */
  36. AST_STATE_RING, /*!< Line is ringing */
  37. AST_STATE_RINGING, /*!< Remote end is ringing */
  38. AST_STATE_UP, /*!< Line is up */
  39. AST_STATE_BUSY, /*!< Line is busy */
  40. AST_STATE_DIALING_OFFHOOK, /*!< Digits (or equivalent) have been dialed while offhook */
  41. AST_STATE_PRERING, /*!< Channel has detected an incoming call and is waiting for ring */
  42. AST_STATE_MUTE = (1 << 16), /*!< Do not transmit voice data */
  43. };
  44. /*!
  45. * \brief Change the state of a channel
  46. * \pre chan is locked
  47. */
  48. int ast_setstate(struct ast_channel *chan, enum ast_channel_state);
  49. #endif /* __AST_CHANNELSTATE_H__ */