Asterisk - The Open Source Telephony Project  18.5.0
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 <[email protected]>
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)
27 extern "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  */
43 int 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 */
46 void ast_moh_stop(struct ast_channel *chan);
47 
48 void 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 void ast_moh_cleanup(struct ast_channel *chan);
55 
56 #if defined(__cplusplus) || defined(c_plusplus)
57 }
58 #endif
59 
60 #endif /* _ASTERISK_MOH_H */
Main Channel structure associated with a channel.
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
Definition: channel.c:7876
void ast_uninstall_music_functions(void)
Definition: channel.c:7859
void ast_moh_cleanup(struct ast_channel *chan)
Definition: channel.c:7882
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:7866
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:7850