musiconhold.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 Music on hold handling
  20. */
  21. #ifndef _ASTERISK_MOH_H
  22. #define _ASTERISK_MOH_H
  23. #if defined(__cplusplus) || defined(c_plusplus)
  24. extern "C" {
  25. #endif
  26. /*!
  27. * \brief Turn on music on hold on a given channel
  28. *
  29. * \param chan The channel structure that will get music on hold
  30. * \param mclass The class to use if the musicclass is not currently set on
  31. * the channel structure. NULL and the empty string are equivalent.
  32. * \param interpclass The class to use if the musicclass is not currently set on
  33. * the channel structure or in the mclass argument.
  34. * NULL and the empty string are equivalent.
  35. *
  36. * \retval Zero on success
  37. * \retval non-zero on failure
  38. */
  39. int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass);
  40. /*! \brief Turn off music on hold on a given channel */
  41. void ast_moh_stop(struct ast_channel *chan);
  42. void ast_install_music_functions(int (*start_ptr)(struct ast_channel *, const char *, const char *),
  43. void (*stop_ptr)(struct ast_channel *),
  44. void (*cleanup_ptr)(struct ast_channel *));
  45. void ast_uninstall_music_functions(void);
  46. void ast_moh_cleanup(struct ast_channel *chan);
  47. #if defined(__cplusplus) || defined(c_plusplus)
  48. }
  49. #endif
  50. #endif /* _ASTERISK_MOH_H */