00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 1999 - 2005, Digium, Inc. 00005 * 00006 * Mark Spencer <markster@digium.com> 00007 * 00008 * See http://www.asterisk.org for more information about 00009 * the Asterisk project. Please do not directly contact 00010 * any of the maintainers of this project for assistance; 00011 * the project provides a web site, mailing lists and IRC 00012 * channels for your use. 00013 * 00014 * This program is free software, distributed under the terms of 00015 * the GNU General Public License Version 2. See the LICENSE file 00016 * at the top of the source tree. 00017 */ 00018 00019 /*! \file 00020 * \brief Music on hold handling 00021 */ 00022 00023 #ifndef _ASTERISK_MOH_H 00024 #define _ASTERISK_MOH_H 00025 00026 #if defined(__cplusplus) || defined(c_plusplus) 00027 extern "C" { 00028 #endif 00029 00030 /*! 00031 * \brief Turn on music on hold on a given channel 00032 * 00033 * \param chan The channel structure that will get music on hold 00034 * \param mclass The class to use if the musicclass is not currently set on 00035 * the channel structure. 00036 * \param interpclass The class to use if the musicclass is not currently set on 00037 * the channel structure or in the mclass argument. 00038 * 00039 * \retval 0 success 00040 * \retval non-zero failure 00041 */ 00042 int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass); 00043 00044 /*! Turn off music on hold on a given channel */ 00045 void ast_moh_stop(struct ast_channel *chan); 00046 00047 void ast_install_music_functions(int (*start_ptr)(struct ast_channel *, const char *, const char *), 00048 void (*stop_ptr)(struct ast_channel *), 00049 void (*cleanup_ptr)(struct ast_channel *)); 00050 00051 void ast_uninstall_music_functions(void); 00052 00053 void ast_moh_cleanup(struct ast_channel *chan); 00054 00055 #if defined(__cplusplus) || defined(c_plusplus) 00056 } 00057 #endif 00058 00059 #endif /* _ASTERISK_MOH_H */