features.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 1999 - 2005, Digium, Inc.
  5. *
  6. * Mark Spencer <markster@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. /*! \file
  19. * \brief Call Parking and Pickup API
  20. * Includes code and algorithms from the Zapata library.
  21. */
  22. #ifndef _AST_FEATURES_H
  23. #define _AST_FEATURES_H
  24. #include "asterisk/pbx.h"
  25. #include "asterisk/linkedlists.h"
  26. #include "asterisk/bridge.h"
  27. /*! \brief main call feature structure */
  28. enum {
  29. AST_FEATURE_FLAG_NEEDSDTMF = (1 << 0),
  30. AST_FEATURE_FLAG_ONPEER = (1 << 1),
  31. AST_FEATURE_FLAG_ONSELF = (1 << 2),
  32. AST_FEATURE_FLAG_BYCALLEE = (1 << 3),
  33. AST_FEATURE_FLAG_BYCALLER = (1 << 4),
  34. AST_FEATURE_FLAG_BYBOTH = (3 << 3),
  35. };
  36. /*!
  37. * \brief Bridge a call, optionally allowing redirection
  38. *
  39. * \note The function caller is assumed to have already done the
  40. * COLP exchange for the initial bridging of the two channels if
  41. * it was desired.
  42. */
  43. int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config);
  44. /*!
  45. * \brief Bridge a call, and add additional flags to the bridge
  46. *
  47. * \details
  48. * This does the same thing as \ref ast_bridge_call, except that once the bridge
  49. * is created, the provided flags are set on the bridge. The provided flags are
  50. * added to the bridge's flags; they will not clear any flags already set.
  51. *
  52. * \param chan The calling channel
  53. * \param peer The called channel
  54. * \param config Bridge configuration for the channels
  55. * \param flags Additional flags to set on the created bridge
  56. *
  57. * \note The function caller is assumed to have already done the
  58. * COLP exchange for the initial bridging of the two channels if
  59. * it was desired.
  60. */
  61. int ast_bridge_call_with_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, unsigned int flags);
  62. /*!
  63. * \brief Add an arbitrary channel to a bridge
  64. * \since 12.0.0
  65. *
  66. * \details
  67. * The channel that is being added to the bridge can be in any state: unbridged,
  68. * bridged, answered, unanswered, etc. The channel will be added asynchronously,
  69. * meaning that when this function returns once the channel has been added to
  70. * the bridge, not once the channel has been removed from the bridge.
  71. *
  72. * In addition, a tone can optionally be played to the channel once the
  73. * channel is placed into the bridge.
  74. *
  75. * \note When this function returns, there is no guarantee that the channel that
  76. * was passed in is valid any longer. Do not attempt to operate on the channel
  77. * after this function returns.
  78. *
  79. * \param bridge Bridge to which the channel should be added
  80. * \param chan The channel to add to the bridge
  81. * \param features Features for this channel in the bridge
  82. * \param play_tone Indicates if a tone should be played to the channel
  83. * \param xfersound Sound that should be used to indicate transfer with play_tone
  84. *
  85. * \note The features parameter must be NULL or obtained by
  86. * ast_bridge_features_new(). You must not dereference features
  87. * after calling even if the call fails.
  88. *
  89. * \retval 0 Success
  90. * \retval -1 Failure
  91. */
  92. int ast_bridge_add_channel(struct ast_bridge *bridge, struct ast_channel *chan,
  93. struct ast_bridge_features *features, int play_tone, const char *xfersound);
  94. /*!
  95. * \brief parse L option and read associated channel variables to set warning, warning frequency, and timelimit
  96. * \note caller must be aware of freeing memory for warning_sound, end_sound, and start_sound
  97. */
  98. int ast_bridge_timelimit(struct ast_channel *chan, struct ast_bridge_config *config, char *parse, struct timeval *calldurationlimit);
  99. #endif /* _AST_FEATURES_H */