mixmonitor.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2013, Digium, Inc.
  5. *
  6. * Jonathan Rose <jrose@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. *
  20. * \brief loadable MixMonitor functionality
  21. *
  22. * \author Jonathan Rose <jrose@digium.com>
  23. */
  24. /*!
  25. * \brief Start a mixmonitor on a channel.
  26. * \since 12.0.0
  27. *
  28. * \param chan Which channel to put the MixMonitor on
  29. * \param filename What the name of the file should be
  30. * \param options What options should be used for the mixmonitor
  31. *
  32. * \retval 0 on success
  33. * \retval non-zero on failure
  34. */
  35. typedef int (*ast_mixmonitor_start_fn)(struct ast_channel *chan, const char *filename, const char *options);
  36. /*!
  37. * \brief Stop a mixmonitor on a channel.
  38. * \since 12.0.0
  39. *
  40. * \param chan Which channel to stop a MixMonitor on
  41. * \param mixmon_id Stop the MixMonitor with this mixmonid if it is on the channel (may be NULL)
  42. *
  43. * \retval 0 on success
  44. * \retval non-zero on failure
  45. */
  46. typedef int (*ast_mixmonitor_stop_fn)(struct ast_channel *chan, const char *mixmon_id);
  47. /*!
  48. * \brief MixMonitor virtual methods table definition
  49. * \since 12.0.0
  50. */
  51. struct ast_mixmonitor_methods {
  52. ast_mixmonitor_start_fn start;
  53. ast_mixmonitor_stop_fn stop;
  54. };
  55. /*!
  56. * \brief Setup MixMonitor virtual methods table. Use this to provide the MixMonitor functionality from a loadable module.
  57. * \since 12.0.0
  58. *
  59. * \param vmethod_table pointer to vmethod table providing mixmonitor functions
  60. *
  61. * \retval 0 if successful
  62. * \retval non-zero on failure
  63. */
  64. int ast_set_mixmonitor_methods(struct ast_mixmonitor_methods *vmethod_table);
  65. /*!
  66. * \brief Clear the MixMonitor virtual methods table. Use this to cleanup function pointers provided by a module that set.
  67. * \since 12.0.0
  68. *
  69. * \retval 0 if successful
  70. * \retval non-zero on failure (occurs when methods aren't loaded)
  71. */
  72. int ast_clear_mixmonitor_methods(void);
  73. /*!
  74. * \brief Start a mixmonitor on a channel with the given parameters
  75. * \since 12.0.0
  76. *
  77. * \param chan Which channel to apply the MixMonitor to
  78. * \param filename filename to use for the recording
  79. * \param options Optional arguments to be interpreted by the MixMonitor start function
  80. *
  81. * \retval 0 if successful
  82. * \retval non-zero on failure
  83. *
  84. * \note This function will always fail is nothing has set the mixmonitor methods
  85. */
  86. int ast_start_mixmonitor(struct ast_channel *chan, const char *filename, const char *options);
  87. /*!
  88. * \brief Stop a mixmonitor on a channel with the given parameters
  89. * \since 12.0.0
  90. *
  91. * \param chan Which channel to stop a MixMonitor on (may be NULL if mixmon_id is provided)
  92. * \param mixmon_id Which mixmon_id should be stopped (may be NULL if chan is provided)
  93. *
  94. * \retval 0 if successful
  95. * \retval non-zero on failure
  96. */
  97. int ast_stop_mixmonitor(struct ast_channel *chan, const char *mixmon_id);