stasis_app_snoop.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2013, Digium, Inc.
  5. *
  6. * Joshua Colp <jcolp@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. #ifndef _ASTERISK_STASIS_APP_SNOOP_H
  19. #define _ASTERISK_STASIS_APP_SNOOP_H
  20. /*! \file
  21. *
  22. * \brief Stasis Application Snoop API. See \ref res_stasis "Stasis
  23. * Application API" for detailed documentation.
  24. *
  25. * \author Joshua Colp <jcolp@digium.com>
  26. * \since 12
  27. */
  28. #include "asterisk/stasis_app.h"
  29. /*! \brief Directions for audio stream flow */
  30. enum stasis_app_snoop_direction {
  31. /*! \brief No direction */
  32. STASIS_SNOOP_DIRECTION_NONE = 0,
  33. /*! \brief Audio stream out to the channel */
  34. STASIS_SNOOP_DIRECTION_OUT,
  35. /*! \brief Audio stream in from the channel */
  36. STASIS_SNOOP_DIRECTION_IN,
  37. /*! \brief Audio stream to AND from the channel */
  38. STASIS_SNOOP_DIRECTION_BOTH,
  39. };
  40. /*!
  41. * \brief Create a snoop on the provided channel.
  42. *
  43. * \param chan Channel to snoop on.
  44. * \param spy Direction of media that should be spied on.
  45. * \param whisper Direction of media that should be whispered into.
  46. * \param app Stasis application to execute on the snoop channel.
  47. * \param app_args Stasis application arguments.
  48. * \return Snoop channel. ast_channel_unref() when done.
  49. * \return \c NULL if snoop channel couldn't be created.
  50. */
  51. struct ast_channel *stasis_app_control_snoop(struct ast_channel *chan,
  52. enum stasis_app_snoop_direction spy, enum stasis_app_snoop_direction whisper,
  53. const char *app, const char *app_args, const char *snoop_id);
  54. #endif /* _ASTERISK_STASIS_APP_SNOOP_H */