Sat Sep 16 07:28:08 2006

Asterisk developer's documentation


func_moh.c

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Russell Bryant <russelb@clemson.edu> 
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  *
00021  * \brief Functions for reading or setting the MusicOnHold class
00022  * 
00023  */
00024 
00025 #include <stdlib.h>
00026 
00027 #include "asterisk.h"
00028 
00029 #include "asterisk/channel.h"
00030 #include "asterisk/pbx.h"
00031 #include "asterisk/utils.h"
00032 
00033 static char *function_moh_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
00034 {
00035    ast_copy_string(buf, chan->musicclass, len);
00036 
00037    return buf;
00038 }
00039 
00040 static void function_moh_write(struct ast_channel *chan, char *cmd, char *data, const char *value) 
00041 {
00042    ast_copy_string(chan->musicclass, value, sizeof(chan->musicclass));
00043 }
00044 
00045 #ifndef BUILTIN_FUNC
00046 static
00047 #endif
00048 struct ast_custom_function moh_function = {
00049    .name = "MUSICCLASS",
00050    .synopsis = "Read or Set the MusicOnHold class",
00051    .syntax = "MUSICCLASS()",
00052    .desc = "This function will read or set the music on hold class for a channel.\n",
00053    .read = function_moh_read,
00054    .write = function_moh_write,
00055 };
00056 

Generated on Sat Sep 16 07:28:08 2006 for Asterisk - the Open Source PBX by  doxygen 1.4.7