mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7773 | russell | 2006-01-04 02:06:50 -0500 (Wed, 04 Jan 2006) | 2 lines use a more correct way of determining the size of the destination buffer ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
		
			
				
	
	
		
			58 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Asterisk -- An open source telephony toolkit.
 | |
|  *
 | |
|  * Copyright (C) 1999 - 2005, Digium, Inc.
 | |
|  *
 | |
|  * Russell Bryant <russelb@clemson.edu> 
 | |
|  *
 | |
|  * See http://www.asterisk.org for more information about
 | |
|  * the Asterisk project. Please do not directly contact
 | |
|  * any of the maintainers of this project for assistance;
 | |
|  * the project provides a web site, mailing lists and IRC
 | |
|  * channels for your use.
 | |
|  *
 | |
|  * This program is free software, distributed under the terms of
 | |
|  * the GNU General Public License Version 2. See the LICENSE file
 | |
|  * at the top of the source tree.
 | |
|  */
 | |
| 
 | |
| /*! \file
 | |
|  *
 | |
|  * \brief Functions for reading or setting the MusicOnHold class
 | |
|  *
 | |
|  * \author Russell Bryant <russelb@clemson.edu> 
 | |
|  */
 | |
| 
 | |
| #include <stdlib.h>
 | |
| 
 | |
| #include "asterisk.h"
 | |
| 
 | |
| #include "asterisk/channel.h"
 | |
| #include "asterisk/pbx.h"
 | |
| #include "asterisk/utils.h"
 | |
| 
 | |
| static char *function_moh_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
 | |
| {
 | |
| 	ast_copy_string(buf, chan->musicclass, len);
 | |
| 
 | |
| 	return buf;
 | |
| }
 | |
| 
 | |
| static void function_moh_write(struct ast_channel *chan, char *cmd, char *data, const char *value) 
 | |
| {
 | |
| 	ast_copy_string(chan->musicclass, value, sizeof(chan->musicclass));
 | |
| }
 | |
| 
 | |
| #ifndef BUILTIN_FUNC
 | |
| static
 | |
| #endif
 | |
| struct ast_custom_function moh_function = {
 | |
| 	.name = "MUSICCLASS",
 | |
| 	.synopsis = "Read or Set the MusicOnHold class",
 | |
| 	.syntax = "MUSICCLASS()",
 | |
| 	.desc = "This function will read or set the music on hold class for a channel.\n",
 | |
| 	.read = function_moh_read,
 | |
| 	.write = function_moh_write,
 | |
| };
 | |
| 
 |