Asterisk - The Open Source Telephony Project GIT-master-754dea3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
musiconhold.h
Go to the documentation of this file.
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
19/*! \file
20 * \brief Music on hold handling
21 */
22
23#ifndef _ASTERISK_MOH_H
24#define _ASTERISK_MOH_H
25
26#if defined(__cplusplus) || defined(c_plusplus)
27extern "C" {
28#endif
29
30/*!
31 * \brief Turn on music on hold on a given channel
32 *
33 * \param chan The channel structure that will get music on hold
34 * \param mclass The class to use if the musicclass is not currently set on
35 * the channel structure. NULL and the empty string are equivalent.
36 * \param interpclass The class to use if the musicclass is not currently set on
37 * the channel structure or in the mclass argument.
38 * NULL and the empty string are equivalent.
39 *
40 * \retval Zero on success
41 * \retval non-zero on failure
42 */
43int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass);
44
45/*! \brief Turn off music on hold on a given channel */
46void ast_moh_stop(struct ast_channel *chan);
47
48void ast_install_music_functions(int (*start_ptr)(struct ast_channel *, const char *, const char *),
49 void (*stop_ptr)(struct ast_channel *),
50 void (*cleanup_ptr)(struct ast_channel *));
51
53
54/*!
55 * \brief Clean up music on hold state on a given channel
56 *
57 * \param chan The channel where music on hold was configured.
58 *
59 * \deprecated This function no longer does anything but is kept for
60 * backwards compatibility.
61 */
63
64#if defined(__cplusplus) || defined(c_plusplus)
65}
66#endif
67
68#endif /* _ASTERISK_MOH_H */
#define attribute_deprecated
Definition: compiler.h:47
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
Definition: channel.c:7787
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
Definition: channel.c:7797
void ast_install_music_functions(int(*start_ptr)(struct ast_channel *, const char *, const char *), void(*stop_ptr)(struct ast_channel *), void(*cleanup_ptr)(struct ast_channel *))
Definition: channel.c:7771
void ast_uninstall_music_functions(void)
Definition: channel.c:7780
void ast_moh_cleanup(struct ast_channel *chan) attribute_deprecated
Clean up music on hold state on a given channel.
Definition: channel.c:7803
Main Channel structure associated with a channel.