pickup.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 1999 - 2013, Digium, Inc.
  5. *
  6. * Matt Jordan <mjordan@digium.com>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*!
  19. * \file
  20. * \brief Call Pickup API
  21. *
  22. * Includes code and algorithms from the Zapata library.
  23. *
  24. */
  25. #ifndef _AST_PICKUP_H
  26. #define _AST_PICKUP_H
  27. /*!
  28. * \brief Test if a channel can be picked up.
  29. *
  30. * \param chan Channel to test if can be picked up.
  31. *
  32. * \note This function assumes that chan is locked.
  33. *
  34. * \return TRUE if channel can be picked up.
  35. */
  36. int ast_can_pickup(struct ast_channel *chan);
  37. /*!
  38. * \brief Find a pickup channel target by group.
  39. *
  40. * \param chan channel that initiated pickup.
  41. *
  42. * \retval target on success. The returned channel is locked and reffed.
  43. * \retval NULL on error.
  44. */
  45. struct ast_channel *ast_pickup_find_by_group(struct ast_channel *chan);
  46. /*!
  47. * \brief Pickup a call
  48. *
  49. * \param chan The channel that initiated the pickup
  50. *
  51. * \retval 0 on success
  52. * \retval -1 on failure
  53. */
  54. int ast_pickup_call(struct ast_channel *chan);
  55. /*!
  56. * \brief Pickup a call target.
  57. *
  58. * \param chan channel that initiated pickup.
  59. * \param target channel to be picked up.
  60. *
  61. * \note This function assumes that target is locked.
  62. *
  63. * \retval 0 on success.
  64. * \retval -1 on failure.
  65. */
  66. int ast_do_pickup(struct ast_channel *chan, struct ast_channel *target);
  67. /*!
  68. * \brief accessor for call pickup message type
  69. * \since 12.0.0
  70. *
  71. * \retval pointer to the stasis message type
  72. * \retval NULL if not initialized
  73. */
  74. struct stasis_message_type *ast_call_pickup_type(void);
  75. /*!
  76. * \brief Initialize pickup
  77. *
  78. * \retval 0 on success
  79. * \retval non-zero on failure
  80. */
  81. int ast_pickup_init(void);
  82. #endif /* _AST_PICKUP_H */